From e3fb5f6d09a3716ca8de91d404ee50d2e50a5f6e Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Thu, 6 Sep 2018 15:52:10 +0100 Subject: [PATCH] Add hidden API public/private list to KATI_RESTAT Change hidden API public/private list generation build rule so that it checks if outputs have changed and only commit them when changes have been made. .KATI_RESTAT instructs ninja to restat the outputs and remove reverse dependencies when rebuilding dependencies is not needed. Bug: 113278235 Test: m appcompat Change-Id: Iad23e302b6c30f9a021200acd4bb20e6062de5a2 --- core/dex_preopt.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 8299988a7..aa24c20f0 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -128,6 +128,9 @@ endif # Singleton rule which applies $(HIDDENAPI) on all boot class path dex files. # Inputs are filled with `hiddenapi-copy-dex-files` rules. +.KATI_RESTAT: \ + $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) \ + $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) $(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) @@ -141,8 +144,10 @@ $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): $(HIDDENAPI) $(HIDDENAPI_STUBS) \ --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)) \ - --out-public=$(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) \ - --out-private=$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) + --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)) ifeq ($(PRODUCT_DIST_BOOT_AND_SYSTEM_JARS),true) boot_profile_jars_zip := $(PRODUCT_OUT)/boot_profile_jars.zip