From fff9ff696709e17ad73ae654e511907282bfc0fd Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Tue, 29 Sep 2009 18:06:01 -0700 Subject: [PATCH] Merge the new Ant script rules and template from Eclair (do not merge) --- tools/scripts/AndroidManifest.template | 2 +- tools/scripts/AndroidManifest.tests.template | 2 +- tools/scripts/alias_rules.xml | 24 +- tools/scripts/android_rules.xml | 462 ++++++++++++++++++--------- tools/scripts/android_test_rules.xml | 104 ++++++ tools/scripts/build.alias.template | 8 +- tools/scripts/build.template | 35 +- tools/scripts/java_file.template | 2 +- tools/scripts/java_tests_file.template | 8 +- 9 files changed, 456 insertions(+), 191 deletions(-) create mode 100644 tools/scripts/android_test_rules.xml diff --git a/tools/scripts/AndroidManifest.template b/tools/scripts/AndroidManifest.template index 2b06e76a..9b07072f 100644 --- a/tools/scripts/AndroidManifest.template +++ b/tools/scripts/AndroidManifest.template @@ -4,7 +4,7 @@ android:versionCode="1" android:versionName="1.0"> - diff --git a/tools/scripts/AndroidManifest.tests.template b/tools/scripts/AndroidManifest.tests.template index 1f7d827f..c74ff6db 100644 --- a/tools/scripts/AndroidManifest.tests.template +++ b/tools/scripts/AndroidManifest.tests.template @@ -17,5 +17,5 @@ --> + android:label="Tests for PACKAGE"/> diff --git a/tools/scripts/alias_rules.xml b/tools/scripts/alias_rules.xml index 57024613..273da45a 100644 --- a/tools/scripts/alias_rules.xml +++ b/tools/scripts/alias_rules.xml @@ -5,22 +5,22 @@ THIS FILE IS CURRENTLY BROKEN AND SHOULD NOT BE USED. --> - + - + - + - - + + - - + + - + @@ -33,11 +33,11 @@ THIS FILE IS CURRENTLY BROKEN AND SHOULD NOT BE USED. - + - + - + @@ -49,7 +49,7 @@ THIS FILE IS CURRENTLY BROKEN AND SHOULD NOT BE USED. Sending package to default emulator... - + diff --git a/tools/scripts/android_rules.xml b/tools/scripts/android_rules.xml index ad36cbe7..5b327369 100644 --- a/tools/scripts/android_rules.xml +++ b/tools/scripts/android_rules.xml @@ -6,7 +6,7 @@ com.android.ant.AndroidInitTask The following properties are put in place by the importing task: - android-jar, android-aidl, aapt, aidl, and dx + android.jar, android.aidl, aapt, aidl, and dx Additionnaly, the task sets up the following classpath reference: android.target.classpath @@ -16,184 +16,285 @@ + classpathref="android.antlibs" /> + classpathref="android.antlibs" /> + + - + + + - - - - - + + + + + + + + - - + + + - - + + + - - - - - - - + + + + - - - - - - + + - - - - - + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + 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... - - - - - + + + + + - - + + + + + + - - + destdir="${out.classes.absolute.dir}" + bootclasspathref="android.target.classpath" + verbose="${verbose}" classpath="${extensible.classpath}"> + + - - + - + - - - Converting compiled files and external libraries into ${out-folder}/${dex-file}... - - - - - - + + + - - + Packaging resources - - - - - - - - - - - - + + + - - + + + - - Running zip align on final apk... - - - - - - - Debug Package: ${out-debug-package} + + + + - + + + + Debug Package: ${out.debug.package} - + @@ -201,80 +302,139 @@ - + + No key.store and key.alias properties found in build.properties. - Please sign ${out-unsigned-package} manually + Please sign ${out.unsigned.package} manually and run zipalign from the Android SDK tools. - - + + + addproperty="key.store.password" /> - + addproperty="key.alias.password" /> + + Signing final apk... - - Running zip align on final apk... - - - - - - - Release Package: ${out-release-package} + keypass="${key.alias.password}" + verbose="${verbose}" /> + + + + Release Package: ${out.release.package} - - - Installing ${out-debug-package} onto default emulator... - - - - - + + - - + - + - - Unable to run 'ant unintall', application-package is not defined in build.properties + + + Unable to run 'ant uninstall', manifest.package property is not defined. + - - Uninstalling ${application-package} from the default emulator... + + + + 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. - debug: Builds the application and sign it with a debug key. + 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/reinstall the debug package onto a running + install: Installs/reinstalls the debug package onto a running emulator or device. If the application was previously installed, the signatures must match. - uninstall: uninstall the application from a running emulator or + uninstall: Uninstalls the application from a running emulator or device. diff --git a/tools/scripts/android_test_rules.xml b/tools/scripts/android_test_rules.xml new file mode 100644 index 00000000..78503aef --- /dev/null +++ b/tools/scripts/android_test_rules.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + Running tests ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Downloading coverage file into project directory... + + + + + + Extracting coverage report... + + + + + + + + + + + + Cleaning up temporary files... + + + + Saving the report file in ${basedir}/coverage/coverage.html + + + diff --git a/tools/scripts/build.alias.template b/tools/scripts/build.alias.template index 1043af18..d051405e 100644 --- a/tools/scripts/build.alias.template +++ b/tools/scripts/build.alias.template @@ -8,16 +8,16 @@ THIS FILE IS CURRENTLY BROKEN AND SHOULD NOT BE USED. - + - + - - + diff --git a/tools/scripts/build.template b/tools/scripts/build.template index 1ed38534..3959c570 100644 --- a/tools/scripts/build.template +++ b/tools/scripts/build.template @@ -2,22 +2,22 @@ - + - + - + - - - - - + + + + + + classpathref="android.antlibs" /> + diff --git a/tools/scripts/java_file.template b/tools/scripts/java_file.template index aeb541f7..19714a8e 100644 --- a/tools/scripts/java_file.template +++ b/tools/scripts/java_file.template @@ -3,7 +3,7 @@ package PACKAGE; import android.app.Activity; import android.os.Bundle; -public class ACTIVITY_NAME extends Activity +public class ACTIVITY_CLASS_NAME extends Activity { /** Called when the activity is first created. */ @Override diff --git a/tools/scripts/java_tests_file.template b/tools/scripts/java_tests_file.template index c6fa8736..08d6f9b5 100644 --- a/tools/scripts/java_tests_file.template +++ b/tools/scripts/java_tests_file.template @@ -9,13 +9,13 @@ import android.test.ActivityInstrumentationTestCase2; *

* To run this test, you can type: * adb shell am instrument -w \ - * -e class PACKAGE.ACTIVITY_NAMETest \ + * -e class ACTIVITY_FQ_NAME \ * PACKAGE.tests/android.test.InstrumentationTestRunner */ -public class ACTIVITY_NAMETest extends ActivityInstrumentationTestCase2 { +public class ACTIVITY_CLASS_NAME extends ActivityInstrumentationTestCase2 { - public ACTIVITY_NAMETest() { - super("PACKAGE", ACTIVITY_NAME.class); + public ACTIVITY_CLASS_NAME() { + super("PACKAGE", ACTIVITY_TESTED_CLASS_NAME.class); } } \ No newline at end of file -- 2.11.0