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/host_java_library.mk b/core/host_java_library.mk
index f34f2f1..a6337eb 100644
--- a/core/host_java_library.mk
+++ b/core/host_java_library.mk
@@ -102,10 +102,16 @@
 	$(MERGE_ZIPS) -j $(if $(PRIVATE_JAR_MANIFEST),-m $(dir $@)/manifest.mf) \
             -stripDir META-INF -zipToNotStrip $< $@ $< $(call reverse-list,$(PRIVATE_STATIC_JAVA_LIBRARIES))
 
+#######################################
+LOCAL_JETIFIER_INPUT_FILE := $(full_classes_combined_jar)
+
+include $(BUILD_SYSTEM)/jetifier.mk
+#######################################
+
 # Run jarjar if necessary, otherwise just copy the file.
 ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
 $(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
-$(full_classes_jarjar_jar): $(full_classes_combined_jar) $(LOCAL_JARJAR_RULES) | $(JARJAR)
+$(full_classes_jarjar_jar): $(LOCAL_JETIFIER_OUTPUT_FILE) $(LOCAL_JARJAR_RULES) | $(JARJAR)
 	@echo JarJar: $@
 	$(hide) $(JAVA) -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
 else
@@ -113,9 +119,9 @@
 endif
 
 
+#######################################
 LOCAL_FULL_CLASSES_PRE_JACOCO_JAR := $(full_classes_jarjar_jar)
 
-#######################################
 include $(BUILD_SYSTEM)/jacoco.mk
 #######################################