Merge "Run appcompat on vendor and product-services."

This commit is contained in:
Treehugger Robot 2018-08-01 01:11:19 +00:00 committed by Gerrit Code Review
commit 11b4a97ad8
3 changed files with 40 additions and 7 deletions

View file

@ -2547,14 +2547,31 @@ endef
ifeq ($(HOST_OS),linux)
# Runs appcompat and store logs in $(PRODUCT_OUT)/appcompat
define extract-package
$(if $(filter aapt2, $(1)), \
$(AAPT2) dump $@ | awk -F ' |=' '/^Package/{print $$3}' >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log &&, \
$(AAPT) dump badging $@ | awk -F \' '/^package/{print $$2}' >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log &&)
endef
define appcompat-header
$(hide) \
mkdir -p $(PRODUCT_OUT)/appcompat && \
rm -f $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log && \
echo -n "Package name: " >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log && \
$(call extract-package, $(1)) \
echo "Module name in Android tree: $(PRIVATE_MODULE)" >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log && \
echo "Local path in Android tree: $(PRIVATE_PATH)" >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log && \
echo "Install path on $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT): $(PRIVATE_INSTALLED_MODULE)" >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log && \
echo >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log
endef
define run-appcompat
$(hide) \
mkdir -p $(PRODUCT_OUT)/appcompat; \
art/tools/veridex/appcompat.sh --dex-file=$@ 2>&1 > $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log;
echo "appcompat.sh output:" >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log && \
art/tools/veridex/appcompat.sh --dex-file=$@ 2>&1 >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log
endef
else
appcompat-header =
run-appcompat =
endif
endif # HOST_OS == linux
# Remove dynamic timestamps from packages
#

View file

@ -592,10 +592,12 @@ else
endif
endif
# Run veridex on product modules.
# Run veridex on product, product-services and vendor modules.
# We skip it for unbundled app builds where we cannot build veridex.
module_run_appcompat :=
ifdef LOCAL_PRODUCT_MODULE
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
@ -603,6 +605,7 @@ endif
ifeq ($(module_run_appcompat),true)
$(LOCAL_BUILT_MODULE) : $(call intermediates-dir-for,PACKAGING,veridex,HOST)/veridex.zip
$(LOCAL_BUILT_MODULE): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
endif
$(LOCAL_BUILT_MODULE): PRIVATE_DONT_DELETE_JAR_DIRS := $(LOCAL_DONT_DELETE_JAR_DIRS)
@ -647,6 +650,11 @@ ifeq (true, $(LOCAL_UNCOMPRESS_DEX))
endif
# Run appcompat before stripping the classes.dex file.
ifeq ($(module_run_appcompat),true)
ifeq ($(LOCAL_USE_AAPT2),true)
$(call appcompat-header, aapt2)
else
$(appcompat-header)
endif
$(run-appcompat)
endif # module_run_appcompat
ifdef LOCAL_DEX_PREOPT

View file

@ -95,10 +95,12 @@ else
prebuilt_module_is_dex_javalib :=
endif
# Run veridex on product modules.
# Run veridex on product, product-services and vendor modules.
# We skip it for unbundled app builds where we cannot build veridex.
module_run_appcompat :=
ifdef LOCAL_PRODUCT_MODULE
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
@ -387,6 +389,7 @@ endif
ifeq ($(module_run_appcompat),true)
$(built_module) : $(call intermediates-dir-for,PACKAGING,veridex,HOST)/veridex.zip
$(LOCAL_BUILT_MODULE): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
endif
$(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(SIGNAPK_JAR)
@ -405,6 +408,11 @@ ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
@# Only strip out files if we can re-sign the package.
# Run appcompat before stripping the classes.dex file.
ifeq ($(module_run_appcompat),true)
ifeq ($(LOCAL_USE_AAPT2),true)
$(call appcompat-header, aapt2)
else
$(appcompat-header)
endif
$(run-appcompat)
endif # module_run_appcompat
ifdef LOCAL_DEX_PREOPT