Index: build/android/ant/apk-instr.xml |
diff --git a/build/android/ant/apk-instr.xml b/build/android/ant/apk-instr.xml |
new file mode 100644 |
index 0000000000000000000000000000000000000000..38dd8b2233ee4020a26a41c67cf9105eaa3b2528 |
--- /dev/null |
+++ b/build/android/ant/apk-instr.xml |
@@ -0,0 +1,67 @@ |
+<?xml version="1.0" encoding="UTF-8"?> |
+<!-- |
+ Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+ Use of this source code is governed by a BSD-style license that can be |
+ found in the LICENSE file. |
+--> |
+ |
+<project default="instr-jar"> |
+ <!-- options for instr-jar --> |
+ <property name="input.jar.file" location="${INPUT_JAR_FILE}" /> |
+ <property name="output.jar.dir" location="${OUTPUT_JAR_DIR}" /> |
+ <property name="output.jar.final.dir" location="${OUTPUT_JAR_FINAL_DIR}" /> |
+ <!-- options for instr-classes --> |
+ <property name="classes.dir" location="${CLASSES_DIR}" /> |
+ <property name="classes.final.dir" location="${CLASSES_FINAL_DIR}" /> |
+ |
+ <property name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> |
+ |
+ <property name="emma.coverage.absolute.file" location="${EMMA_COVERAGE_FILE}" /> |
+ <property name="emma.sources.file" location="${EMMA_SOURCES_FILE}" /> |
+ <property name="java.src.dir" location="${JAVA_SRC}" /> |
+ <property name="additional.src.dir" value="${ADDITIONAL_SRC}" /> |
+ <property name="generated.src.dir" value="${GENERATED_SRC}" /> |
+ <filelist dir="${basedir}" id="emma.sources.filelist" |
+ files="${JAVA_SRC} ${ADDITIONAL_SRC} ${GENERATED_SRC}"/> |
+ <pathconvert pathsep=" " property="emma.sources" refid="emma.sources.filelist" /> |
+ |
+ <!-- jar file from where emma tasks are loaded --> |
+ <path id="emma.antlibs"> |
+ <pathelement path="${sdk.dir}/tools/lib/emma_ant.jar" /> |
+ <pathelement path="${sdk.dir}/tools/lib/emma.jar" /> |
+ </path> |
+ |
+ <taskdef resource="emma_ant.properties" classpathref="emma.antlibs" /> |
+ |
+ <!-- Instruments the output jar for coverage testing. |
+ Also writes the accompanying source dirs into emma.sources.file --> |
+ <target name="instr-jar"> |
+ <emma enabled="true"> |
+ <instr mode="fullcopy" |
+ instrpath="${input.jar.file}" |
+ outdir="${output.jar.dir}" |
+ metadatafile="${emma.coverage.absolute.file}"> |
+ <!-- TODO(gkanwar): Filter things here --> |
+ </instr> |
+ </emma> |
+ <!-- This is needed because instr fullcopy creates a 'lib' folder under the |
+ destination, and we need to move the jar out of that --> |
+ <copy todir="${output.jar.final.dir}"> |
+ <fileset dir="${output.jar.dir}/lib" /> |
+ </copy> |
+ <echo file="${emma.sources.file}">${emma.sources}</echo> |
+ </target> |
+ <!-- Instruments the output classes for coverage testing. |
+ Also writes the accompanying source dirs into emma.sources.file --> |
+ <target name="instr-classes"> |
+ <emma enabled="true"> |
+ <instr mode="copy" |
+ instrpath="${classes.dir}" |
+ outdir="${classes.final.dir}" |
+ metadatafile="${emma.coverage.absolute.file}"> |
+ <!-- TODO: Filter things here --> |
+ </instr> |
+ </emma> |
+ <echo file="${emma.sources.file}">${emma.sources}</echo> |
+ </target> |
+</project> |