Migrate to AAPT2
am: 878bae4e32
Change-Id: I21b8150ef5f47a5ea1414162fc6874c6f1a6cc63
This commit is contained in:
commit
0cb8671d3a
|
@ -26,11 +26,9 @@ include $(BUILD_STATIC_JAVA_LIBRARY)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
ifeq ($(TARGET_BUILD_APPS),)
|
|
||||||
# Use AAPT2 only when TARGET_BUILD_APPS is empty because AAPT2 is not compatible with the current
|
|
||||||
# setup of prebuilt support libs used in unbundled builds. b/29836407
|
|
||||||
LOCAL_USE_AAPT2 := true
|
LOCAL_USE_AAPT2 := true
|
||||||
endif
|
|
||||||
|
LOCAL_AAPT2_ONLY := true
|
||||||
|
|
||||||
LOCAL_MANIFEST_FILE := main/AndroidManifest.xml
|
LOCAL_MANIFEST_FILE := main/AndroidManifest.xml
|
||||||
LOCAL_MODULE := setup-wizard-lib-gingerbread-compat
|
LOCAL_MODULE := setup-wizard-lib-gingerbread-compat
|
||||||
|
@ -41,8 +39,6 @@ LOCAL_RESOURCE_DIR := \
|
||||||
LOCAL_SDK_VERSION := current
|
LOCAL_SDK_VERSION := current
|
||||||
LOCAL_SRC_FILES := $(call all-java-files-under, main/src gingerbread/src recyclerview/src)
|
LOCAL_SRC_FILES := $(call all-java-files-under, main/src gingerbread/src recyclerview/src)
|
||||||
|
|
||||||
ifdef LOCAL_USE_AAPT2
|
|
||||||
|
|
||||||
LOCAL_JAVA_LIBRARIES := \
|
LOCAL_JAVA_LIBRARIES := \
|
||||||
android-support-annotations
|
android-support-annotations
|
||||||
|
|
||||||
|
@ -52,25 +48,4 @@ LOCAL_SHARED_ANDROID_LIBRARIES := \
|
||||||
android-support-v7-appcompat \
|
android-support-v7-appcompat \
|
||||||
android-support-v7-recyclerview
|
android-support-v7-recyclerview
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
LOCAL_AAPT_FLAGS := --auto-add-overlay \
|
|
||||||
--extra-packages android.support.compat \
|
|
||||||
--extra-packages android.support.v7.appcompat \
|
|
||||||
--extra-packages android.support.v7.recyclerview
|
|
||||||
|
|
||||||
LOCAL_RESOURCE_DIR += \
|
|
||||||
prebuilts/sdk/current/supportcompat/res \
|
|
||||||
prebuilts/sdk/current/supportv7/appcompat/res \
|
|
||||||
prebuilts/sdk/current/supportv7/recyclerview/res
|
|
||||||
|
|
||||||
LOCAL_JAVA_LIBRARIES := \
|
|
||||||
android-support-annotations \
|
|
||||||
android-support-compat \
|
|
||||||
android-support-core-ui \
|
|
||||||
android-support-v7-appcompat \
|
|
||||||
android-support-v7-recyclerview
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
include $(BUILD_STATIC_JAVA_LIBRARY)
|
||||||
|
|
|
@ -15,46 +15,6 @@
|
||||||
# Path to directory of setup wizard lib (e.g. frameworks/opt/setupwizard/library)
|
# Path to directory of setup wizard lib (e.g. frameworks/opt/setupwizard/library)
|
||||||
suwlib_dir := $(dir $(lastword $(MAKEFILE_LIST)))
|
suwlib_dir := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||||
|
|
||||||
ifneq ($(LOCAL_USE_AAPT2),true)
|
|
||||||
|
|
||||||
# Check that LOCAL_RESOURCE_DIR is defined
|
|
||||||
ifeq (,$(LOCAL_RESOURCE_DIR))
|
|
||||||
$(error LOCAL_RESOURCE_DIR must be defined)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Add --auto-add-overlay flag if not present
|
|
||||||
ifeq (,$(findstring --auto-add-overlay, $(LOCAL_AAPT_FLAGS)))
|
|
||||||
LOCAL_AAPT_FLAGS += --auto-add-overlay
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Include setup wizard library, if not already included
|
|
||||||
ifeq (,$(findstring setup-wizard-lib-gingerbread-compat,$(LOCAL_STATIC_JAVA_LIBRARIES)))
|
|
||||||
LOCAL_RESOURCE_DIR += \
|
|
||||||
$(suwlib_dir)/main/res \
|
|
||||||
$(suwlib_dir)/gingerbread/res \
|
|
||||||
$(suwlib_dir)/recyclerview/res
|
|
||||||
LOCAL_AAPT_FLAGS += --extra-packages com.android.setupwizardlib
|
|
||||||
LOCAL_STATIC_JAVA_LIBRARIES += setup-wizard-lib-gingerbread-compat
|
|
||||||
endif
|
|
||||||
|
|
||||||
## Include transitive dependencies below
|
|
||||||
|
|
||||||
# Include support-v7-appcompat, if not already included
|
|
||||||
ifeq (,$(findstring android-support-v7-appcompat,$(LOCAL_STATIC_JAVA_LIBRARIES)))
|
|
||||||
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/appcompat/res
|
|
||||||
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat
|
|
||||||
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Include support-v7-recyclerview, if not already included
|
|
||||||
ifeq (,$(findstring android-support-v7-recyclerview,$(LOCAL_STATIC_JAVA_LIBRARIES)))
|
|
||||||
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/recyclerview/res
|
|
||||||
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.recyclerview
|
|
||||||
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview
|
|
||||||
endif
|
|
||||||
|
|
||||||
else # LOCAL_USE_AAPT2 := true
|
|
||||||
|
|
||||||
ifeq (,$(findstring setup-wizard-lib-gingerbread-compat,$(LOCAL_STATIC_ANDROID_LIBRARIES)))
|
ifeq (,$(findstring setup-wizard-lib-gingerbread-compat,$(LOCAL_STATIC_ANDROID_LIBRARIES)))
|
||||||
LOCAL_STATIC_ANDROID_LIBRARIES += setup-wizard-lib-gingerbread-compat
|
LOCAL_STATIC_ANDROID_LIBRARIES += setup-wizard-lib-gingerbread-compat
|
||||||
endif
|
endif
|
||||||
|
@ -66,5 +26,3 @@ endif
|
||||||
ifeq (,$(findstring android-support-v7-recyclerview,$(LOCAL_STATIC_ANDROID_LIBRARIES)))
|
ifeq (,$(findstring android-support-v7-recyclerview,$(LOCAL_STATIC_ANDROID_LIBRARIES)))
|
||||||
LOCAL_STATIC_ANDROID_LIBRARIES += android-support-v7-recyclerview
|
LOCAL_STATIC_ANDROID_LIBRARIES += android-support-v7-recyclerview
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif # LOCAL_USE_AAPT2
|
|
||||||
|
|
Loading…
Reference in a new issue