diff options
| author | Piotr Gurgul <pgurgul@google.com> | 2009-09-24 18:17:22 -0700 |
|---|---|---|
| committer | Piotr Gurgul <pgurgul@google.com> | 2009-09-24 18:17:22 -0700 |
| commit | bca3ef5c259079ef4a8e4a9b7487db809a270fb9 (patch) | |
| tree | aa9947fcc6fc9eeb4a33ec001f53cf2b2dcea6d1 /tools/scripts/android_rules.xml | |
| parent | b936faf6e6a3e10408f257f948241cf984d7652a (diff) | |
| download | android_development-bca3ef5c259079ef4a8e4a9b7487db809a270fb9.tar.gz android_development-bca3ef5c259079ef4a8e4a9b7487db809a270fb9.tar.bz2 android_development-bca3ef5c259079ef4a8e4a9b7487db809a270fb9.zip | |
Add tested.project.dir to classpath for install and debug
Now buildfile recognizes whether targets 'debug' or 'install' are being run for
an ordinary or test project and for the test projects classpath is extended
to enclose the tested project. Tested project is being compiled if necessary.
Diffstat (limited to 'tools/scripts/android_rules.xml')
| -rw-r--r-- | tools/scripts/android_rules.xml | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/scripts/android_rules.xml b/tools/scripts/android_rules.xml index 8b7fe8858..5b327369a 100644 --- a/tools/scripts/android_rules.xml +++ b/tools/scripts/android_rules.xml @@ -230,10 +230,12 @@ <!-- Compiles this project's .java files into .class files. --> <target name="compile" depends="-resource-src, -aidl" description="Compiles project's .java files into .class files"> - <!-- Allows to inject additional classpath from another (build|property) file. - As ant properties are immutable, the injected value will have priority - over the one defined below --> - <property name="extensible.classpath" value="." /> + <!-- If android rules are used for a test project, its classpath should include + tested project's location --> + <condition property="extensible.classpath" + value="${tested.project.absolute.dir}/bin/classes" else="."> + <isset property="tested.project.absolute.dir" /> + </condition> <javac encoding="ascii" target="1.5" debug="true" extdirs="" destdir="${out.classes.absolute.dir}" bootclasspathref="android.target.classpath" @@ -278,8 +280,14 @@ <package-helper sign.package="false" /> </target> + <target name="-compile-tested-if-test" if="tested.project.dir" unless="do.not.compile.again"> + <subant target="compile"> + <fileset dir="${tested.project.absolute.dir}" includes="build.xml" /> + </subant> + </target> + <!-- Builds debug output package, provided all the necessary files are already dexed --> - <target name="debug" depends="-package-debug-sign" + <target name="debug" depends="-compile-tested-if-test, -package-debug-sign" description="Builds the application and signs it with a debug key."> <zipalign-helper in.package="${out.debug.unaligned.package}" out.package="${out.debug.package}" /> |
