aboutsummaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-04-13 12:19:36 -0700
committerXavier Ducrohet <xav@android.com>2012-04-16 12:55:07 -0700
commit47f429464374712e770b8e9b703790faa75dff19 (patch)
treedb4b3f5e929076c17e2f712337a59b79751dc995 /files
parent1daa8f999d87443d14f698ca8ccc103e3309fa3e (diff)
downloadsdk-47f429464374712e770b8e9b703790faa75dff19.zip
sdk-47f429464374712e770b8e9b703790faa75dff19.tar.gz
sdk-47f429464374712e770b8e9b703790faa75dff19.tar.bz2
Properly exclude some classes in code coverage.
Using a custom task to create the filter based on the app packages for the main project and its library projects and the list of class to exclude. Change-Id: Id37862bf53656bd17991b5c307d772ed2019650b
Diffstat (limited to 'files')
-rw-r--r--files/ant/build.xml13
1 files changed, 12 insertions, 1 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml
index 856a501..db47263 100644
--- a/files/ant/build.xml
+++ b/files/ant/build.xml
@@ -96,6 +96,10 @@
classname="com.android.ant.ComputeProjectClasspathTask"
classpathref="android.antlibs" />
+ <taskdef name="getemmafilter"
+ classname="com.android.ant.GetEmmaFilterTask"
+ classpathref="android.antlibs" />
+
<taskdef name="aapt"
classname="com.android.ant.AaptExecTask"
classpathref="android.antlibs" />
@@ -730,13 +734,20 @@
<if condition="${build.is.instrumented}">
<then>
<echo level="info">Instrumenting classes from ${out.absolute.dir}/classes...</echo>
+
+ <!-- build the filter to remove R, Manifest, BuildConfig -->
+ <getemmafilter
+ appPackage="${project.app.package}"
+ libraryPackagesRefId="project.library.packages"
+ filterOut="emma.default.filter"/>
+
<!-- It only instruments class files, not any external libs -->
<emma enabled="true">
<instr verbosity="${verbosity}"
mode="overwrite"
instrpath="${out.absolute.dir}/classes"
outdir="${out.absolute.dir}/classes">
- <filter excludes="${project.app.package}.R,${project.app.package}.R$$*,${project.app.package}.BuildConfig" />
+ <filter excludes="${emma.default.filter}" />
<filter value="${emma.filter}" />
</instr>
</emma>