2014-02-06 10:24:45 +08:00
|
|
|
# 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
|
|
|
|
|
2014-10-30 06:48:32 +08:00
|
|
|
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
|
2015-05-28 06:14:28 +08:00
|
|
|
LOCAL_STATIC_JAVA_AAR_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_AAR_LIBRARIES))
|
2014-10-30 06:48:32 +08:00
|
|
|
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)
|
|
|
|
|
2016-02-25 06:11:55 +08:00
|
|
|
# With aapt2, we'll link in the built resource from the AAR.
|
|
|
|
ifndef LOCAL_USE_AAPT2
|
2014-10-30 06:48:32 +08:00
|
|
|
LOCAL_RESOURCE_DIR += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\
|
|
|
|
$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/res)
|
2016-02-25 06:11:55 +08:00
|
|
|
endif # LOCAL_USE_AAPT2
|
2015-12-05 05:59:18 +08:00
|
|
|
endif # LOCAL_STATIC_JAVA_AAR_LIBRARIES
|
2014-10-30 06:48:32 +08:00
|
|
|
|
2014-02-06 10:24:45 +08:00
|
|
|
# Set up rules to merge library manifest files
|
2014-10-30 06:48:32 +08:00
|
|
|
ifdef my_full_libs_manifest_files
|
2014-02-06 10:24:45 +08:00
|
|
|
main_android_manifest := $(full_android_manifest)
|
|
|
|
full_android_manifest := $(intermediates.COMMON)/AndroidManifest.xml
|
2014-10-30 06:48:32 +08:00
|
|
|
$(full_android_manifest): PRIVATE_LIBS_MANIFESTS := $(my_full_libs_manifest_files)
|
|
|
|
$(full_android_manifest) : $(main_android_manifest) $(my_full_libs_manifest_deps)
|
|
|
|
@echo "Merge android manifest files: $@ <-- $< $(PRIVATE_LIBS_MANIFESTS)"
|
2014-02-06 10:24:45 +08:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) $(ANDROID_MANIFEST_MERGER) --main $< --libs $(PRIVATE_LIBS_MANIFESTS) \
|
|
|
|
--out $@
|
|
|
|
|
|
|
|
endif
|