Merge "Revert "Revert "Copy resources from classes.jar when using AAPT2"""

am: e2b98ace94

Change-Id: Id0850fff121beab0920e06440c7271d7622387b0
This commit is contained in:
Colin Cross 2017-08-04 21:02:35 +00:00 committed by android-build-merger
commit a4e638689b
2 changed files with 19 additions and 0 deletions

View File

@ -2692,6 +2692,17 @@ define add-carried-jack-resources
fi
endef
# Add resources (non .class files) from a jar to a package
# $(1): the package file
# $(2): the jar file
# $(3): temporary directory
define add-jar-resources-to-package
rm -rf $(3)
mkdir -p $(3)
unzip -qo $(2) -d $(3) $$(zipinfo -1 $(2) | grep -v -E "\.class$$")
$(JAR) uf $(1) -C $(3) .
endef
# Sign a package using the specified key/cert.
#
define sign-package

View File

@ -563,7 +563,10 @@ else
$(my_res_package) $(LOCAL_BUILT_MODULE): PRIVATE_PRODUCT_AAPT_PREF_CONFIG := $(PRODUCT_AAPT_PREF_CONFIG)
endif
endif
$(LOCAL_BUILT_MODULE): PRIVATE_DONT_DELETE_JAR_DIRS := $(LOCAL_DONT_DELETE_JAR_DIRS)
$(LOCAL_BUILT_MODULE): PRIVATE_RESOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/resources
$(LOCAL_BUILT_MODULE): PRIVATE_FULL_CLASSES_JAR := $(full_classes_jar)
$(LOCAL_BUILT_MODULE) : $(jni_shared_libraries)
ifdef LOCAL_USE_AAPT2
$(LOCAL_BUILT_MODULE): PRIVATE_RES_PACKAGE := $(my_res_package)
@ -592,6 +595,11 @@ ifeq ($(full_classes_jar),)
$(if $(PRIVATE_EXTRA_JAR_ARGS),$(call add-java-resources-to,$@))
else # full_classes_jar
$(add-dex-to-package)
ifdef LOCAL_USE_AAPT2
ifndef LOCAL_JACK_ENABLED
$(call add-jar-resources-to-package,$@,$(PRIVATE_FULL_CLASSES_JAR),$(PRIVATE_RESOURCE_INTERMEDIATES_DIR))
endif
endif
endif # full_classes_jar
ifdef LOCAL_JACK_ENABLED
$(add-carried-jack-resources)