Home | History | Annotate | Download | only in library
      1 #
      2 # Include this make file to build your application against this module.
      3 #
      4 # Make sure to include it after you've set all your desired LOCAL variables.
      5 # Note that you must explicitly set your LOCAL_RESOURCE_DIR before including this file.
      6 #
      7 # For example:
      8 #
      9 #   LOCAL_RESOURCE_DIR := \
     10 #        $(LOCAL_PATH)/res
     11 #
     12 #   include frameworks/opt/setupwizard/library/common-gingerbread.mk
     13 #
     14 
     15 # Path to directory of setup wizard lib (e.g. frameworks/opt/setupwizard/library)
     16 suwlib_dir := $(dir $(lastword $(MAKEFILE_LIST)))
     17 
     18 ifneq ($(LOCAL_USE_AAPT2),true)
     19 
     20 # Check that LOCAL_RESOURCE_DIR is defined
     21 ifeq (,$(LOCAL_RESOURCE_DIR))
     22 $(error LOCAL_RESOURCE_DIR must be defined)
     23 endif
     24 
     25 # Add --auto-add-overlay flag if not present
     26 ifeq (,$(findstring --auto-add-overlay, $(LOCAL_AAPT_FLAGS)))
     27 LOCAL_AAPT_FLAGS += --auto-add-overlay
     28 endif
     29 
     30 # Include setup wizard library, if not already included
     31 ifeq (,$(findstring setup-wizard-lib-gingerbread-compat,$(LOCAL_STATIC_JAVA_LIBRARIES)))
     32 LOCAL_RESOURCE_DIR += \
     33     $(suwlib_dir)/main/res \
     34     $(suwlib_dir)/gingerbread/res \
     35     $(suwlib_dir)/recyclerview/res
     36 LOCAL_AAPT_FLAGS += --extra-packages com.android.setupwizardlib
     37 LOCAL_STATIC_JAVA_LIBRARIES += setup-wizard-lib-gingerbread-compat
     38 endif
     39 
     40 ## Include transitive dependencies below
     41 
     42 # Include support-v7-appcompat, if not already included
     43 ifeq (,$(findstring android-support-v7-appcompat,$(LOCAL_STATIC_JAVA_LIBRARIES)))
     44 LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res
     45 LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat
     46 LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
     47 endif
     48 
     49 # Include support-v7-recyclerview, if not already included
     50 ifeq (,$(findstring android-support-v7-recyclerview,$(LOCAL_STATIC_JAVA_LIBRARIES)))
     51 LOCAL_RESOURCE_DIR += frameworks/support/v7/recyclerview/res
     52 LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.recyclerview
     53 LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview
     54 endif
     55 
     56 else # LOCAL_USE_AAPT2 := true
     57 
     58 ifeq (,$(findstring setup-wizard-lib-gingerbread-compat,$(LOCAL_STATIC_ANDROID_LIBRARIES)))
     59   LOCAL_STATIC_ANDROID_LIBRARIES += setup-wizard-lib-gingerbread-compat
     60 endif
     61 
     62 ifeq (,$(findstring android-support-v7-appcompat,$(LOCAL_STATIC_ANDROID_LIBRARIES)))
     63   LOCAL_STATIC_ANDROID_LIBRARIES += android-support-v7-appcompat
     64 endif
     65 
     66 ifeq (,$(findstring android-support-v7-recyclerview,$(LOCAL_STATIC_ANDROID_LIBRARIES)))
     67   LOCAL_STATIC_ANDROID_LIBRARIES += android-support-v7-recyclerview
     68 endif
     69 
     70 endif # LOCAL_USE_AAPT2
     71