Use implicit output for prebuilt aar manifests
Remove my_full_libs_manifest_deps by making AndroidManifest.xml an implicit output of the prebuilt aar unzipping rule. Bug: 78447299 Test: m checkbuild Change-Id: I26934d16fd646d45bf57c9527dbb191112cb627b
This commit is contained in:
parent
a4796dae80
commit
2b5829e1a6
2 changed files with 10 additions and 8 deletions
|
@ -12,13 +12,9 @@ else
|
|||
endif
|
||||
|
||||
my_full_libs_manifest_files := $(LOCAL_FULL_LIBS_MANIFEST_FILES)
|
||||
my_full_libs_manifest_deps := $(LOCAL_FULL_LIBS_MANIFEST_FILES)
|
||||
|
||||
# Set up dependency on aar libraries
|
||||
LOCAL_STATIC_JAVA_AAR_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_AAR_LIBRARIES))
|
||||
ifdef LOCAL_STATIC_JAVA_AAR_LIBRARIES
|
||||
my_full_libs_manifest_deps += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
|
||||
$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/classes.jar)
|
||||
my_full_libs_manifest_files += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
|
||||
$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/AndroidManifest.xml)
|
||||
|
||||
|
@ -30,12 +26,13 @@ endif # LOCAL_USE_AAPT2
|
|||
endif # LOCAL_STATIC_JAVA_AAR_LIBRARIES
|
||||
|
||||
# Set up rules to merge library manifest files
|
||||
ifdef my_full_libs_manifest_files
|
||||
ifneq (,$(strip $(my_full_libs_manifest_files)))
|
||||
|
||||
main_android_manifest := $(full_android_manifest)
|
||||
full_android_manifest := $(intermediates.COMMON)/AndroidManifest.xml
|
||||
$(full_android_manifest): PRIVATE_LIBS_MANIFESTS := $(my_full_libs_manifest_files)
|
||||
$(full_android_manifest): $(ANDROID_MANIFEST_MERGER_CLASSPATH)
|
||||
$(full_android_manifest) : $(main_android_manifest) $(my_full_libs_manifest_deps)
|
||||
$(full_android_manifest) : $(main_android_manifest) $(my_full_libs_manifest_files)
|
||||
@echo "Merge android manifest files: $@ <-- $< $(PRIVATE_LIBS_MANIFESTS)"
|
||||
@mkdir -p $(dir $@)
|
||||
$(hide) $(ANDROID_MANIFEST_MERGER) --main $< \
|
||||
|
|
|
@ -587,15 +587,19 @@ my_src_aar := $(LOCAL_JETIFIER_OUTPUT_FILE)
|
|||
|
||||
my_src_jar := $(intermediates.COMMON)/aar/classes.jar
|
||||
my_src_proguard_options := $(intermediates.COMMON)/aar/proguard.txt
|
||||
my_src_android_manifest := $(intermediates.COMMON)/aar/AndroidManifest.xml
|
||||
|
||||
$(my_src_jar) : .KATI_IMPLICIT_OUTPUTS := $(my_src_proguard_options)
|
||||
$(my_src_jar) : .KATI_IMPLICIT_OUTPUTS += $(my_src_android_manifest)
|
||||
$(my_src_jar) : $(my_src_aar)
|
||||
$(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) $(dir $@)/res
|
||||
$(hide) unzip -qo -d $(dir $@) $<
|
||||
# Make sure the extracted classes.jar has a new timestamp.
|
||||
$(hide) touch $@
|
||||
# Make sure the proguard file exists and has a new timestamp.
|
||||
# Make sure the proguard and AndroidManifest.xml files exist
|
||||
# and have a new timestamp.
|
||||
$(hide) touch $(dir $@)/proguard.txt
|
||||
$(hide) touch $(dir $@)/AndroidManifest.xml
|
||||
else
|
||||
|
||||
# run Jetifier if needed
|
||||
|
@ -653,7 +657,7 @@ my_res_package := $(intermediates.COMMON)/package-res.apk
|
|||
# We needed only very few PRIVATE variables and aapt2.mk input variables. Reset the unnecessary ones.
|
||||
$(my_res_package): PRIVATE_AAPT2_CFLAGS :=
|
||||
$(my_res_package): PRIVATE_AAPT_FLAGS := --static-lib --no-static-lib-packages --auto-add-overlay
|
||||
$(my_res_package): PRIVATE_ANDROID_MANIFEST := $(intermediates.COMMON)/aar/AndroidManifest.xml
|
||||
$(my_res_package): PRIVATE_ANDROID_MANIFEST := $(my_src_android_manifest)
|
||||
$(my_res_package): PRIVATE_AAPT_INCLUDES := $(framework_res_package_export)
|
||||
$(my_res_package): PRIVATE_SOURCE_INTERMEDIATES_DIR :=
|
||||
$(my_res_package): PRIVATE_PROGUARD_OPTIONS_FILE :=
|
||||
|
@ -663,6 +667,7 @@ $(my_res_package): PRIVATE_PRODUCT_AAPT_CONFIG :=
|
|||
$(my_res_package): PRIVATE_PRODUCT_AAPT_PREF_CONFIG :=
|
||||
$(my_res_package): PRIVATE_TARGET_AAPT_CHARACTERISTICS :=
|
||||
$(my_res_package) : $(framework_res_package_export)
|
||||
$(my_res_package) : $(my_src_android_manifest)
|
||||
|
||||
full_android_manifest :=
|
||||
my_res_resources :=
|
||||
|
|
Loading…
Reference in a new issue