Ying Wang | dc7fee9 | 2014-02-05 18:24:45 -0800 | [diff] [blame] | 1 | # Handle AndroidManifest.xmls |
| 2 | # Input: LOCAL_MANIFEST_FILE, LOCAL_FULL_MANIFEST_FILE, LOCAL_FULL_LIBS_MANIFEST_FILES |
| 3 | # Output: full_android_manifest |
| 4 | |
| 5 | ifeq ($(strip $(LOCAL_MANIFEST_FILE)),) |
| 6 | LOCAL_MANIFEST_FILE := AndroidManifest.xml |
| 7 | endif |
| 8 | ifdef LOCAL_FULL_MANIFEST_FILE |
| 9 | full_android_manifest := $(LOCAL_FULL_MANIFEST_FILE) |
| 10 | else |
| 11 | full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE) |
| 12 | endif |
| 13 | |
| 14 | # Set up rules to merge library manifest files |
| 15 | ifdef LOCAL_FULL_LIBS_MANIFEST_FILES |
| 16 | main_android_manifest := $(full_android_manifest) |
| 17 | full_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 | |
| 25 | endif |