Add rule to enable running Jetifier within Make against Java modules
The only case where we expect to actually enable this behavior is for
modules that are just an unpacking of a prebuilt, because those are
the only cases for which we can't conveniently just change the source
Bug: 72552006
Test: ./build/soong/scripts/diff_build_graphs.sh \
--products=aosp_arm 'build/make:work^' \
'build/make:work'
Test: cherry-pick the following patch that depends on this one and
the rest of that patch's topic, and then do `m -j jeffapp`
Change-Id: I62e231900d6d87673ddf19c7fc2686fef2828590
diff --git a/core/java.mk b/core/java.mk
index 2f0e3c3..67ed9d1 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -557,11 +557,17 @@
full_classes_jarjar_jar := $(full_classes_processed_jar)
endif
-$(eval $(call copy-one-file,$(full_classes_jarjar_jar),$(full_classes_jar)))
+#######################################
+LOCAL_JETIFIER_INPUT_FILE := $(full_classes_jarjar_jar)
-LOCAL_FULL_CLASSES_PRE_JACOCO_JAR := $(full_classes_jar)
+include $(BUILD_SYSTEM)/jetifier.mk
+#######################################
+
+$(eval $(call copy-one-file,$(LOCAL_JETIFIER_OUTPUT_FILE),$(full_classes_jar)))
#######################################
+LOCAL_FULL_CLASSES_PRE_JACOCO_JAR := $(full_classes_jar)
+
include $(BUILD_SYSTEM)/jacoco.mk
#######################################