These 4 files (build.xml, local.properties, projects.properties, proguard.cfg) are auto-generated when running:
android update project –name TestApp –target 10 -p .
Updated project.properties
Updated local.properties
Added file ./build.xml
Updated file ./proguard.cfg
But I want the "auto-gen" build.xml to also include the following "pre-compile" code as well, is there a way to do that? Is there some "include" file or "template" file which can include that?
<target name="config">
<property name="config-target-path" value="${source.dir}/com/androidengineer/antbuild"/>
<!-- Copy the configuration file, replacing tokens in the file. -->
<copy file="config/Config.java" todir="${config-target-path}"
overwrite="true" encoding="utf-8">
<filterset>
<filter token="CONFIG.LOGGING" value="${config.logging}"/>
</filterset>
</copy>
</target>
The
build.xmlas generated by theandroidtool (at least when using Android SDK r20) contains this piece of code:So what I do to create additional targets or customize existing targets is to create a
custom_rules.xmlfile with these new targets. Note that in my tests the targets needed to be nested in a<project>tag, so simply copy the first two lines of your generatedbuild.xmltocustom_rules.xml, and don’t forget about the closing</project>tag in the end. Ascustom_rules.xmlwill not be overwritten byandroid updateyour changes will be persistent and can be checked into your SCM tool of choice.