Do not run veridex on unbundled app builds

Unbundled app builds do not build the framework, only apps against
the prebuilt public API. Running veridex from the local tree does,
however, depend on the framework to generate the list of non-SDK
APIs. Disable veridex on such builds and remove appcompat.zip from
artifacts.

Test: make ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Change-Id: I16289adc7fc660109d61260e8a49e992228e727c
This commit is contained in:
David Brazdil
2018-07-31 11:31:30 +01:00
committed by Dario Freni
parent 6e5b55bf7f
commit 825770ebad
3 changed files with 23 additions and 8 deletions

View File

@@ -1263,9 +1263,6 @@ ifneq ($(TARGET_BUILD_APPS),)
$(COVERAGE_ZIP) : $(apps_only_installed_files)
$(call dist-for-goals,apps_only, $(COVERAGE_ZIP))
$(APPCOMPAT_ZIP) : $(apps_only_installed_files)
$(call dist-for-goals,apps_only, $(APPCOMPAT_ZIP))
.PHONY: apps_only
apps_only: $(unbundled_build_modules)

View File

@@ -592,7 +592,16 @@ else
endif
endif
# Run veridex on product modules.
# We skip it for unbundled app builds where we cannot build veridex.
module_run_appcompat :=
ifdef LOCAL_PRODUCT_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) : $(call intermediates-dir-for,PACKAGING,veridex,HOST)/veridex.zip
endif
@@ -637,9 +646,9 @@ ifeq (true, $(LOCAL_UNCOMPRESS_DEX))
$(uncompress-dexs)
endif
# Run appcompat before stripping the classes.dex file.
ifdef LOCAL_PRODUCT_MODULE
ifeq ($(module_run_appcompat),true)
$(run-appcompat)
endif # LOCAL_PRODUCT_MODULE
endif # module_run_appcompat
ifdef LOCAL_DEX_PREOPT
ifneq ($(BUILD_PLATFORM_ZIP),)
@# Keep a copy of apk with classes.dex unstripped

View File

@@ -95,6 +95,15 @@ else
prebuilt_module_is_dex_javalib :=
endif
# Run veridex on product modules.
# We skip it for unbundled app builds where we cannot build veridex.
module_run_appcompat :=
ifdef LOCAL_PRODUCT_MODULE
ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) # ! unbundled app build
module_run_appcompat := true
endif
endif
ifdef LOCAL_COMPRESSED_MODULE
ifneq (true,$(LOCAL_COMPRESSED_MODULE))
$(call pretty-error, Unknown value for LOCAL_COMPRESSED_MODULE $(LOCAL_COMPRESSED_MODULE))
@@ -376,7 +385,7 @@ ifdef LOCAL_COMPRESSED_MODULE
$(built_module) : $(MINIGZIP)
endif
ifdef LOCAL_PRODUCT_MODULE
ifeq ($(module_run_appcompat),true)
$(built_module) : $(call intermediates-dir-for,PACKAGING,veridex,HOST)/veridex.zip
endif
@@ -395,9 +404,9 @@ endif # LOCAL_DEX_PREOPT
ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
@# Only strip out files if we can re-sign the package.
# Run appcompat before stripping the classes.dex file.
ifdef LOCAL_PRODUCT_MODULE
ifeq ($(module_run_appcompat),true)
$(run-appcompat)
endif # LOCAL_PRODUCT_MODULE
endif # module_run_appcompat
ifdef LOCAL_DEX_PREOPT
ifneq (nostripping,$(LOCAL_DEX_PREOPT))
$(call dexpreopt-remove-classes.dex,$@)