From b760c4765ce42102cda379f1cbcb164c9fa80b41 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 22 Nov 2017 13:57:52 -0800 Subject: Update build files for new version of jacoco Also remove asm-debug-all-5.0.1.jar in favor of the asm 6.0 prebuilts in prebuilts/misc/common/asm. Bug: 69669951 Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false tests Change-Id: Idfda865afa9d3f40a388431aebee08455e4c8db8 --- Android.bp | 49 ++++++++++++++++++++++-------------------------- PREBUILT | 7 ------- asm-debug-all-5.0.1.jar | Bin 380292 -> 0 bytes 3 files changed, 22 insertions(+), 34 deletions(-) delete mode 100644 PREBUILT delete mode 100644 asm-debug-all-5.0.1.jar diff --git a/Android.bp b/Android.bp index 3e570205..a4c103ca 100644 --- a/Android.bp +++ b/Android.bp @@ -14,18 +14,6 @@ // limitations under the License. // -// Some Jacoco source files depend on classes that do not exist in Android. While these classes are -// not executed at runtime (because we use offline instrumentation), they will cause issues when -// compiling them with ART during dex pre-opting. Therefore, it would prevent from applying code -// coverage on classes in the bootclasspath (frameworks, services, ...) or system apps. -// Note: we still may need to update the source code to cut dependencies in mandatory jacoco classes. -jacoco_android_exclude_list = [ - "%org.jacoco.core/src/org/jacoco/core/runtime/ModifiedSystemClassRuntime.java", - "%org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/PreMain.java", - "%org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/CoverageTransformer.java", - "%org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/JmxRegistration.java", -] - // Build jacoco-agent from sources for the platform // // Note: this is only intended to be used for the platform development. This is *not* intended @@ -39,6 +27,14 @@ java_library { "org.jacoco.agent.rt/src/**/*.java", ], + // Some Jacoco source files depend on classes that do not exist in Android. + // While these classes are not executed at runtime (because we use offline + // instrumentation), they will cause issues when compiling them with ART + // during dex pre-opting. Therefore, it would prevent from applying code + // coverage on classes in the bootclasspath (frameworks, services, ...) or + // system apps. + // Note: we still may need to update the source code to cut dependencies in + // mandatory jacoco classes. exclude_srcs: [ "org.jacoco.core/src/org/jacoco/core/runtime/ModifiedSystemClassRuntime.java", "org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/PreMain.java", @@ -46,12 +42,19 @@ java_library { "org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/JmxRegistration.java", ], - // In order to include Jacoco in core libraries, we cannot depend on anything in the - // bootclasspath (or we would create dependency cycle). Therefore we compile against - // the SDK android.jar which gives the same APIs Jacoco depends on. + // In order to include Jacoco in core libraries, we cannot depend on + // anything in the bootclasspath (or we would create dependency cycle). + // Therefore we compile against the SDK android.jar which gives the same + // APIs Jacoco depends on. sdk_version: "9", - static_libs: ["jacoco-asm"], + // TODO(b/69671801): there's no bytecode on the device, so these shouldn't + // be necessary. + static_libs: [ + "asm-6.0", + "asm-commons-6.0", + "asm-tree-6.0", + ], } // Build jacoco-cli from sources for the platform @@ -75,17 +78,9 @@ java_library_host { ], static_libs: [ - "jacoco-asm", + "asm-6.0", + "asm-commons-6.0", + "asm-tree-6.0", "args4j-2.0.28", ], } - -// -// Build asm-5.0.1 as a static library -// -java_import { - name: "jacoco-asm", - host_supported: true, - - jars: ["asm-debug-all-5.0.1.jar"], -} diff --git a/PREBUILT b/PREBUILT deleted file mode 100644 index c8d9fd8c..00000000 --- a/PREBUILT +++ /dev/null @@ -1,7 +0,0 @@ -The ASM jar required by jacoco is updated in the following way: - -mvn -f org.jacoco.agent.rt/pom.xml dependency:copy-dependencies -cp org.jacoco.agent.rt/target/dependency/asm-debug-all-5.0.1.jar ./ -mvn clean - -The Android.mk must be updated to reference the right prebuilt. diff --git a/asm-debug-all-5.0.1.jar b/asm-debug-all-5.0.1.jar deleted file mode 100644 index 76d4b6a7..00000000 Binary files a/asm-debug-all-5.0.1.jar and /dev/null differ -- cgit v1.2.3