1# Handle AndroidManifest.xmls 2# Input: LOCAL_MANIFEST_FILE, LOCAL_FULL_MANIFEST_FILE, LOCAL_FULL_LIBS_MANIFEST_FILES 3# Output: full_android_manifest 4 5ifeq ($(strip $(LOCAL_MANIFEST_FILE)),) 6 LOCAL_MANIFEST_FILE := AndroidManifest.xml 7endif 8ifdef LOCAL_FULL_MANIFEST_FILE 9 full_android_manifest := $(LOCAL_FULL_MANIFEST_FILE) 10else 11 full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE) 12endif 13 14# Set up rules to merge library manifest files 15ifdef LOCAL_FULL_LIBS_MANIFEST_FILES 16main_android_manifest := $(full_android_manifest) 17full_android_manifest := $(intermediates.COMMON)/AndroidManifest.xml 18$(full_android_manifest): PRIVATE_LIBS_MANIFESTS := $(LOCAL_FULL_LIBS_MANIFEST_FILES) 19$(full_android_manifest) : $(main_android_manifest) $(LOCAL_FULL_LIBS_MANIFEST_FILES) 20 @echo "Merge android manifest files: $@ <-- $^" 21 @mkdir -p $(dir $@) 22 $(hide) $(ANDROID_MANIFEST_MERGER) --main $< --libs $(PRIVATE_LIBS_MANIFESTS) \ 23 --out $@ 24 25endif 26