How can I specify location of debug keystore for Android ant debug builds?

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

Build numbers: major.minor.revision

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

Generate manifest class-path from in Ant

<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.

JAVA_HOME gets mangled by Maven

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

How to wrap an Ant build with Maven?

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

generate jars with source code using Ant

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