diff options
| author | Xavier Ducrohet <xav@android.com> | 2012-10-23 16:34:02 -0700 |
|---|---|---|
| committer | Xavier Ducrohet <xav@android.com> | 2012-10-23 16:36:27 -0700 |
| commit | 7d87c565a7a9e3fe9b11eead657638c0fc7eae4f (patch) | |
| tree | c12b8baf762aef15d4d36f59f30575404b8c1e3b | |
| parent | d18850305de069a4e81302d1123db2b79f5ac4d2 (diff) | |
| download | sdk-7d87c565a7a9e3fe9b11eead657638c0fc7eae4f.tar.gz sdk-7d87c565a7a9e3fe9b11eead657638c0fc7eae4f.tar.bz2 sdk-7d87c565a7a9e3fe9b11eead657638c0fc7eae4f.zip | |
Set the permission of the emma file before downloading it.
Also fix the build file of the a couple of test projects.
Change-Id: I5e75f9c4ac397350d7b54e660782d38a2e3de5ad
| -rw-r--r-- | files/ant/build.xml | 14 | ||||
| -rw-r--r-- | testapps/buildConfigTest/app/build.xml | 11 | ||||
| -rw-r--r-- | testapps/buildConfigTest/lib1/build.xml | 11 |
3 files changed, 32 insertions, 4 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml index 699fb58ba..9ada8f24f 100644 --- a/files/ant/build.xml +++ b/files/ant/build.xml @@ -1256,7 +1256,7 @@ <if condition="${emma.enabled}"> <then> - <echo>WARNING: Code Coverage is currently only supported on the emulator and rooted devices.</echo> + <echo>Running tests...</echo> <run-tests-helper emma.enabled="true"> <extra-instrument-args> <arg value="-e" /> @@ -1264,6 +1264,17 @@ <arg value="${emma.dump.file}" /> </extra-instrument-args> </run-tests-helper> + + <echo level="info">Settting permission to download the coverage file...</echo> + <exec executable="${adb}" failonerror="true"> + <arg line="${adb.device.arg}" /> + <arg value="shell" /> + <arg value="run-as" /> + <arg value="${tested.project.app.package}" /> + <arg value="chmod" /> + <arg value="644" /> + <arg value="${emma.dump.file}" /> + </exec> <echo level="info">Downloading coverage file into project directory...</echo> <exec executable="${adb}" failonerror="true"> <arg line="${adb.device.arg}" /> @@ -1280,7 +1291,6 @@ </firstmatchmapper> </pathconvert> - <emma> <report sourcepath="${tested.project.source.absolute.dir}:${tested.project.lib.source.path.value}" verbosity="${verbosity}"> diff --git a/testapps/buildConfigTest/app/build.xml b/testapps/buildConfigTest/app/build.xml index 09cd9079b..93dfe0f6a 100644 --- a/testapps/buildConfigTest/app/build.xml +++ b/testapps/buildConfigTest/app/build.xml @@ -28,6 +28,15 @@ --> <property file="ant.properties" /> + <!-- if sdk.dir was not set from one of the property file, then + get it from the ANDROID_HOME env var. + This must be done before we load project.properties since + the proguard config can use sdk.dir --> + <property environment="env" /> + <condition property="sdk.dir" value="${env.ANDROID_HOME}"> + <isset property="env.ANDROID_HOME" /> + </condition> + <!-- The project.properties file is created and updated by the 'android' tool, as well as ADT. @@ -41,7 +50,7 @@ <!-- quick check on sdk.dir --> <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" + message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." unless="sdk.dir" /> diff --git a/testapps/buildConfigTest/lib1/build.xml b/testapps/buildConfigTest/lib1/build.xml index 2a15ae634..a111b4d78 100644 --- a/testapps/buildConfigTest/lib1/build.xml +++ b/testapps/buildConfigTest/lib1/build.xml @@ -28,6 +28,15 @@ --> <property file="ant.properties" /> + <!-- if sdk.dir was not set from one of the property file, then + get it from the ANDROID_HOME env var. + This must be done before we load project.properties since + the proguard config can use sdk.dir --> + <property environment="env" /> + <condition property="sdk.dir" value="${env.ANDROID_HOME}"> + <isset property="env.ANDROID_HOME" /> + </condition> + <!-- The project.properties file is created and updated by the 'android' tool, as well as ADT. @@ -41,7 +50,7 @@ <!-- quick check on sdk.dir --> <fail - message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var" + message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." unless="sdk.dir" /> |
