Merge changes I8f95f3f8,Ic2e384ad into nyc-dev
* changes:
Add generation of a module-info.json file
Remove unused module-info.txt generation.
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 032dfbb..551f18e 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -241,21 +241,34 @@
else
ifdef LOCAL_SDK_VERSION
ifdef TARGET_BUILD_APPS
-# In unbundled build merge the emma library into the apk.
+# In unbundled build, merge the coverage library into the apk.
ifdef LOCAL_JACK_ENABLED
# Jack supports coverage with Jacoco
ifneq ($(LOCAL_SRC_FILES)$(LOCAL_STATIC_JAVA_LIBRARIES)$(LOCAL_SOURCE_FILES_ALL_GENERATED),)
# Only add jacocoagent if the package contains some java code
LOCAL_STATIC_JAVA_LIBRARIES += jacocoagent
+# Exclude jacoco classes from proguard
+LOCAL_PROGUARD_FLAGS += -include $(BUILD_SYSTEM)/proguard.jacoco.flags
+LOCAL_JACK_PROGUARD_FLAGS += -include $(BUILD_SYSTEM)/proguard.jacoco.flags
endif # Contains java code
else
LOCAL_STATIC_JAVA_LIBRARIES += emma
endif # LOCAL_JACK_ENABLED
else
-# If build against the SDK in full build, core.jar is not used,
-# we have to use prebiult emma.jar to make Proguard happy;
+# If build against the SDK in full build, core.jar is not used
+# so coverage classes are not present.
+ifdef LOCAL_JACK_ENABLED
+# Jack needs jacoco on the classpath but we do not want it to be in
+# the final apk. While it is a static library, we add it to the
+# LOCAL_JAVA_LIBRARIES which are only present on the classpath.
+# Note: we have nothing to do for proguard since jacoco will be
+# on the classpath only, thus not modified during the compilation.
+LOCAL_JAVA_LIBRARIES += jacocoagent
+else
+# We have to use prebuilt emma.jar to make Proguard happy;
# Otherwise emma classes are included in core.jar.
LOCAL_PROGUARD_FLAGS += -libraryjars $(EMMA_JAR)
+endif # LOCAL_JACK_ENABLED
endif # full build
endif # LOCAL_SDK_VERSION
endif # EMMA_INSTRUMENT_STATIC