From f272adb16877fb40ca0bb6e2531ffcf3be2a2370 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 8 Aug 2019 12:56:01 -0700 Subject: [PATCH] Use more variables from Soong Remove more copies of variables that are computed by Soong. Test: m checkbuild Change-Id: If78d4650438cc91d00c691db2fc97c5b790d5648 --- core/config.mk | 19 ++++--------------- core/definitions.mk | 2 +- core/package_internal.mk | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/core/config.mk b/core/config.mk index 0f9f1127b..e4dfe3ac2 100644 --- a/core/config.mk +++ b/core/config.mk @@ -506,22 +506,12 @@ USE_D8 := true # Tools that are prebuilts for TARGET_BUILD_APPS # ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) - AIDL := $(HOST_OUT_EXECUTABLES)/aidl AAPT := $(HOST_OUT_EXECUTABLES)/aapt - AAPT2 := $(HOST_OUT_EXECUTABLES)/aapt2 MAINDEXCLASSES := $(HOST_OUT_EXECUTABLES)/mainDexClasses - SIGNAPK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/signapk$(COMMON_JAVA_PACKAGE_SUFFIX) - SIGNAPK_JNI_LIBRARY_PATH := $(HOST_OUT_SHARED_LIBRARIES) - ZIPALIGN := $(HOST_OUT_EXECUTABLES)/zipalign else # TARGET_BUILD_APPS || TARGET_BUILD_PDK - AIDL := $(prebuilt_build_tools_bin)/aidl AAPT := $(prebuilt_sdk_tools_bin)/aapt - AAPT2 := $(prebuilt_sdk_tools_bin)/aapt2 MAINDEXCLASSES := $(prebuilt_sdk_tools)/mainDexClasses - SIGNAPK_JAR := $(prebuilt_sdk_tools)/lib/signapk$(COMMON_JAVA_PACKAGE_SUFFIX) - SIGNAPK_JNI_LIBRARY_PATH := $(prebuilt_sdk_tools)/$(HOST_OS)/lib64 - ZIPALIGN := $(prebuilt_build_tools_bin)/zipalign endif # TARGET_BUILD_APPS || TARGET_BUILD_PDK ifeq (,$(TARGET_BUILD_APPS)) @@ -542,12 +532,11 @@ DEPMOD := $(HOST_OUT_EXECUTABLES)/depmod FILESLIST := $(SOONG_HOST_OUT_EXECUTABLES)/fileslist FILESLIST_UTIL :=$= build/make/tools/fileslist_util.py HOST_INIT_VERIFIER := $(HOST_OUT_EXECUTABLES)/host_init_verifier -SOONG_JAVAC_WRAPPER := $(SOONG_HOST_OUT_EXECUTABLES)/soong_javac_wrapper -SOONG_ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/soong_zip -MERGE_ZIPS := $(SOONG_HOST_OUT_EXECUTABLES)/merge_zips XMLLINT := $(SOONG_HOST_OUT_EXECUTABLES)/xmllint -ZIP2ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/zip2zip -ZIPTIME := $(prebuilt_build_tools_bin)/ziptime + +# SOONG_ZIP is exported by Soong, but needs to be defined early for +# $OUT/dexpreopt.global. It will be verified against the Soong version. +SOONG_ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/soong_zip # --------------------------------------------------------------- # Generic tools. diff --git a/core/definitions.mk b/core/definitions.mk index f32a99584..d54fd90f4 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2270,7 +2270,7 @@ endef # $(1): the package file we are signing. define sign-package-arg $(hide) mv $(1) $(1).unsigned -$(hide) $(JAVA) -Djava.library.path=$(SIGNAPK_JNI_LIBRARY_PATH) -jar $(SIGNAPK_JAR) \ +$(hide) $(JAVA) -Djava.library.path=$$(dirname $(SIGNAPK_JNI_LIBRARY_PATH)) -jar $(SIGNAPK_JAR) \ $(PRIVATE_CERTIFICATE) $(PRIVATE_PRIVATE_KEY) \ $(PRIVATE_ADDITIONAL_CERTIFICATES) $(1).unsigned $(1).signed $(hide) mv $(1).signed $(1) diff --git a/core/package_internal.mk b/core/package_internal.mk index 2130058f5..c06a63ce0 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -452,7 +452,7 @@ private_key := $(LOCAL_CERTIFICATE).pk8 certificate := $(LOCAL_CERTIFICATE).x509.pem additional_certificates := $(foreach c,$(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x509.pem $(c).pk8) -$(LOCAL_BUILT_MODULE): $(private_key) $(certificate) $(SIGNAPK_JAR) +$(LOCAL_BUILT_MODULE): $(private_key) $(certificate) $(SIGNAPK_JAR) $(SIGNAPK_JNI_LIBRARY_PATH) $(LOCAL_BUILT_MODULE): PRIVATE_PRIVATE_KEY := $(private_key) $(LOCAL_BUILT_MODULE): PRIVATE_CERTIFICATE := $(certificate)