1#
2# Copyright (C) 2016 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17#
18# Include this file to utilize the car-stream-ui-lib's resources and files.
19#
20# Make sure to include it after you've set all your desired LOCAL variables.
21# Note that you must explicitly set your LOCAL_RESOURCE_DIR before including this file.
22#
23# For example:
24#
25#   LOCAL_RESOURCE_DIR := \
26#        $(LOCAL_PATH)/res
27#
28#   include packages/apps/Car/libs/car-stream-ui-lib/car-stream-ui-lib.mk
29#
30
31# Check that LOCAL_RESOURCE_DIR is defined
32ifeq (,$(LOCAL_RESOURCE_DIR))
33$(error LOCAL_RESOURCE_DIR must be defined)
34endif
35
36# Include support-v7-cardview, if not already included
37ifeq (,$(findstring android-support-v7-cardview,$(LOCAL_STATIC_JAVA_LIBRARIES)))
38LOCAL_RESOURCE_DIR += frameworks/support/v7/cardview/res
39LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.cardview
40LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-cardview
41endif
42# Include support-v7-appcompat, if not already included
43ifeq (,$(findstring android-support-v7-appcompat,$(LOCAL_STATIC_JAVA_LIBRARIES)))
44LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res
45LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat
46LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
47endif
48LOCAL_JAVA_LIBRARIES += android.car
49
50# Include car-stream-ui-lib
51ifeq (,$(findstring android.support.car, $(LOCAL_STATIC_JAVA_LIBRARIES)))
52LOCAL_RESOURCE_DIR += \
53    packages/apps/Car/libs/car-stream-ui-lib/res
54LOCAL_AAPT_FLAGS += --extra-packages com.android.car.stream.ui
55LOCAL_STATIC_JAVA_LIBRARIES += car-stream-ui-lib
56endif
57