From 0fd2efc6912586032d5dbe6d5c63e242cf65a31a Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Tue, 27 Apr 2010 15:57:52 -0700 Subject: Add rev 3 of the ant rules. For now they are the same as the r2. Also modified SetupTask to deal better with older tools. Change-Id: I22ff809ace3ff81fb6852a707165165a9b4ec88a --- anttasks/src/com/android/ant/SetupTask.java | 12 +- files/ant_lib_rules_r3.xml | 141 +++++++++ files/ant_rules_r3.xml | 459 ++++++++++++++++++++++++++++ files/ant_test_rules_r3.xml | 459 ++++++++++++++++++++++++++++ files/sdk.properties | 4 +- 5 files changed, 1070 insertions(+), 5 deletions(-) create mode 100644 files/ant_lib_rules_r3.xml create mode 100644 files/ant_rules_r3.xml create mode 100644 files/ant_test_rules_r3.xml diff --git a/anttasks/src/com/android/ant/SetupTask.java b/anttasks/src/com/android/ant/SetupTask.java index e1ee825..a840783 100644 --- a/anttasks/src/com/android/ant/SetupTask.java +++ b/anttasks/src/com/android/ant/SetupTask.java @@ -65,7 +65,7 @@ import javax.xml.xpath.XPathExpressionException; */ public final class SetupTask extends ImportTask { /** current max version of the Ant rules that is supported */ - private final static int ANT_RULES_MAX_VERSION = 2; + private final static int ANT_RULES_MAX_VERSION = 3; // legacy main rules file. private final static String RULES_LEGACY_MAIN = "android_rules.xml"; @@ -183,9 +183,13 @@ public final class SetupTask extends ImportTask { int antBuildVersion = androidTarget.getProperty(SdkConstants.PROP_SDK_ANT_BUILD_REVISION, 1); if (antBuildVersion > ANT_RULES_MAX_VERSION) { - throw new BuildException(String.format( - "The project target (%1$s) requires a more recent version of the tools. Please update.", - androidTarget.getName())); + antBuildVersion = ANT_RULES_MAX_VERSION; + System.out.println("\n\n\n" + + "***********************************************************\n" + + "WARNING: This platform requires Ant build rules not supported by your SDK Tools.\n" + + "WARNING: Attempting to use older build rules instead, but result may not be correct.\n" + + "WARNING: Please update to the newest revisions of the SDK Tools.\n" + + "***********************************************************\n\n\n"); } // check if the project is a library diff --git a/files/ant_lib_rules_r3.xml b/files/ant_lib_rules_r3.xml new file mode 100644 index 0000000..c207308 --- /dev/null +++ b/files/ant_lib_rules_r3.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creating output directories if needed... + + + + + + + + + + Generating R.java / Manifest.java from the resources... + + + + + + + + + + + + + + + + + + + + + + + + + + + + Android Ant Build. Available targets: + help: Displays this help. + clean: Removes output files created by other targets. + compile: Compiles project's .java files into .class files. + + diff --git a/files/ant_rules_r3.xml b/files/ant_rules_r3.xml new file mode 100644 index 0000000..ffd7c41 --- /dev/null +++ b/files/ant_rules_r3.xml @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converting compiled files and external libraries into ${intermediate.dex.file}... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Running zip align on final apk... + + + + + + + + + + + + + + Installing ${out.debug.package} onto default emulator or device... + + + + + + + + + + + + + + Creating output directories if needed... + + + + + + + + + + Generating R.java / Manifest.java from the resources... + + + + + + + + Compiling aidl files into Java classes... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Packaging resources + + + + + + + + + + + + + + + + + + + + + + + + + + + Debug Package: ${out.debug.package} + + + + + + + + + + + + + No key.store and key.alias properties found in build.properties. + Please sign ${out.unsigned.package} manually + and run zipalign from the Android SDK tools. + + + + + + + + + Signing final apk... + + + + + Release Package: ${out.release.package} + + + + + + + + + + + + + + Unable to run 'ant uninstall', manifest.package property is not defined. + + + + + + Uninstalling ${manifest.package} from the default emulator or device... + + + + + + + + + + + + + + + + + Instrumenting classes from ${out.absolute.dir}/classes... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Android Ant Build. Available targets: + help: Displays this help. + clean: Removes output files created by other targets. + compile: Compiles project's .java files into .class files. + debug: Builds the application and signs it with a debug key. + release: Builds the application. The generated apk file must be + signed before it is published. + install: Installs/reinstalls the debug package onto a running + emulator or device. + If the application was previously installed, the + signatures must match. + uninstall: Uninstalls the application from a running emulator or + device. + + diff --git a/files/ant_test_rules_r3.xml b/files/ant_test_rules_r3.xml new file mode 100644 index 0000000..ffd7c41 --- /dev/null +++ b/files/ant_test_rules_r3.xml @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Converting compiled files and external libraries into ${intermediate.dex.file}... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Running zip align on final apk... + + + + + + + + + + + + + + Installing ${out.debug.package} onto default emulator or device... + + + + + + + + + + + + + + Creating output directories if needed... + + + + + + + + + + Generating R.java / Manifest.java from the resources... + + + + + + + + Compiling aidl files into Java classes... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Packaging resources + + + + + + + + + + + + + + + + + + + + + + + + + + + Debug Package: ${out.debug.package} + + + + + + + + + + + + + No key.store and key.alias properties found in build.properties. + Please sign ${out.unsigned.package} manually + and run zipalign from the Android SDK tools. + + + + + + + + + Signing final apk... + + + + + Release Package: ${out.release.package} + + + + + + + + + + + + + + Unable to run 'ant uninstall', manifest.package property is not defined. + + + + + + Uninstalling ${manifest.package} from the default emulator or device... + + + + + + + + + + + + + + + + + Instrumenting classes from ${out.absolute.dir}/classes... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Android Ant Build. Available targets: + help: Displays this help. + clean: Removes output files created by other targets. + compile: Compiles project's .java files into .class files. + debug: Builds the application and signs it with a debug key. + release: Builds the application. The generated apk file must be + signed before it is published. + install: Installs/reinstalls the debug package onto a running + emulator or device. + If the application was previously installed, the + signatures must match. + uninstall: Uninstalls the application from a running emulator or + device. + + diff --git a/files/sdk.properties b/files/sdk.properties index a48a85d..cf62029 100644 --- a/files/sdk.properties +++ b/files/sdk.properties @@ -1,4 +1,6 @@ # SDK properties +# This file is copied in the root folder of each platform component. +# If it used by various tools to figure out what the platform can do. sdk.build.support.library=true -sdk.ant.build.revision=2 +sdk.ant.build.revision=3 sdk.ant.templates.revision=1 \ No newline at end of file -- cgit v1.1