diff options
author | Jeff Gaston <jeffrygaston@google.com> | 2017-05-19 12:15:33 -0700 |
---|---|---|
committer | Jeff Gaston <jeffrygaston@google.com> | 2017-06-15 15:25:05 -0700 |
commit | 4ed39e392f8764a5b10387596d97a6ca74f01807 (patch) | |
tree | 82e751f2ae58a12d3be5306d372f060736e68dce | |
parent | 369c1a464f4b750a0df7a750d5ab6bcc90202697 (diff) | |
download | jacoco-4ed39e392f8764a5b10387596d97a6ca74f01807.tar.gz |
Some build updates for latest jacoco
Bug: 36792868
Test: m -j
Change-Id: I817d12994bc795be3faa33ad7e63675e3072a88e
-rw-r--r-- | Android.mk | 58 | ||||
-rw-r--r-- | README.android | 1 | ||||
-rw-r--r-- | org.jacoco.cli/src/MANIFEST.MF | 2 | ||||
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/jacoco.properties | 9 |
4 files changed, 55 insertions, 15 deletions
@@ -15,16 +15,6 @@ # LOCAL_PATH := $(call my-dir) -# Build jacoco from sources for the platform -# -# Note: this is only intended to be used for the platform development. This is *not* intended -# to be used in the SDK where apps can use the official jacoco release. -include $(CLEAR_VARS) - -jacoco_src_files := $(call all-java-files-under,org.jacoco.core/src) -jacoco_src_files += $(call all-java-files-under,org.jacoco.agent/src) -jacoco_src_files += $(call all-java-files-under,org.jacoco.agent.rt/src) - # 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 @@ -36,7 +26,18 @@ jacoco_android_exclude_list := \ %org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/CoverageTransformer.java \ %org.jacoco.agent.rt/src/org/jacoco/agent/rt/internal/JmxRegistration.java -LOCAL_SRC_FILES := $(filter-out $(jacoco_android_exclude_list),$(jacoco_src_files)) + +# Build jacoco-agent from sources for the platform +# +# Note: this is only intended to be used for the platform development. This is *not* intended +# to be used in the SDK where apps can use the official jacoco release. +include $(CLEAR_VARS) + +jacocoagent_src_files := $(call all-java-files-under,org.jacoco.core/src) +jacocoagent_src_files += $(call all-java-files-under,org.jacoco.agent/src) +jacocoagent_src_files += $(call all-java-files-under,org.jacoco.agent.rt/src) + +LOCAL_SRC_FILES := $(filter-out $(jacoco_android_exclude_list),$(jacocoagent_src_files)) # 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 @@ -48,8 +49,28 @@ LOCAL_MODULE_TAGS := optional LOCAL_STATIC_JAVA_LIBRARIES := jacoco-asm include $(BUILD_STATIC_JAVA_LIBRARY) + +# Build jacoco-cli from sources for the platform +include $(CLEAR_VARS) + +# TODO(jeffrygaston) it'd be nice to keep the build process and/or list of source files in sync with +# what is defined in the pom.xml files, although it's probably much more trouble than it's worth +jacococli_src_files += $(call all-java-files-under,org.jacoco.core/src) +jacococli_src_files += $(call all-java-files-under,org.jacoco.report/src) +jacococli_src_files += $(call all-java-files-under,org.jacoco.cli/src) +LOCAL_JAVA_RESOURCE_DIRS := org.jacoco.core/src org.jacoco.report/src +LOCAL_JAR_MANIFEST := org.jacoco.cli/src/MANIFEST.MF + +LOCAL_SRC_FILES := $(jacococli_src_files) + +LOCAL_MODULE := jacoco-cli +LOCAL_STATIC_JAVA_LIBRARIES := jacoco-asm-host args4j-2.0.28 + +include $(BUILD_HOST_JAVA_LIBRARY) + + # -# Build asm-5.0.1 as a static library. +# Build asm-5.0.1 as a static library for the device # include $(CLEAR_VARS) @@ -62,3 +83,16 @@ LOCAL_JACK_FLAGS := -D jack.import.jar.debug-info=false LOCAL_UNINSTALLABLE_MODULE := true include $(BUILD_PREBUILT) + + +# +# Build asm-5.0.1 as a static library for the host +# +include $(CLEAR_VARS) + +LOCAL_MODULE := jacoco-asm-host +LOCAL_IS_HOST_MODULE := true +LOCAL_MODULE_CLASS := JAVA_LIBRARIES +LOCAL_SRC_FILES := asm-debug-all-5.0.1$(COMMON_JAVA_PACKAGE_SUFFIX) + +include $(BUILD_PREBUILT) diff --git a/README.android b/README.android index 1e6118ab..21adf4d9 100644 --- a/README.android +++ b/README.android @@ -15,3 +15,4 @@ is the list of the changes: 1) Remove the creation of JmxRegistration in org.jacoco.agent.rt.internal.Agent. 2) Change default OutputMode to none in org.jacoco.core.runtime.AgentOptions 3) Merge https://github.com/jacoco/jacoco/pull/525 +4) Update the build process to match #3: evaluate jacoco.properties, and add MANIFEST.MF diff --git a/org.jacoco.cli/src/MANIFEST.MF b/org.jacoco.cli/src/MANIFEST.MF new file mode 100644 index 00000000..bae94d55 --- /dev/null +++ b/org.jacoco.cli/src/MANIFEST.MF @@ -0,0 +1,2 @@ +Main-Class: org.jacoco.cli.internal.Main
+
diff --git a/org.jacoco.core/src/org/jacoco/core/jacoco.properties b/org.jacoco.core/src/org/jacoco/core/jacoco.properties index 09493370..e2f9aca6 100644 --- a/org.jacoco.core/src/org/jacoco/core/jacoco.properties +++ b/org.jacoco.core/src/org/jacoco/core/jacoco.properties @@ -1,3 +1,6 @@ -VERSION=$qualified.bundle.version$ -HOMEURL=$jacoco.home.url$ -RUNTIMEPACKAGE=$jacoco.runtime.package.name$
\ No newline at end of file +#This file is supposed to be processed by Maven, but Android doesn't run Maven +#So in Android we've filled in the resulting values below +VERSION=0.7.10.201704181138.android +HOMEURL=http://www.jacoco.org/jacoco +RUNTIMEPACKAGE=org.jacoco.agent.rt.internal + |