I’m new to automating builds using Ant. I have a bunch of Android project in Eclipse and I’ve gotten as far as setting up Ant builds I can run from the command line for each project, where a signed APK is generated in the ‘bin’ directory for whatever project I am running the build on.
If possible, I’d like to setup a single script to build each of my projects and output the signed APK’s to one directory on my computer. Not exactly sure how to do that, whether I need to write a batch script or something else.
Any insight would be appreciated.
A batch script could be one option. Another, now that you’re working with Ant, would be to create an Ant script that runs all the other Ant scripts and copies the results.
You can use the
anttask to run one Ant script from another. You can then use thecopytask to copy the resulting APK file to where you want it.Here is an example that runs the default target of the
build.xmlfile found in the directorypath_to_other_projectand then copies any APK files found inpath_to_other_project/bintodestination_dir.If you have several projects, you can replace several similar calls to
antwith one call tosubant.