aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-24 21:35:55 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-24 21:35:55 -0400
commitb55087616b2ef20f5f3d7691e329d421b5015eec (patch)
tree8569ad61a75aa33fde25a42524c3cd059a3fcdce
parent7a51ae586ce3b607aaa6c3a8bbf304cc96043106 (diff)
parent11a1b6842d6cd5768faec93ac5ab2b55dc209f03 (diff)
downloadsdk-b55087616b2ef20f5f3d7691e329d421b5015eec.zip
sdk-b55087616b2ef20f5f3d7691e329d421b5015eec.tar.gz
sdk-b55087616b2ef20f5f3d7691e329d421b5015eec.tar.bz2
Merge change 26976 into eclair
* changes: Add tested.project.dir to classpath for install and debug
-rw-r--r--scripts/android_rules.xml18
-rw-r--r--scripts/android_test_rules.xml11
2 files changed, 16 insertions, 13 deletions
diff --git a/scripts/android_rules.xml b/scripts/android_rules.xml
index 8b7fe88..5b32736 100644
--- a/scripts/android_rules.xml
+++ b/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}" />
diff --git a/scripts/android_test_rules.xml b/scripts/android_test_rules.xml
index fd8a521..efeb9a1 100644
--- a/scripts/android_test_rules.xml
+++ b/scripts/android_test_rules.xml
@@ -43,27 +43,22 @@
location="${instrumentation.absolute.dir}/classes" />
</target>
- <!-- Invoking this target sets the value of extensible.classpath, which is being added to javac
- classpath in target 'compile' (android_rules.xml) -->
- <target name="-set-run-tests-classpath">
- <property name="extensible.classpath"
- location="${tested.project.absolute.dir}/bin/classes" />
- </target>
-
<!-- Ensures that tested project is installed on the device before we run the tests.
Used for ordinary tests, without coverage measurement -->
<target name="-install-tested-project">
+ <property name="do.not.compile.again" value="true" />
<subant target="install">
<fileset dir="${tested.project.absolute.dir}" includes="build.xml" />
</subant>
</target>
- <target name="run-tests" depends="-set-run-tests-classpath, -install-tested-project, install"
+ <target name="run-tests" depends="-install-tested-project, install"
description="Runs tests from the package defined in test.package property">
<run-tests-helper />
</target>
<target name="-install-instrumented">
+ <property name="do.not.compile.again" value="true" />
<subant target="-install-with-emma">
<property name="out.absolute.dir" value="${instrumentation.absolute.dir}" />
<fileset dir="${tested.project.absolute.dir}" includes="build.xml" />