AAPT2: library resource compilation

- Switch to static library's package-res.apk as the link artifact.
- For prebuilt AAR file, build package-res.apk using aapt2's "--dir"
  option.
- New LOCAL variables:
  LOCAL_USE_AAPT2: a module can opt-in with "LOCAL_USE_AAPT2 := true".
  LOCAL_STATIC_ANDROID_LIBRARIES: static Java libraries with compiled
                   resources.
  LOCAL_SHARED_ANDROID_LIBRARIES: shared Java libraries with compiled
                   resources.

Bug: 25958912
Change-Id: I4be2d1e8137555986338c2583cb39b0c97391751
This commit is contained in:
Ying Wang
2016-02-24 14:11:55 -08:00
committed by Adam Lesinski
parent 6519b90bac
commit e295c3df68
9 changed files with 90 additions and 77 deletions

View File

@@ -57,10 +57,12 @@ else
endif
endif
# LOCAL_STATIC_JAVA_AAR_LIBRARIES are special LOCAL_STATIC_JAVA_LIBRARIES
LOCAL_STATIC_JAVA_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_LIBRARIES) $(LOCAL_STATIC_JAVA_AAR_LIBRARIES))
LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES))
# LOCAL_STATIC_JAVA_AAR_LIBRARIES and LOCAL_STATIC_ANDROID_LIBRARIES are also LOCAL_STATIC_JAVA_LIBRARIES.
LOCAL_STATIC_JAVA_LIBRARIES := $(strip $(LOCAL_STATIC_JAVA_LIBRARIES) \
$(LOCAL_STATIC_JAVA_AAR_LIBRARIES) \
$(LOCAL_STATIC_ANDROID_LIBRARIES))
# LOCAL_SHARED_ANDROID_LIBRARIES are also LOCAL_JAVA_LIBRARIES.
LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES) $(LOCAL_SHARED_ANDROID_LIBRARIES))
LOCAL_BUILT_MODULE_STEM := $(strip $(LOCAL_BUILT_MODULE_STEM))
ifeq ($(LOCAL_BUILT_MODULE_STEM),)