diff options
author | Ying Wang <wangying@google.com> | 2014-10-29 15:48:32 -0700 |
---|---|---|
committer | Ying Wang <wangying@google.com> | 2014-10-29 23:40:52 +0000 |
commit | f56729250448200834c5c95c86c937e887d73623 (patch) | |
tree | 6f015fdb97441180dae69a6b3e88c6f64b091a00 /core/android_manifest.mk | |
parent | c9594afa930e5400d35bbf24a17cb9be8d978888 (diff) | |
download | build-f56729250448200834c5c95c86c937e887d73623.zip build-f56729250448200834c5c95c86c937e887d73623.tar.gz build-f56729250448200834c5c95c86c937e887d73623.tar.bz2 |
Add support for prebuilt AARs.
- You can give a .aar as source file to a prebuilt static Java library
module. The build system will set up dependencies and rules to extract
classes.jar and other resource files.
- To build against a prebuilt AAR module, use:
LOCAL_STATIC_JAVA_AAR_LIBRARIES := <module names of aar prebuilt AARs>
The build system will set up rules to merge the library's
AndroidManifest.xml with the main AndroidManifest.xml, add the AAR's
resource dirs and link/merge the AAR's classes.jar.
Bug: 18168693
Change-Id: I478913d5d498f800b322529d7c2c2c0ea78425e5
Diffstat (limited to 'core/android_manifest.mk')
-rw-r--r-- | core/android_manifest.mk | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/core/android_manifest.mk b/core/android_manifest.mk index 21b95c2..c641b75 100644 --- a/core/android_manifest.mk +++ b/core/android_manifest.mk @@ -11,13 +11,27 @@ else full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE) endif +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 +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) + +LOCAL_RESOURCE_DIR += $(foreach lib, $(LOCAL_STATIC_JAVA_AAR_LIBRARIES),\ + $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/aar/res) +endif + # Set up rules to merge library manifest files -ifdef LOCAL_FULL_LIBS_MANIFEST_FILES +ifdef my_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: $@ <-- $^" +$(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)" @mkdir -p $(dir $@) $(hide) $(ANDROID_MANIFEST_MERGER) --main $< --libs $(PRIVATE_LIBS_MANIFESTS) \ --out $@ |