summaryrefslogtreecommitdiffstats
path: root/tools/scripts
diff options
context:
space:
mode:
authorPiotr Gurgul <pgurgul@google.com>2009-09-15 16:38:40 -0700
committerPiotr Gurgul <pgurgul@google.com>2009-09-15 16:46:21 -0700
commit519e10746d310cefdcc83a056ecf04b600686f47 (patch)
tree75d51e1b9a948c948cef840b2570e018b4932d39 /tools/scripts
parentb57c64fa71d211bafc41e08fbd020a41d5027783 (diff)
downloadandroid_development-519e10746d310cefdcc83a056ecf04b600686f47.tar.gz
android_development-519e10746d310cefdcc83a056ecf04b600686f47.tar.bz2
android_development-519e10746d310cefdcc83a056ecf04b600686f47.zip
Replace -no-sign and -debug-sign with macrodef attribute
Instead of setting property indicating if package should be signed with debug key in separate targets, this information is being passed as a package-helper macrodef parameter.
Diffstat (limited to 'tools/scripts')
-rw-r--r--tools/scripts/android_rules.xml30
1 files changed, 12 insertions, 18 deletions
diff --git a/tools/scripts/android_rules.xml b/tools/scripts/android_rules.xml
index 2d8020dfc..6c42ee90d 100644
--- a/tools/scripts/android_rules.xml
+++ b/tools/scripts/android_rules.xml
@@ -109,12 +109,13 @@
</extra-jars>
</package-helper> -->
<macrodef name="package-helper">
+ <attribute name="sign.package" />
<element name="extra-jars" optional="yes" />
<sequential>
<apkbuilder
outfolder="${out.absolute.dir}"
basename="${ant.project.name}"
- signed="${sign.package}"
+ signed="@{sign.package}"
verbose="true">
<file path="${intermediate.dex.file}" />
<sourcefolder path="${source.absolute.dir}" />
@@ -236,28 +237,22 @@
basename="${ant.project.name}" />
</target>
- <!-- Packages the application and (maybe) sign it with a debug key.
- This requires the property sign.package to be set to true or false. -->
- <target name="-package" depends="-dex, -package-resources">
- <package-helper />
+ <!-- Packages the application and sign it with a debug key. -->
+ <target name="-package-debug-sign" depends="-dex, -package-resources">
+ <package-helper sign.package="true" />
</target>
- <target name="-no-sign">
- <property name="sign.package" value="false" />
- </target>
-
- <target name="-debug-sign">
- <property name="sign.package" value="true" />
+ <!-- Packages the application without signing it. -->
+ <target name="-package-no-sign" depends="-dex, -package-resources">
+ <package-helper sign.package="false" />
</target>
<!-- 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.">
<debug-helper />
</target>
- <target name="-release-package" depends="-no-sign, -package" />
-
<target name="-release-check">
<condition property="release.sign">
<and>
@@ -273,7 +268,7 @@
<echo>and run zipalign from the Android SDK tools.</echo>
</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
it is published.">
<!-- Gets passwords -->
@@ -366,7 +361,7 @@
<!-- Invoked from external files for code coverage purposes -->
<target name="-package-with-emma" depends="-dex-instrumented, -package-resources">
- <package-helper>
+ <package-helper sign.package="true">
<extra-jars>
<!-- Injected from external file -->
<jarfile path="${emma.dir}/emma_device.jar" />
@@ -374,8 +369,7 @@
</package-helper>
</target>
- <target name="-debug-with-emma"
- depends="-debug-sign, -package-with-emma">
+ <target name="-debug-with-emma" depends="-package-with-emma">
<debug-helper />
</target>