Move hiddenapi singleton rules to Soong
Hiddenapi rules are now in build/soong/java/hiddenapi_singleton.go.
This effectively requires any module in PRODUCT_BOOT_JARS to be
defined in Soong.
Bug: 123645297
Test: m checkbuild
Change-Id: If72bd1c20b2014d0a3d400624d37fdb0a3052245
diff --git a/core/java.mk b/core/java.mk
index e564db2..e644af7 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -71,11 +71,8 @@
full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar
full_classes_combined_jar := $(intermediates.COMMON)/classes-combined.jar
built_dex_intermediate := $(intermediates.COMMON)/dex/classes.dex
-built_dex_hiddenapi := $(intermediates.COMMON)/dex-hiddenapi/classes.dex
full_classes_stubs_jar := $(intermediates.COMMON)/stubs.jar
java_source_list_file := $(intermediates.COMMON)/java-source-list
-hiddenapi_flags_csv := $(intermediates.COMMON)/hiddenapi/flags.csv
-hiddenapi_metadata_csv := $(intermediates.COMMON)/hiddenapi/greylist.csv
ifeq ($(LOCAL_MODULE_CLASS)$(LOCAL_SRC_FILES)$(LOCAL_STATIC_JAVA_LIBRARIES)$(LOCAL_SOURCE_FILES_ALL_GENERATED),APPS)
# If this is an apk without any Java code (e.g. framework-res), we should skip compiling Java.
@@ -500,21 +497,11 @@
$(transform-classes.jar-to-dex)
endif
-ifneq ($(filter $(LOCAL_MODULE),$(PRODUCT_BOOT_JARS)),) # is_boot_jar
- # Derive API greylist from the classes jar.
- # We use full_classes_pre_proguard_jar here, as that is what is converted to
- # dex later on. The difference is academic currently, as we don't proguard any
- # bootclasspath code at the moment. If we were to do that, we should add keep
- # rules for all members with the @UnsupportedAppUsage annotation.
- $(eval $(call hiddenapi-generate-csv, $(full_classes_pre_proguard_jar),$(hiddenapi_flags_csv),$(hiddenapi_metadata_csv)))
- LOCAL_INTERMEDIATE_TARGETS += $(hiddenapi_flags_csv) $(hiddenapi_metadata_csv)
- $(eval $(call hiddenapi-copy-dex-files,$(built_dex_intermediate),$(built_dex_hiddenapi)))
- built_dex_copy_from := $(built_dex_hiddenapi)
-else # !is_boot_jar
- built_dex_copy_from := $(built_dex_intermediate)
-endif # is_boot_jar
+ifneq ($(filter $(LOCAL_MODULE),$(PRODUCT_BOOT_JARS)),)
+ $(call pretty-error,Modules in PRODUCT_BOOT_JARS must be defined in Android.bp files)
+endif
-$(built_dex): $(built_dex_copy_from)
+$(built_dex): $(built_dex_intermediate)
@echo Copying: $@
$(hide) mkdir -p $(dir $@)
$(hide) rm -f $(dir $@)/classes*.dex