Conclusion, in case of use for others:

I have my own ant build file that calculates and sets the
"version.code" property used by the standard Android build, from SVN
Info of the working-version/revision/tag.
(for anyone interested in this, let me know). I invoke this ant target
from the "-pre-build" target in the Android "build.xml" file that
provides a hook just for those purposes.

I learned a detail of ant that surprised me:

Originally in the "-pre-build" target I just called my target (called
"build-info") thus:

<target name="-pre-build">
   <antcall "build-info />
</target>

but it turns out that the properties set by build-info when call like
that are NOT exported to the Android ant builds that end up packaging
the app and using the "version.code" property. I studied ant
properties quite a bit without resolving that, the documentation talks
a lot about how sub-projects inherit properties, but not much about
how they are exported from sub-projects.

Changing the "-pre-build" target to invoke "build-info" by depending
on it, solved that:

<target name="-pre-build" depends="build-info" />

Thus, my ¨build-info" target sets the "version.code" property, and the
Android build script uses it in its call to "aapt" when packing the
application and all works, with minimal changes to the Android build
scripts. Works fine from inside Eclipse (adding build-info as the
first builder) and outside Eclipse from the command line.

---------

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to