I am using Ant to build my Android project. The Android project is checked into Tortoise SVN. Now when I create a build I want the apk files to ideally get generated into different folders on windows stating the version number of the build. For example on first build (ant release) I would like to have the folder bin/1.0/sample.apk and for the next bin/2.0/sample.apk so I cant maintain different versions.And ideally the version numbers should be version number of the manifest(right?). How can this be done ?
Share
You can have a custom_rules.xml file in your project that contains the statements for copying your apk to the required folder in a
-post-buildtarget. You can use thecopytask to take care of it.To retrieve the version information from the manifest, follow this answer on SO.
A sample of the custom_rules.xml would be:
Note: Currently, the apk is copied to a sub-folder of ‘bin’ folder. You would have to think of another directory as the ‘bin’ folder will be deleted on every clean operation.