Add legacy support for application.package property

application.package in android_rules.xml and android_test_rules.xml has been
replaced by manifest.package which value is taken from AndroidManifest.xml.
This is because old versions of build.properties contain already
application.package property which has precedence over the extracted one
and overrides it.

Change-Id: I909e145926169922ec6ec0e179ad88c413aa85b2
This commit is contained in:
Piotr Gurgul
2009-09-22 17:28:26 -07:00
parent dd9683a824
commit fa0062da90
2 changed files with 8 additions and 8 deletions

View File

@@ -31,7 +31,7 @@
<property name="android.tools.dir" location="${sdk.dir}/tools" />
<!-- Name of the application package extracted from manifest file -->
<xpath input="AndroidManifest.xml" expression="/manifest/@package"
output="application.package" />
output="manifest.package" />
<!-- Input directories -->
<property name="source.dir" value="src" />
@@ -336,22 +336,22 @@
<target name="-uninstall-check">
<condition property="uninstall.run">
<isset property="application.package" />
<isset property="manifest.package" />
</condition>
</target>
<target name="-uninstall-error" depends="-uninstall-check" unless="uninstall.run">
<echo>Unable to run 'ant uninstall', application.package is not defined in build.properties
<echo>Unable to run 'ant uninstall', manifest.package property is not defined.
</echo>
</target>
<!-- Uninstalls the package from the default emulator/device -->
<target name="uninstall" depends="-uninstall-error" if="uninstall.run"
description="Uninstalls the application from a running emulator or device.">
<echo>Uninstalling ${application.package} from the default emulator or device...</echo>
<echo>Uninstalling ${manifest.package} from the default emulator or device...</echo>
<exec executable="${adb}" failonerror="true">
<arg value="uninstall" />
<arg value="${application.package}" />
<arg value="${manifest.package}" />
</exec>
</target>

View File

@@ -10,12 +10,12 @@
<property name="test.runner" value="android.test.InstrumentationTestRunner" />
<!-- Application package of the tested project extracted from its manifest file -->
<xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
expression="/manifest/@package" output="tested.application.package" />
expression="/manifest/@package" output="tested.manifest.package" />
<!-- TODO: make it more configurable in the next CL's - now it is default for auto-generated
project -->
<property name="emma.dump.file"
value="/data/data/${tested.application.package}/files/coverage.ec" />
value="/data/data/${tested.manifest.package}/files/coverage.ec" />
<macrodef name="run-tests-helper">
<attribute name="emma.enabled" default="false" />
@@ -31,7 +31,7 @@
<arg value="coverage" />
<arg value="@{emma.enabled}" />
<extra-instrument-args />
<arg value="${application.package}/${test.runner}" />
<arg value="${manifest.package}/${test.runner}" />
</exec>
</sequential>
</macrodef>