Execute appcompat for apps built from soong

Appcompat runs for app defined in Android.mk, but not in Android.bp
So make appcompat run for app from soong(Android.bp)

Bug: 110073830
Bug: 122026042

Test: m out/target/product/$(get_build_var TARGET_DEVICE)/appcompat.zip

Change-Id: I73832410ec5850222b04086c2a377146886ba035
This commit is contained in:
Jeongik Cha 2019-01-08 12:41:48 +09:00
parent 371f557f8e
commit f712ce79f5

View file

@ -74,7 +74,28 @@ ifneq ($(BUILD_PLATFORM_ZIP),)
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(dir $(LOCAL_BUILT_MODULE))package.dex.apk))
endif
$(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(LOCAL_BUILT_MODULE)))
# Run veridex on product, product_services and vendor modules.
# We skip it for unbundled app builds where we cannot build veridex.
module_run_appcompat :=
ifeq (true,$(filter true, \
$(LOCAL_PRODUCT_MODULE) $(LOCAL_PRODUCT_SERVICES_MODULE) \
$(LOCAL_VENDOR_MODULE) $(LOCAL_PROPRIETARY_MODULE)))
ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) # ! unbundled app build
module_run_appcompat := true
endif
endif
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)
$(call appcompat-header, aapt2)
$(run-appcompat)
else
$(eval $(call copy-one-file,$(LOCAL_PREBUILT_MODULE_FILE),$(LOCAL_BUILT_MODULE)))
endif
my_built_installed := $(foreach f,$(LOCAL_SOONG_BUILT_INSTALLED),\
$(call word-colon,1,$(f)):$(PRODUCT_OUT)$(call word-colon,2,$(f)))