aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--files/ant/build.xml14
-rw-r--r--testapps/buildConfigTest/app/build.xml11
-rw-r--r--testapps/buildConfigTest/lib1/build.xml11
3 files changed, 32 insertions, 4 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml
index 699fb58..9ada8f2 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 09cd907..93dfe0f 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 2a15ae6..a111b4d 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"
/>