How can I escape double-quotes in ant?
Ant uses XML, so you can use the normal XML entities like ": tasklist /FI "IMAGENAME eq java.exe" /FI "MEMUSAGE gt 50000"
Ant uses XML, so you can use the normal XML entities like ": tasklist /FI "IMAGENAME eq java.exe" /FI "MEMUSAGE gt 50000"
You should be able to specify the keystore to use with these properties key.store=/path/to/key.keystore key.alias=alias key.store.password=pass key.alias.password=pass Just pass the properties in to Ant. [EDIT] From the docs at http://developer.android.com/guide/publishing/app-signing.html#setup The Android build tools provide a debug signing mode that makes it easier for you to develop and debug your application, while still meeting the … Read more
The build_info.properties file: build.major.number=00 build.revision.number=00 build.minor.number=00 The build.xml file: <?xml version=”1.0″ encoding=”UTF-8″?> <project name=”project” default=”current-number”> <property file=”build_info.properties”/> <property name=”build.number” value=”${build.major.number}.${build.minor.number}.${build.revision.number}”/> <target name=”current-number”> <echo>Current build number:${build.number}</echo> </target> <target name=”compile”> <antcall target=”revision”></antcall> </target> <target name=”dist”> <antcall target=”minor”></antcall> </target> <target name=”revision”> <propertyfile file=”build_info.properties”> <entry key=”build.revision.number” type=”int” operation=”+” value=”1″ pattern=”00″/> </propertyfile> </target> <target name=”minor”> <propertyfile file=”build_info.properties”> <entry key=”build.minor.number” type=”int” … Read more
ANT_HOME is not being resolved. Change %ANT_HOME%\bin in the Path system environment variable to c:\apache-ant\apache-ant-1.8.2\bin.
Your ant project launcher refers for some reason to a Java 5 environment. Select “Run as -> Configurations” and locate the ant build. Then indicate you want this configuration to run with a Java 6 JVM.
<path id=”build.classpath”> <fileset dir=”${basedir}”> <include name=”lib/*.jar”/> </fileset> </path> <pathconvert property=”manifest.classpath” pathsep=” “> <path refid=”build.classpath”/> <mapper> <chainedmapper> <flattenmapper/> <globmapper from=”*.jar” to=”lib/*.jar”/> </chainedmapper> </mapper> </pathconvert> <target depends=”compile” name=”buildjar”> <jar jarfile=”${basedir}/${test.jar}”> <fileset dir=”${build}” /> <manifest> <attribute name=”Main-Class” value=”com.mycompany.TestMain”/> <attribute name=”Class-Path” value=”${manifest.classpath}”/> </manifest> </jar> </target> For further information check out this article.
Thats the down side of external links in an accepted answer. Codehaus shut down and thus the solution is gone. For reference here’s the content behind the link – you basically only need to copy the <dependencies>…</dependencies> block to your antrun plugin… The maven-antrun-plugin runs ant with JAVA_HOME set to the jre subdirectory of the … Read more
In short, an ant script tells the ant tool what to do – “compile these files and then copy them to that folder. Then take the contents of this folder and create an archive.” While a maven pom declares what we would like to have as the result – “here are the names of the … Read more
You can use the maven-antrun-plugin to invoke the ant build. Then use the build-helper-maven-plugin to attach the jar produced by ant to the project. The attached artifact will be installed/deployed alongside the pom. If you specify your project with packaging pom, Maven will not conflict with the ant build. In the example below, the ant … Read more
I would modify your jar task to include multiple filesets; one for the classes and one for the source files. <jar destfile=”${target.dir}/my-app.jar”> <fileset dir=”${target.dir}/classes” /> <fileset dir=”${src.dir}” includes=”**/*.java”/> </jar> Packaging should be treated as a separate concern from compiling. This will give you more flexibility. For example, you may want to add other filesets to … Read more