diff options
author | Xavier Ducrohet <xav@android.com> | 2011-10-21 18:28:30 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-10-21 18:34:13 -0700 |
commit | fb1f0942dc96d0bb2ef1b8a44458f377834b35e5 (patch) | |
tree | e5b91b16678bad0d68c65bbd00d13ce04bc24ffb /files | |
parent | 3bd440e8ffa0affa9747516f1a16d2b8bae65d34 (diff) | |
download | sdk-fb1f0942dc96d0bb2ef1b8a44458f377834b35e5.zip sdk-fb1f0942dc96d0bb2ef1b8a44458f377834b35e5.tar.gz sdk-fb1f0942dc96d0bb2ef1b8a44458f377834b35e5.tar.bz2 |
Fix ant test, ant installt and ant uninstall (for test projects)
Bug http://code.google.com/p/android/issues/detail?id=20979
Change-Id: Id861d493c9b73dcfc9e81bdc8fb6c8b7c8ed0e55
Diffstat (limited to 'files')
-rw-r--r-- | files/ant/build.xml | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml index ed56f81..016e8dc 100644 --- a/files/ant/build.xml +++ b/files/ant/build.xml @@ -325,7 +325,7 @@ <arg value="coverage" /> <arg value="@{emma.enabled}" /> <extra-instrument-args /> - <arg value="${tested.manifest.package}/${test.runner}" /> + <arg value="${manifest.package}/${test.runner}" /> </exec> </sequential> </macrodef> @@ -1079,18 +1079,6 @@ </if> </target> - <!-- Installs the tested project. This make sure to install the proper package based on - the value of emma.enabled --> - <target name="-install-tested-project" depends="-test-project-check, -setup"> - <!-- figure out which tested package to install based on emma.enabled --> - <condition property="tested.project.install.target" value="installi" else="installd"> - <isset property="emma.enabled" /> - </condition> - <subant target="${tested.project.install.target}" failonerror="true"> - <fileset dir="${tested.project.absolute.dir}" includes="build.xml" /> - </subant> - </target> - <target name="test" depends="-test-project-check" description="Runs tests from the package defined in test.package property"> @@ -1101,6 +1089,8 @@ <!-- Application package of the tested project extracted from its manifest file --> <xpath input="${tested.project.absolute.dir}/AndroidManifest.xml" expression="/manifest/@package" output="tested.manifest.package" /> + <xpath input="AndroidManifest.xml" + expression="/manifest/@package" output="manifest.package" /> <property name="emma.dump.file" value="/data/data/${tested.manifest.package}/coverage.ec" /> @@ -1176,9 +1166,28 @@ <arg value="-r" /> <arg path="${out.final.file}" /> </exec> + + <!-- now install the tested project if applicable --> + <!-- can't use project.is.test since the setup target might not have run --> + <if> + <condition> + <isset property="tested.project.dir" /> + </condition> + <then> + <property name="tested.project.absolute.dir" location="${tested.project.dir}" /> + + <!-- figure out which tested package to install based on emma.enabled --> + <condition property="tested.project.install.target" value="installi" else="installd"> + <isset property="emma.enabled" /> + </condition> + <subant target="${tested.project.install.target}" failonerror="true"> + <fileset dir="${tested.project.absolute.dir}" includes="build.xml" /> + </subant> + </then> + </if> </then> <else> - <fail message="File {out.final.file} does not exist." /> + <fail message="File ${out.final.file} does not exist." /> </else> </if> </then> @@ -1211,7 +1220,7 @@ description="Installs (only) the release package." /> <target name="installi" depends="-set-instrumented-mode, install" description="Installs (only) the instrumented package." /> - <target name="installt" depends="-install-tested-project, installd" + <target name="installt" depends="-test-project-check, installd" description="Installs (only) the test and tested packages." /> @@ -1234,7 +1243,12 @@ </else> </if> - <if condition="${project.is.test}"> + <!-- Now uninstall the tested project, if applicable --> + <!-- can't use project.is.test since the setup target might not have run --> + <if> + <condition> + <isset property="tested.project.dir" /> + </condition> <then> <property name="tested.project.absolute.dir" location="${tested.project.dir}" /> |