Add phony target javac-check.
javac-check covers all classes.jars that are compiled with javac
instead of jack. This target is required by tools that still need java
class files as input.
Bug: 26705771
Change-Id: I6896b9a6026a2a0dae6145d1ef5a839756aa3458
diff --git a/core/host_dalvik_java_library.mk b/core/host_dalvik_java_library.mk
index 89139a8..8140af6 100644
--- a/core/host_dalvik_java_library.mk
+++ b/core/host_dalvik_java_library.mk
@@ -85,6 +85,8 @@
$(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-host-java-to-package)
+javac-check : $(full_classes_compiled_jar)
+
# Run jarjar if necessary, otherwise just copy the file.
ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
diff --git a/core/host_java_library.mk b/core/host_java_library.mk
index 9a13439..b5c5e9e 100644
--- a/core/host_java_library.mk
+++ b/core/host_java_library.mk
@@ -69,6 +69,8 @@
$(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-host-java-to-package)
+javac-check : $(full_classes_compiled_jar)
+
# Run jarjar if necessary, otherwise just copy the file.
ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
@@ -105,4 +107,3 @@
@echo Copying: $@
$(hide) $(ACP) -fp $< $@
endif # LOCAL_EMMA_INSTRUMENT
-
diff --git a/core/java.mk b/core/java.mk
index 5ac9342..811f7ca 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -433,6 +433,8 @@
$(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-java-to-classes.jar)
+javac-check : $(full_classes_compiled_jar)
+
# Run jarjar if necessary, otherwise just copy the file.
ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
diff --git a/core/main.mk b/core/main.mk
index 328da45..e607d14 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -1041,6 +1041,9 @@
target-native-tests : native-target-tests
tests : host-tests target-tests
+# Phony target to run all java compilations that use javac instead of jack.
+.PHONY: javac-check
+
# To catch more build breakage, check build tests modules in eng and userdebug builds.
ifneq ($(ANDROID_NO_TEST_CHECK),true)
ifneq ($(TARGET_BUILD_PDK),true)