1 # Handle AndroidManifest.xmls
2 # Input: LOCAL_MANIFEST_FILE, LOCAL_FULL_MANIFEST_FILE, LOCAL_FULL_LIBS_MANIFEST_FILES
3 # Output: full_android_manifest
5 ifeq ($(strip $(LOCAL_MANIFEST_FILE)),)
6 LOCAL_MANIFEST_FILE := AndroidManifest.xml
8 ifdef LOCAL_FULL_MANIFEST_FILE
9 full_android_manifest := $(LOCAL_FULL_MANIFEST_FILE)
11 full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE)
14 my_full_libs_manifest_files := $(LOCAL_FULL_LIBS_MANIFEST_FILES)
15 my_full_libs_manifest_deps := $(LOCAL_FULL_LIBS_MANIFEST_FILES)
17 # Set up dependency on aar libraries
18 LOCAL_STATIC_JAVA_AAR_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_AAR_LIBRARIES))
19 ifdef LOCAL_STATIC_JAVA_AAR_LIBRARIES
20 my_full_libs_manifest_deps += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
21 $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/classes.jar)
22 my_full_libs_manifest_files += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
23 $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/AndroidManifest.xml)
25 LOCAL_RESOURCE_DIR += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
26 $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/res)
29 # Set up rules to merge library manifest files
30 ifdef my_full_libs_manifest_files
31 main_android_manifest := $(full_android_manifest)
32 full_android_manifest := $(intermediates.COMMON)/AndroidManifest.xml
33 $(full_android_manifest): PRIVATE_LIBS_MANIFESTS := $(my_full_libs_manifest_files)
34 $(full_android_manifest) : $(main_android_manifest) $(my_full_libs_manifest_deps)
35 @echo "Merge android manifest files: $@ <-- $< $(PRIVATE_LIBS_MANIFESTS)"
37 $(hide) $(ANDROID_MANIFEST_MERGER) --main $< --libs $(PRIVATE_LIBS_MANIFESTS) \