aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Gaston <jeffrygaston@google.com>2017-06-16 22:32:29 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-06-16 22:32:29 +0000
commitaebe230344f200d631f6086bf695a295ba16a56c (patch)
tree82e751f2ae58a12d3be5306d372f060736e68dce
parent94c4847d70f5523334db786a4bb838009cf3392d (diff)
parent284e516a0573c90cf560bcf97f97c9ed1a4edd62 (diff)
downloadjacoco-aebe230344f200d631f6086bf695a295ba16a56c.tar.gz
Some build updates for latest jacoco am: 4ed39e392f am: ff54e096d9 am: ea41174f5b
am: 284e516a05 Change-Id: I87667990d0f870eba98568211297c6273655fa77
-rw-r--r--Android.mk58
-rw-r--r--README.android1
-rw-r--r--org.jacoco.cli/src/MANIFEST.MF2
-rw-r--r--org.jacoco.core/src/org/jacoco/core/jacoco.properties9
4 files changed, 55 insertions, 15 deletions
diff --git a/Android.mk b/Android.mk
index b55fb273..1804e6df 100644
--- a/Android.mk
+++ b/Android.mk
@@ -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
+