Merge change 25163 into eclair

* changes:
  Replace -no-sign and -debug-sign with macrodef attribute
This commit is contained in:
Android (Google) Code Review
2009-09-15 20:01:49 -04:00

View File

@@ -109,12 +109,13 @@
</extra-jars> </extra-jars>
</package-helper> --> </package-helper> -->
<macrodef name="package-helper"> <macrodef name="package-helper">
<attribute name="sign.package" />
<element name="extra-jars" optional="yes" /> <element name="extra-jars" optional="yes" />
<sequential> <sequential>
<apkbuilder <apkbuilder
outfolder="${out.absolute.dir}" outfolder="${out.absolute.dir}"
basename="${ant.project.name}" basename="${ant.project.name}"
signed="${sign.package}" signed="@{sign.package}"
verbose="true"> verbose="true">
<file path="${intermediate.dex.file}" /> <file path="${intermediate.dex.file}" />
<sourcefolder path="${source.absolute.dir}" /> <sourcefolder path="${source.absolute.dir}" />
@@ -236,28 +237,22 @@
basename="${ant.project.name}" /> basename="${ant.project.name}" />
</target> </target>
<!-- Packages the application and (maybe) sign it with a debug key. <!-- Packages the application and sign it with a debug key. -->
This requires the property sign.package to be set to true or false. --> <target name="-package-debug-sign" depends="-dex, -package-resources">
<target name="-package" depends="-dex, -package-resources"> <package-helper sign.package="true" />
<package-helper />
</target> </target>
<target name="-no-sign"> <!-- Packages the application without signing it. -->
<property name="sign.package" value="false" /> <target name="-package-no-sign" depends="-dex, -package-resources">
</target> <package-helper sign.package="false" />
<target name="-debug-sign">
<property name="sign.package" value="true" />
</target> </target>
<!-- Builds debug output package, provided all the necessary files are already dexed --> <!-- Builds debug output package, provided all the necessary files are already dexed -->
<target name="debug" depends="-debug-sign, -package" <target name="debug" depends="-package-debug-sign"
description="Builds the application and signs it with a debug key."> description="Builds the application and signs it with a debug key.">
<debug-helper /> <debug-helper />
</target> </target>
<target name="-release-package" depends="-no-sign, -package" />
<target name="-release-check"> <target name="-release-check">
<condition property="release.sign"> <condition property="release.sign">
<and> <and>
@@ -273,7 +268,7 @@
<echo>and run zipalign from the Android SDK tools.</echo> <echo>and run zipalign from the Android SDK tools.</echo>
</target> </target>
<target name="release" depends="-release-package, -release-nosign" if="release.sign" <target name="release" depends="-package-no-sign, -release-nosign" if="release.sign"
description="Builds the application. The generated apk file must be signed before description="Builds the application. The generated apk file must be signed before
it is published."> it is published.">
<!-- Gets passwords --> <!-- Gets passwords -->
@@ -366,7 +361,7 @@
<!-- Invoked from external files for code coverage purposes --> <!-- Invoked from external files for code coverage purposes -->
<target name="-package-with-emma" depends="-dex-instrumented, -package-resources"> <target name="-package-with-emma" depends="-dex-instrumented, -package-resources">
<package-helper> <package-helper sign.package="true">
<extra-jars> <extra-jars>
<!-- Injected from external file --> <!-- Injected from external file -->
<jarfile path="${emma.dir}/emma_device.jar" /> <jarfile path="${emma.dir}/emma_device.jar" />
@@ -374,8 +369,7 @@
</package-helper> </package-helper>
</target> </target>
<target name="-debug-with-emma" <target name="-debug-with-emma" depends="-package-with-emma">
depends="-debug-sign, -package-with-emma">
<debug-helper /> <debug-helper />
</target> </target>