Reputation: 535
This is my custom_rules.xml which is called from 'build.xml'
<?xml version="1.0" encoding="UTF-8"?>
<project name="custom_rules">
<xmlproperty file="AndroidManifest.xml" prefix="mymanifest" collapseAttributes="true"/>
<property name="build.dir" value="releases" />
<property name="version.name" value="${mymanifest.manifest.android:versionName}" />
<property name="version.code" value="${mymanifest.manifest.android:versionCode}" />
<property name="out.file" value="${ant.project.name}-${version.name}_${version.code}.apk" />
<target name="-post-build">
<echo>Output filename: ${out.file}</echo>
<copy file="${out.final.file}" tofile="${build.dir}/${out.file}"/>
</target>
What I want to do is that the above should only be executed if ant was launched with ant release
Upvotes: 3
Views: 263
Reputation: 2013
The way I usually deal with it:
<property name="isreleasing" value="true" />
<target name="-post-build" if="isreleasing">
...
Upvotes: 1