2017-11-16 05:35:27 +00:00
|
|
|
# App prebuilt coming from Soong.
|
|
|
|
# Extra inputs:
|
2018-11-17 05:26:33 +00:00
|
|
|
# LOCAL_SOONG_BUILT_INSTALLED
|
|
|
|
# LOCAL_SOONG_BUNDLE
|
|
|
|
# LOCAL_SOONG_CLASSES_JAR
|
|
|
|
# LOCAL_SOONG_DEX_JAR
|
|
|
|
# LOCAL_SOONG_HEADER_JAR
|
|
|
|
# LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
|
|
|
# LOCAL_SOONG_PROGUARD_DICT
|
2017-11-16 05:35:27 +00:00
|
|
|
# LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
|
2018-11-17 05:26:33 +00:00
|
|
|
# LOCAL_SOONG_RRO_DIRS
|
|
|
|
# LOCAL_SOONG_JNI_LIBS_$(TARGET_ARCH)
|
|
|
|
# LOCAL_SOONG_JNI_LIBS_$(TARGET_2ND_ARCH)
|
2017-11-16 05:35:27 +00:00
|
|
|
|
|
|
|
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
$(call pretty-error,soong_app_prebuilt.mk may only be used from Soong)
|
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_MODULE_SUFFIX := .apk
|
|
|
|
LOCAL_BUILT_MODULE_STEM := package.apk
|
|
|
|
|
2019-01-29 23:07:46 +00:00
|
|
|
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
|
2017-11-16 05:35:27 +00:00
|
|
|
|
2017-12-14 21:19:46 +00:00
|
|
|
full_classes_jar := $(intermediates.COMMON)/classes.jar
|
|
|
|
full_classes_pre_proguard_jar := $(intermediates.COMMON)/classes-pre-proguard.jar
|
|
|
|
full_classes_header_jar := $(intermediates.COMMON)/classes-header.jar
|
|
|
|
|
2019-01-29 23:07:46 +00:00
|
|
|
#######################################
|
|
|
|
include $(BUILD_SYSTEM)/base_rules.mk
|
|
|
|
#######################################
|
|
|
|
|
2019-01-14 22:10:20 +00:00
|
|
|
ifdef LOCAL_SOONG_CLASSES_JAR
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_CLASSES_JAR),$(full_classes_jar)))
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_CLASSES_JAR),$(full_classes_pre_proguard_jar)))
|
|
|
|
$(eval $(call add-dependency,$(LOCAL_BUILT_MODULE),$(full_classes_jar)))
|
|
|
|
|
|
|
|
ifneq ($(TURBINE_ENABLED),false)
|
|
|
|
ifdef LOCAL_SOONG_HEADER_JAR
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_HEADER_JAR),$(full_classes_header_jar)))
|
|
|
|
else
|
|
|
|
$(eval $(call copy-one-file,$(full_classes_jar),$(full_classes_header_jar)))
|
|
|
|
endif
|
|
|
|
endif # TURBINE_ENABLED != false
|
2019-12-31 06:08:07 +00:00
|
|
|
|
|
|
|
javac-check : $(full_classes_jar)
|
|
|
|
javac-check-$(LOCAL_MODULE) : $(full_classes_jar)
|
|
|
|
.PHONY: javac-check-$(LOCAL_MODULE)
|
2019-01-14 22:10:20 +00:00
|
|
|
endif
|
|
|
|
|
2019-06-25 06:58:13 +00:00
|
|
|
# Run veridex on product, system_ext and vendor modules.
|
2019-01-14 22:10:20 +00:00
|
|
|
# We skip it for unbundled app builds where we cannot build veridex.
|
|
|
|
module_run_appcompat :=
|
2019-01-18 06:09:09 +00:00
|
|
|
ifeq (true,$(non_system_module))
|
2019-01-14 22:10:20 +00:00
|
|
|
ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) # ! unbundled app build
|
2019-01-15 17:30:51 +00:00
|
|
|
ifneq ($(UNSAFE_DISABLE_HIDDENAPI_FLAGS),true)
|
2019-01-14 22:10:20 +00:00
|
|
|
module_run_appcompat := true
|
|
|
|
endif
|
|
|
|
endif
|
2019-01-15 17:30:51 +00:00
|
|
|
endif
|
2019-01-14 22:10:20 +00:00
|
|
|
|
|
|
|
ifeq ($(module_run_appcompat),true)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(appcompat-files)
|
|
|
|
$(LOCAL_BUILT_MODULE): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
|
|
|
|
$(LOCAL_BUILT_MODULE): $(LOCAL_PREBUILT_MODULE_FILE)
|
|
|
|
@echo "Copy: $@"
|
|
|
|
$(copy-file-to-target)
|
2019-02-26 06:21:24 +00:00
|
|
|
$(appcompat-header)
|
2019-01-14 22:10:20 +00:00
|
|
|
$(run-appcompat)
|
|
|
|
else
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(LOCAL_BUILT_MODULE)))
|
|
|
|
endif
|
2017-12-14 21:19:46 +00:00
|
|
|
|
2018-01-02 21:16:43 +00:00
|
|
|
ifdef LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR),\
|
|
|
|
$(intermediates.COMMON)/jacoco-report-classes.jar))
|
|
|
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
|
|
|
$(intermediates.COMMON)/jacoco-report-classes.jar)
|
|
|
|
endif
|
|
|
|
|
2017-12-28 03:46:02 +00:00
|
|
|
ifdef LOCAL_SOONG_PROGUARD_DICT
|
|
|
|
$(eval $(call copy-one-file,$(LOCAL_SOONG_PROGUARD_DICT),\
|
|
|
|
$(intermediates.COMMON)/proguard_dictionary))
|
|
|
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),\
|
|
|
|
$(intermediates.COMMON)/proguard_dictionary)
|
|
|
|
endif
|
|
|
|
|
2017-11-16 05:35:27 +00:00
|
|
|
ifdef LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
|
|
|
|
resource_export_package := $(intermediates.COMMON)/package-export.apk
|
|
|
|
resource_export_stamp := $(intermediates.COMMON)/src/R.stamp
|
|
|
|
|
|
|
|
$(resource_export_package): PRIVATE_STAMP := $(resource_export_stamp)
|
|
|
|
$(resource_export_package): .KATI_IMPLICIT_OUTPUTS := $(resource_export_stamp)
|
|
|
|
$(resource_export_package): $(LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE)
|
2019-02-06 16:27:47 +00:00
|
|
|
@echo "Copy: $@"
|
2017-11-16 05:35:27 +00:00
|
|
|
$(copy-file-to-target)
|
|
|
|
touch $(PRIVATE_STAMP)
|
2018-02-21 01:21:36 +00:00
|
|
|
$(call add-dependency,$(LOCAL_BUILT_MODULE),$(resource_export_package))
|
2017-11-16 05:35:27 +00:00
|
|
|
|
|
|
|
endif # LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
|
|
|
|
|
|
|
|
java-dex: $(LOCAL_SOONG_DEX_JAR)
|
|
|
|
|
|
|
|
|
2018-11-17 05:26:33 +00:00
|
|
|
my_built_installed := $(foreach f,$(LOCAL_SOONG_BUILT_INSTALLED),\
|
|
|
|
$(call word-colon,1,$(f)):$(PRODUCT_OUT)$(call word-colon,2,$(f)))
|
|
|
|
my_installed := $(call copy-many-files, $(my_built_installed))
|
|
|
|
ALL_MODULES.$(my_register_name).INSTALLED += $(my_installed)
|
|
|
|
ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(my_built_installed)
|
2019-01-30 00:26:36 +00:00
|
|
|
$(my_all_targets): $(my_installed)
|
2017-11-16 05:35:27 +00:00
|
|
|
|
2019-11-21 18:09:00 +00:00
|
|
|
# Copy test suite files.
|
|
|
|
ifdef LOCAL_COMPATIBILITY_SUITE
|
|
|
|
my_apks_to_install := $(foreach f,$(filter %.apk,$(LOCAL_SOONG_BUILT_INSTALLED)),$(call word-colon,1,$(f)))
|
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_$(suite) := $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
|
|
|
$(foreach a,$(my_apks_to_install),\
|
|
|
|
$(call compat-copy-pair,$(a),$(dir)/$(notdir $(a)))))))
|
|
|
|
$(call create-suite-dependencies)
|
|
|
|
endif
|
|
|
|
|
2018-10-03 21:09:18 +00:00
|
|
|
# embedded JNI will already have been handled by soong
|
|
|
|
my_embed_jni :=
|
|
|
|
my_prebuilt_jni_libs :=
|
|
|
|
ifdef LOCAL_SOONG_JNI_LIBS_$(TARGET_ARCH)
|
|
|
|
my_2nd_arch_prefix :=
|
|
|
|
LOCAL_JNI_SHARED_LIBRARIES := $(LOCAL_SOONG_JNI_LIBS_$(TARGET_ARCH))
|
|
|
|
include $(BUILD_SYSTEM)/install_jni_libs_internal.mk
|
|
|
|
endif
|
|
|
|
ifdef TARGET_2ND_ARCH
|
|
|
|
ifdef LOCAL_SOONG_JNI_LIBS_$(TARGET_2ND_ARCH)
|
|
|
|
my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
|
|
|
|
LOCAL_JNI_SHARED_LIBRARIES := $(LOCAL_SOONG_JNI_LIBS_$(TARGET_2ND_ARCH))
|
|
|
|
include $(BUILD_SYSTEM)/install_jni_libs_internal.mk
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
LOCAL_SHARED_JNI_LIBRARIES :=
|
|
|
|
my_embed_jni :=
|
|
|
|
my_prebuilt_jni_libs :=
|
|
|
|
my_2nd_arch_prefix :=
|
2018-09-18 17:16:37 +00:00
|
|
|
|
2017-12-14 19:20:27 +00:00
|
|
|
PACKAGES := $(PACKAGES) $(LOCAL_MODULE)
|
2019-03-21 22:46:25 +00:00
|
|
|
ifeq ($(LOCAL_CERTIFICATE),PRESIGNED)
|
|
|
|
# The magic string "PRESIGNED" means this package is already checked
|
|
|
|
# signed with its release key.
|
|
|
|
#
|
|
|
|
# By setting .CERTIFICATE but not .PRIVATE_KEY, this package will be
|
|
|
|
# mentioned in apkcerts.txt (with certificate set to "PRESIGNED")
|
|
|
|
# but the dexpreopt process will not try to re-sign the app.
|
|
|
|
PACKAGES.$(LOCAL_MODULE).CERTIFICATE := PRESIGNED
|
|
|
|
else ifneq ($(LOCAL_CERTIFICATE),)
|
2017-12-15 21:20:27 +00:00
|
|
|
PACKAGES.$(LOCAL_MODULE).CERTIFICATE := $(LOCAL_CERTIFICATE)
|
|
|
|
PACKAGES.$(LOCAL_MODULE).PRIVATE_KEY := $(patsubst %.x509.pem,%.pk8,$(LOCAL_CERTIFICATE))
|
2017-12-14 19:20:27 +00:00
|
|
|
endif
|
2018-12-17 05:45:15 +00:00
|
|
|
include $(BUILD_SYSTEM)/app_certificate_validate.mk
|
2018-08-10 17:28:00 +00:00
|
|
|
PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
|
|
|
|
|
2018-10-30 06:16:42 +00:00
|
|
|
ifdef LOCAL_SOONG_BUNDLE
|
|
|
|
ALL_MODULES.$(LOCAL_MODULE).BUNDLE := $(LOCAL_SOONG_BUNDLE)
|
|
|
|
endif
|
|
|
|
|
2017-11-16 05:35:27 +00:00
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
|
|
|
ifeq ($(LOCAL_SDK_VERSION),system_current)
|
|
|
|
my_link_type := java:system
|
|
|
|
else ifneq ($(LOCAL_SDK_VERSION),)
|
|
|
|
my_link_type := java:sdk
|
|
|
|
else
|
|
|
|
my_link_type := java:platform
|
|
|
|
endif
|
2018-03-08 06:16:12 +00:00
|
|
|
# warn/allowed types are both empty because Soong modules can't depend on
|
|
|
|
# make-defined modules.
|
|
|
|
my_warn_types :=
|
|
|
|
my_allowed_types :=
|
2017-11-16 05:35:27 +00:00
|
|
|
|
|
|
|
my_link_deps :=
|
|
|
|
my_2nd_arch_prefix := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
|
|
|
my_common := COMMON
|
|
|
|
include $(BUILD_SYSTEM)/link_type.mk
|
|
|
|
endif # !LOCAL_IS_HOST_MODULE
|
|
|
|
|
2019-03-18 11:43:30 +00:00
|
|
|
ifdef LOCAL_SOONG_DEVICE_RRO_DIRS
|
2017-12-01 04:11:22 +00:00
|
|
|
$(call append_enforce_rro_sources, \
|
|
|
|
$(my_register_name), \
|
|
|
|
false, \
|
|
|
|
$(LOCAL_FULL_MANIFEST_FILE), \
|
2019-01-28 20:56:17 +00:00
|
|
|
$(if $(LOCAL_EXPORT_PACKAGE_RESOURCES),true,false), \
|
2019-03-18 11:43:30 +00:00
|
|
|
$(LOCAL_SOONG_DEVICE_RRO_DIRS), \
|
|
|
|
vendor \
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef LOCAL_SOONG_PRODUCT_RRO_DIRS
|
|
|
|
$(call append_enforce_rro_sources, \
|
|
|
|
$(my_register_name), \
|
|
|
|
false, \
|
|
|
|
$(LOCAL_FULL_MANIFEST_FILE), \
|
|
|
|
$(if $(LOCAL_EXPORT_PACKAGE_RESOURCES),true,false), \
|
|
|
|
$(LOCAL_SOONG_PRODUCT_RRO_DIRS), \
|
|
|
|
product \
|
|
|
|
)
|
2017-12-01 04:11:22 +00:00
|
|
|
endif
|
2018-08-17 05:55:43 +00:00
|
|
|
|
|
|
|
SOONG_ALREADY_CONV := $(SOONG_ALREADY_CONV) $(LOCAL_MODULE)
|