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:
@@ -31,7 +31,7 @@
|
|||||||
<property name="android.tools.dir" location="${sdk.dir}/tools" />
|
<property name="android.tools.dir" location="${sdk.dir}/tools" />
|
||||||
<!-- Name of the application package extracted from manifest file -->
|
<!-- Name of the application package extracted from manifest file -->
|
||||||
<xpath input="AndroidManifest.xml" expression="/manifest/@package"
|
<xpath input="AndroidManifest.xml" expression="/manifest/@package"
|
||||||
output="application.package" />
|
output="manifest.package" />
|
||||||
|
|
||||||
<!-- Input directories -->
|
<!-- Input directories -->
|
||||||
<property name="source.dir" value="src" />
|
<property name="source.dir" value="src" />
|
||||||
@@ -336,22 +336,22 @@
|
|||||||
|
|
||||||
<target name="-uninstall-check">
|
<target name="-uninstall-check">
|
||||||
<condition property="uninstall.run">
|
<condition property="uninstall.run">
|
||||||
<isset property="application.package" />
|
<isset property="manifest.package" />
|
||||||
</condition>
|
</condition>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="-uninstall-error" depends="-uninstall-check" unless="uninstall.run">
|
<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>
|
</echo>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Uninstalls the package from the default emulator/device -->
|
<!-- Uninstalls the package from the default emulator/device -->
|
||||||
<target name="uninstall" depends="-uninstall-error" if="uninstall.run"
|
<target name="uninstall" depends="-uninstall-error" if="uninstall.run"
|
||||||
description="Uninstalls the application from a running emulator or device.">
|
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">
|
<exec executable="${adb}" failonerror="true">
|
||||||
<arg value="uninstall" />
|
<arg value="uninstall" />
|
||||||
<arg value="${application.package}" />
|
<arg value="${manifest.package}" />
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,12 @@
|
|||||||
<property name="test.runner" value="android.test.InstrumentationTestRunner" />
|
<property name="test.runner" value="android.test.InstrumentationTestRunner" />
|
||||||
<!-- Application package of the tested project extracted from its manifest file -->
|
<!-- Application package of the tested project extracted from its manifest file -->
|
||||||
<xpath input="${tested.project.absolute.dir}/AndroidManifest.xml"
|
<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
|
<!-- TODO: make it more configurable in the next CL's - now it is default for auto-generated
|
||||||
project -->
|
project -->
|
||||||
<property name="emma.dump.file"
|
<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">
|
<macrodef name="run-tests-helper">
|
||||||
<attribute name="emma.enabled" default="false" />
|
<attribute name="emma.enabled" default="false" />
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<arg value="coverage" />
|
<arg value="coverage" />
|
||||||
<arg value="@{emma.enabled}" />
|
<arg value="@{emma.enabled}" />
|
||||||
<extra-instrument-args />
|
<extra-instrument-args />
|
||||||
<arg value="${application.package}/${test.runner}" />
|
<arg value="${manifest.package}/${test.runner}" />
|
||||||
</exec>
|
</exec>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|||||||
Reference in New Issue
Block a user