summaryrefslogtreecommitdiffstats
path: root/core/android_manifest.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-02-05 18:24:45 -0800
committerYing Wang <wangying@google.com>2014-02-05 18:24:45 -0800
commitdc7fee9fbf46ac06c840c7edfd51fbefeece63e4 (patch)
tree5e9baa9a3586e3c573aa2d9cf0bc9d524872fb91 /core/android_manifest.mk
parent7b734fd8d163f7a71254b909fbbcd358129924b7 (diff)
downloadbuild-dc7fee9fbf46ac06c840c7edfd51fbefeece63e4.zip
build-dc7fee9fbf46ac06c840c7edfd51fbefeece63e4.tar.gz
build-dc7fee9fbf46ac06c840c7edfd51fbefeece63e4.tar.bz2
Set up rules to merge AndroidManifest.xmls
Now you can merge the library manifest files to the main app's AndroidManifest.xml with LOCAL_FULL_LIBS_MANIFEST_FILES. LOCAL_FULL_LIBS_MANIFEST_FILES is a list of paths relative to the top of the source tree. Bug: 12907528 Change-Id: I16a347c83dfb6fbbb7d5d40284b7c65aa682fdd2
Diffstat (limited to 'core/android_manifest.mk')
-rw-r--r--core/android_manifest.mk25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/android_manifest.mk b/core/android_manifest.mk
new file mode 100644
index 0000000..21b95c2
--- /dev/null
+++ b/core/android_manifest.mk
@@ -0,0 +1,25 @@
+# Handle AndroidManifest.xmls
+# Input: LOCAL_MANIFEST_FILE, LOCAL_FULL_MANIFEST_FILE, LOCAL_FULL_LIBS_MANIFEST_FILES
+# Output: full_android_manifest
+
+ifeq ($(strip $(LOCAL_MANIFEST_FILE)),)
+ LOCAL_MANIFEST_FILE := AndroidManifest.xml
+endif
+ifdef LOCAL_FULL_MANIFEST_FILE
+ full_android_manifest := $(LOCAL_FULL_MANIFEST_FILE)
+else
+ full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE)
+endif
+
+# Set up rules to merge library manifest files
+ifdef LOCAL_FULL_LIBS_MANIFEST_FILES
+main_android_manifest := $(full_android_manifest)
+full_android_manifest := $(intermediates.COMMON)/AndroidManifest.xml
+$(full_android_manifest): PRIVATE_LIBS_MANIFESTS := $(LOCAL_FULL_LIBS_MANIFEST_FILES)
+$(full_android_manifest) : $(main_android_manifest) $(LOCAL_FULL_LIBS_MANIFEST_FILES)
+ @echo "Merge android manifest files: $@ <-- $^"
+ @mkdir -p $(dir $@)
+ $(hide) $(ANDROID_MANIFEST_MERGER) --main $< --libs $(PRIVATE_LIBS_MANIFESTS) \
+ --out $@
+
+endif