blob: 081d6a68526b948d0cdec22c647cf60d89a28535 [file] [log] [blame]
Yao Chene2de1d52015-11-09 13:50:26 -08001#
keunyoung24bfc0e2015-11-16 10:33:15 -08002# Include this make file to build your application with car friendly UI.
Yao Chene2de1d52015-11-09 13:50:26 -08003#
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#
Keun-young Parke54ac272016-02-16 19:02:18 -080012# include packages/services/Car/car-support-lib/car-support.mk
Yao Chene2de1d52015-11-09 13:50:26 -080013#
14
15# Check that LOCAL_RESOURCE_DIR is defined
16ifeq (,$(LOCAL_RESOURCE_DIR))
17$(error LOCAL_RESOURCE_DIR must be defined)
18endif
19
20# Add --auto-add-overlay flag if not present
21ifeq (,$(findstring --auto-add-overlay, $(LOCAL_AAPT_FLAGS)))
22LOCAL_AAPT_FLAGS += --auto-add-overlay
23endif
24
25# Include car ui library, if not already included
Yao Chen5d8b9042016-04-13 11:56:15 -070026ifeq (,$(findstring android.support.car, $(LOCAL_STATIC_JAVA_LIBRARIES)))
Yao Chene2de1d52015-11-09 13:50:26 -080027LOCAL_RESOURCE_DIR += \
Keun-young Parke54ac272016-02-16 19:02:18 -080028 packages/services/Car/car-support-lib/res
Yao Chene2de1d52015-11-09 13:50:26 -080029LOCAL_AAPT_FLAGS += --extra-packages android.support.car.ui
Keun-young Parke54ac272016-02-16 19:02:18 -080030LOCAL_STATIC_JAVA_LIBRARIES += android.support.car
Yao Chene2de1d52015-11-09 13:50:26 -080031endif
32
33## Include transitive dependencies below
34
35# Include support-v7-appcompat, if not already included
36ifeq (,$(findstring android-support-v7-appcompat,$(LOCAL_STATIC_JAVA_LIBRARIES)))
37LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res
38LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat
39LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
40endif
41
42# Include support-v7-recyclerview, if not already included
43ifeq (,$(findstring android-support-v7-recyclerview,$(LOCAL_STATIC_JAVA_LIBRARIES)))
44LOCAL_RESOURCE_DIR += frameworks/support/v7/recyclerview/res
45LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.recyclerview
46LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview
47endif
48
49# Include support-v7-cardview, if not already included
50ifeq (,$(findstring android-support-v7-cardview,$(LOCAL_STATIC_JAVA_LIBRARIES)))
51LOCAL_RESOURCE_DIR += frameworks/support/v7/cardview/res
52LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.cardview
53LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-cardview
54endif
Keun-young Parke54ac272016-02-16 19:02:18 -080055LOCAL_JAVA_LIBRARIES += android.car
56