Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Unified Diff: build/android/ant/apk-instr.xml

Issue 20210002: [Android] Sets up a coverage system for java using EMMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Gets code coverage for non-apk java working Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/ant/apk-package.xml » ('j') | build/android/ant/apk-package.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | build/android/ant/apk-package.xml » ('j') | build/android/ant/apk-package.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698