ant

“Can't load javah” error in Eclipse

落花浮王杯 提交于 2019-12-22 10:33:08
问题 I am trying to use the javah task in an ant build file in Eclipse and I keep getting the following error: BUILD FAILED C:\sandbox\build-jni.xml:7: Can't load javah Here is my build-jni.xml file: <project> <property name="bin" location="bin" /> <target name="generate-jni"> <javah destdir="${bin}" classpath="${bin}"> <class name="org.example.ExecJNI" /> </javah> </target> Any thoughts as to why I'm getting that error? My project is pointing to the JDK and not the JRE 回答1: Turned out I didn't

Ant create filesets, dirsets from (absolute) properties

≡放荡痞女 提交于 2019-12-22 10:32:17
问题 In ant, I have defined some properties that define some paths ( absolute ) needed in my build system. Most of ant tasks need filesets, so to build a fileset from a property I would have to do: <fileset dir="" includes="${myprop}"/> The problem is that myprop is absolute and I should omit the dir attribute ( which is not possible ), so is there a way to define (absolute) properties and efficiently use them to create filesets, dirsets, etc.. or in ant is this a bad practice (only relative paths

Ant xslt task output to stdout

心已入冬 提交于 2019-12-22 10:10:13
问题 Using the <xslt> task in ant, how do I get the output to generate to stdout? My XSLT is generating multiple files through xsl:result-document and the normal output is just status information that I'd like to show up with normal Ant output. Ant seems to force me to supply a destdir= or an out= parameter. Ant 1.8.2 with Saxon 9 回答1: Yes ant does this. However XSLT has the element which you can use to get output on the stdout :) <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

Ant <jar> task: using excludes parameter

柔情痞子 提交于 2019-12-22 10:04:35
问题 Got a following build.xml string: <jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" /> I am new to Ant and i don't understand how excludes string works. What files are affected? All java source files? Thanks. 回答1: First about the statement <jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" /> this target is used to package your files inside a jar archive destfile : specifies the name and location of the destination file, the archive

Include directory in WAR using Ant

元气小坏坏 提交于 2019-12-22 09:49:56
问题 I am building a war file using ANT and I want to include the src directory into the war file. When I use the fileset element, only the content of that folder is included. I want the src directory to be included into the WEB-INF folder. I don't want to copy the sources to the WEB-INF folder on disk. Ant properly includes the jars from my lib directory into WEB-INF/lib without copying them in my project. So I will have something like this: /WEB-INF /WEB-INF/src /WEB-INF/classes /WEB-INF/lib

Generate Checksum for directories using Ant build command

此生再无相见时 提交于 2019-12-22 09:46:58
问题 I tried to generate the checksum for directory using ant. I have tried the below command, but it generates recursively inside each folder for each file. <target name="default" depends=""> <echo message="Generating Checksum for each environment" /> <checksum todir="${target.output.dir}" format="MD5SUM" > <fileset dir="${target.output.dir}" /> </checksum> </target> I just want to generate one checksum for particular directory using Ant command. How do I do that? 回答1: You want to use the

Ant mail task - Issue in sending mail with attachments

对着背影说爱祢 提交于 2019-12-22 09:11:47
问题 When I tried using ant mail task, it doesnot seem to work when it comes sending mail with attachments. The problem I am currently facing is, it sends the attachment(s) content in the body of the email, rather than as attachement, even though verbose output displays as, it is sending with attachment. As initially it complained for missing jars, I added mail.jar & activation.jar. Here is the snippet which I tried: <mail mailhost="mailHost.com" messagemimetype="text/html" subject="Test report" >

Avoiding re-building prerequisites in Ant

北城余情 提交于 2019-12-22 08:54:38
问题 I have an existing Ant project and would like to speed up the build process by avoiding re-building components that are already up to date. Ant permits you to specify that one target depends on another, but by default every prerequisite is always rebuilt, even if it is already up to date. (This is a key difference between Ant and make. By default, make only re-builds a target when needed -- that is, if some prerequisite is newer.) <uptodate property="mytarget.uptodate"> // in set.mytarget

Run Ant target in background without using spawn=true

别来无恙 提交于 2019-12-22 08:29:07
问题 I would like to start a server in background, go back and execute some other targets, and then stop the server when Ant finishes executing all targets. I have come up with the following two solutions but they both block Ant from executing the subsequent targets. Since I want the process to die in the end, I do not want to use spawn="true". Is there any other solution? <target name="Start_Selenium_Server"> <java dir="lib" jar="lib/selenium-server-standalone-2.28.0.jar" fork="true"> <arg line="

Android Build in Eclipse not generating the right resource ids in R.java

℡╲_俬逩灬. 提交于 2019-12-22 08:18:56
问题 I've got an Android project that includes references to a library project. The library project contains a resource (a renderscript bytecode package). The main project also has it's own resources, including a layout, which contains a field that looks like this: <EditText android:id="@+id/edit_name" /> When I build my main project in ant, and I call findViewById(R.id.edit_name) at runtime, the call returns the EditText component I expect. But when I clean the projects and build them in Eclipse