Merge "Use $(AAPT) instead of aapt for verifying uses libraries"

This commit is contained in:
Mathieu Chartier 2018-05-14 19:52:47 +00:00 committed by Gerrit Code Review
commit 4537ebb7a1
2 changed files with 4 additions and 1 deletions

View File

@ -175,6 +175,7 @@ class_loader_context=$(PRIVATE_DEX2OAT_CLASS_LOADER_CONTEXT) && \
stored_class_loader_context_arg="" && \ stored_class_loader_context_arg="" && \
uses_library_names="$(PRIVATE_USES_LIBRARY_NAMES)" && \ uses_library_names="$(PRIVATE_USES_LIBRARY_NAMES)" && \
optional_uses_library_names="$(PRIVATE_OPTIONAL_USES_LIBRARY_NAMES)" && \ optional_uses_library_names="$(PRIVATE_OPTIONAL_USES_LIBRARY_NAMES)" && \
aapt_binary="$(AAPT)" && \
$(if $(filter true,$(PRIVATE_ENFORCE_USES_LIBRARIES)), \ $(if $(filter true,$(PRIVATE_ENFORCE_USES_LIBRARIES)), \
source build/make/core/verify_uses_libraries.sh "$(1)" && \ source build/make/core/verify_uses_libraries.sh "$(1)" && \
source build/make/core/construct_context.sh "$(PRIVATE_CONDITIONAL_USES_LIBRARIES_HOST)" "$(PRIVATE_CONDITIONAL_USES_LIBRARIES_TARGET)" && \ source build/make/core/construct_context.sh "$(PRIVATE_CONDITIONAL_USES_LIBRARIES_HOST)" "$(PRIVATE_CONDITIONAL_USES_LIBRARIES_TARGET)" && \

View File

@ -15,11 +15,13 @@
# limitations under the License. # limitations under the License.
# apt_binary is $(AAPT) in the build.
# Parse sdk, targetSdk, and uses librares in the APK, then cross reference against build specified ones. # Parse sdk, targetSdk, and uses librares in the APK, then cross reference against build specified ones.
set -e set -e
local_apk=$1 local_apk=$1
badging=$(aapt dump badging "${local_apk}") badging=$(${aapt_binary} dump badging "${local_apk}")
export sdk_version=$(echo "${badging}" | grep "sdkVersion" | sed -n "s/sdkVersion:'\(.*\)'/\1/p") export sdk_version=$(echo "${badging}" | grep "sdkVersion" | sed -n "s/sdkVersion:'\(.*\)'/\1/p")
# Export target_sdk_version to the caller. # Export target_sdk_version to the caller.
export target_sdk_version=$(echo "${badging}" | grep "targetSdkVersion" | sed -n "s/targetSdkVersion:'\(.*\)'/\1/p") export target_sdk_version=$(echo "${badging}" | grep "targetSdkVersion" | sed -n "s/targetSdkVersion:'\(.*\)'/\1/p")