2010-09-18 01:36:06 +02:00
|
|
|
####################################
|
2013-11-15 08:44:56 +01:00
|
|
|
# dexpreopt support - typically used on user builds to run dexopt (for Dalvik) or dex2oat (for ART) ahead of time
|
2010-09-18 01:36:06 +02:00
|
|
|
#
|
|
|
|
####################################
|
|
|
|
|
2018-11-17 06:26:33 +01:00
|
|
|
include $(BUILD_SYSTEM)/dex_preopt_config.mk
|
2016-06-16 23:47:10 +02:00
|
|
|
|
2017-03-24 15:45:59 +01:00
|
|
|
# Method returning whether the install path $(1) should be for system_other.
|
2017-06-16 19:24:54 +02:00
|
|
|
# Under SANITIZE_LITE, we do not want system_other. Just put things under /data/asan.
|
|
|
|
ifeq ($(SANITIZE_LITE),true)
|
|
|
|
install-on-system-other =
|
|
|
|
else
|
2017-06-12 16:19:16 +02:00
|
|
|
install-on-system-other = $(filter-out $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(basename $(notdir $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(1)))))
|
2017-06-16 19:24:54 +02:00
|
|
|
endif
|
2017-03-24 15:45:59 +01:00
|
|
|
|
2013-11-15 08:44:56 +01:00
|
|
|
# Special rules for building stripped boot jars that override java_library.mk rules
|
2010-09-18 01:36:06 +02:00
|
|
|
|
|
|
|
# $(1): boot jar module name
|
2013-11-15 08:44:56 +01:00
|
|
|
define _dexpreopt-boot-jar-remove-classes.dex
|
|
|
|
_dbj_jar_no_dex := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/$(1)_nodex.jar
|
|
|
|
_dbj_src_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,$(1),,COMMON)/javalib.jar
|
2010-09-18 01:36:06 +02:00
|
|
|
|
2018-10-22 22:44:27 +02:00
|
|
|
$(call dexpreopt-copy-jar,$$(_dbj_src_jar),$$(_dbj_jar_no_dex),$(filter-out nostripping,$(DEX_PREOPT_DEFAULT)))
|
2010-09-18 01:36:06 +02:00
|
|
|
|
2013-11-15 08:44:56 +01:00
|
|
|
_dbj_jar_no_dex :=
|
|
|
|
_dbj_src_jar :=
|
2010-09-18 01:36:06 +02:00
|
|
|
endef
|
|
|
|
|
2013-11-15 08:44:56 +01:00
|
|
|
$(foreach b,$(DEXPREOPT_BOOT_JARS_MODULES),$(eval $(call _dexpreopt-boot-jar-remove-classes.dex,$(b))))
|
2010-09-18 01:36:06 +02:00
|
|
|
|
2013-11-15 08:44:56 +01:00
|
|
|
include $(BUILD_SYSTEM)/dex_preopt_libart.mk
|
2010-09-18 01:36:06 +02:00
|
|
|
|
2018-06-28 12:28:16 +02:00
|
|
|
# === hiddenapi rules ===
|
|
|
|
|
|
|
|
hiddenapi_stubs_jar = $(call intermediates-dir-for,JAVA_LIBRARIES,$(1),,COMMON)/javalib.jar
|
|
|
|
|
|
|
|
# Public API stubs
|
|
|
|
HIDDENAPI_STUBS := \
|
|
|
|
$(call hiddenapi_stubs_jar,android_stubs_current) \
|
2018-07-30 17:17:48 +02:00
|
|
|
$(call hiddenapi_stubs_jar,android.test.base.stubs)
|
2018-06-28 12:28:16 +02:00
|
|
|
|
|
|
|
# System API stubs
|
2018-08-03 12:21:34 +02:00
|
|
|
HIDDENAPI_STUBS_SYSTEM := \
|
2018-06-28 12:28:16 +02:00
|
|
|
$(call hiddenapi_stubs_jar,android_system_stubs_current)
|
|
|
|
|
|
|
|
# Test API stubs
|
2018-08-03 12:21:34 +02:00
|
|
|
HIDDENAPI_STUBS_TEST := \
|
2018-06-28 12:28:16 +02:00
|
|
|
$(call hiddenapi_stubs_jar,android_test_stubs_current)
|
|
|
|
|
2018-08-13 23:35:03 +02:00
|
|
|
# Allow products to define their own stubs for custom product jars that apps can use.
|
|
|
|
ifdef PRODUCT_HIDDENAPI_STUBS
|
|
|
|
HIDDENAPI_STUBS += $(foreach stub,$(PRODUCT_HIDDENAPI_STUBS), $(call hiddenapi_stubs_jar,$(stub)))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef PRODUCT_HIDDENAPI_STUBS_SYSTEM
|
|
|
|
HIDDENAPI_STUBS_SYSTEM += $(foreach stub,$(PRODUCT_HIDDENAPI_STUBS_SYSTEM), $(call hiddenapi_stubs_jar,$(stub)))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef PRODUCT_HIDDENAPI_STUBS_TEST
|
|
|
|
HIDDENAPI_STUBS_TEST += $(foreach stub,$(PRODUCT_HIDDENAPI_STUBS_TEST), $(call hiddenapi_stubs_jar,$(stub)))
|
|
|
|
endif
|
|
|
|
|
2018-06-28 12:28:16 +02:00
|
|
|
# Singleton rule which applies $(HIDDENAPI) on all boot class path dex files.
|
|
|
|
# Inputs are filled with `hiddenapi-copy-dex-files` rules.
|
2018-09-06 16:52:10 +02:00
|
|
|
.KATI_RESTAT: \
|
|
|
|
$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) \
|
|
|
|
$(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST)
|
2018-08-03 12:21:34 +02:00
|
|
|
$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): PRIVATE_HIDDENAPI_STUBS := $(HIDDENAPI_STUBS)
|
|
|
|
$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): PRIVATE_HIDDENAPI_STUBS_SYSTEM := $(HIDDENAPI_STUBS_SYSTEM)
|
|
|
|
$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): PRIVATE_HIDDENAPI_STUBS_TEST := $(HIDDENAPI_STUBS_TEST)
|
2018-06-28 12:28:16 +02:00
|
|
|
$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): \
|
|
|
|
.KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST)
|
2018-08-03 12:21:34 +02:00
|
|
|
$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): $(HIDDENAPI) $(HIDDENAPI_STUBS) \
|
|
|
|
$(HIDDENAPI_STUBS_SYSTEM) $(HIDDENAPI_STUBS_TEST)
|
2018-06-28 12:28:16 +02:00
|
|
|
for INPUT_DEX in $(PRIVATE_DEX_INPUTS); do \
|
|
|
|
find `dirname $${INPUT_DEX}` -maxdepth 1 -name "classes*.dex"; \
|
|
|
|
done | sort | sed 's/^/--boot-dex=/' | xargs $(HIDDENAPI) list \
|
2018-08-03 12:21:34 +02:00
|
|
|
--stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS)) \
|
|
|
|
--stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_SYSTEM)) \
|
|
|
|
--stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_TEST)) \
|
2018-09-06 16:52:10 +02:00
|
|
|
--out-public=$(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST).tmp \
|
|
|
|
--out-private=$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST).tmp
|
|
|
|
$(call commit-change-for-toc,$(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST))
|
|
|
|
$(call commit-change-for-toc,$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST))
|
2018-06-28 12:28:16 +02:00
|
|
|
|
2018-11-17 06:26:33 +01:00
|
|
|
|
|
|
|
|
2018-05-10 20:33:27 +02:00
|
|
|
ifeq ($(PRODUCT_DIST_BOOT_AND_SYSTEM_JARS),true)
|
|
|
|
boot_profile_jars_zip := $(PRODUCT_OUT)/boot_profile_jars.zip
|
|
|
|
all_boot_jars := \
|
|
|
|
$(foreach m,$(DEXPREOPT_BOOT_JARS_MODULES),$(PRODUCT_OUT)/system/framework/$(m).jar) \
|
|
|
|
$(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(PRODUCT_OUT)/system/framework/$(m).jar)
|
|
|
|
|
|
|
|
$(boot_profile_jars_zip): PRIVATE_JARS := $(all_boot_jars)
|
|
|
|
$(boot_profile_jars_zip): $(all_boot_jars) $(SOONG_ZIP)
|
|
|
|
echo "Create boot profiles package: $@"
|
|
|
|
rm -f $@
|
2018-10-01 19:30:04 +02:00
|
|
|
$(SOONG_ZIP) -o $@ -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_JARS))
|
2018-05-10 20:33:27 +02:00
|
|
|
|
|
|
|
droidcore: $(boot_profile_jars_zip)
|
|
|
|
|
|
|
|
$(call dist-for-goals, droidcore, $(boot_profile_jars_zip))
|
|
|
|
endif
|