summaryrefslogtreecommitdiff
path: root/library/common-eclair-mr1.mk
diff options
context:
space:
mode:
Diffstat (limited to 'library/common-eclair-mr1.mk')
-rw-r--r--library/common-eclair-mr1.mk26
1 files changed, 23 insertions, 3 deletions
diff --git a/library/common-eclair-mr1.mk b/library/common-eclair-mr1.mk
index 106ebea..e641d16 100644
--- a/library/common-eclair-mr1.mk
+++ b/library/common-eclair-mr1.mk
@@ -12,10 +12,30 @@
# include frameworks/opt/setupwizard/library/common-eclair-mr1.mk
#
+# 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-eclair-mr1-compat,$(LOCAL_STATIC_JAVA_LIBRARIES)))
LOCAL_RESOURCE_DIR += \
$(call my-dir)/main/res \
$(call my-dir)/eclair-mr1/res
-LOCAL_AAPT_FLAGS += --auto-add-overlay \
- --extra-packages com.android.setupwizardlib \
- --extra-packages android.support.v7.appcompat
+LOCAL_AAPT_FLAGS += --extra-packages com.android.setupwizardlib
LOCAL_STATIC_JAVA_LIBRARIES += setup-wizard-lib-eclair-mr1-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 += frameworks/support/v7/appcompat/res
+LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat
+LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
+endif