Android.mk revision 9ec922c215ed95a4bbd8bd7940e81dcfe6926893
119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Copyright (C) 2015 The Android Open Source Project
219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes#
319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Licensed under the Apache License, Version 2.0 (the "License");
419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# you may not use this file except in compliance with the License.
519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# You may obtain a copy of the License at
619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes#
719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes#      http://www.apache.org/licenses/LICENSE-2.0
819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes#
919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Unless required by applicable law or agreed to in writing, software
1019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# distributed under the License is distributed on an "AS IS" BASIS,
1119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# See the License for the specific language governing permissions and
1319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# limitations under the License.
1419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
1519b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_PATH := $(call my-dir)
1619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
1719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Build the resources using the current SDK version.
1819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# We do this here because the final static library must be compiled with an older
1919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# SDK version than the resources.  The resources library and the R class that it
2019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# contains will not be linked into the final static library.
2119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
2219b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-res
2319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := current
2419b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, dummy)
2519b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
2664bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    frameworks/support/v7/appcompat/res \
2764bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    frameworks/support/v7/recyclerview/res
2819b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_AAPT_FLAGS := \
2919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    --auto-add-overlay \
3064bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    --extra-packages android.support.v7.appcompat \
3164bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    --extra-packages android.support.v7.recyclerview
3219b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAR_EXCLUDE_FILES := none
3319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
3419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
3519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library to resolve cyclic dependencies between src and the platform dependent
3619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# implementations
3719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
3819b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-base
3919b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 7
4019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, base)
4119b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
4219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
4364bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
4464bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
4519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
4619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
4719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library that makes direct use of Eclair MR1 APIs
4819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
4919b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-eclair-mr1
5019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 7
5119b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, eclair-mr1)
5219b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-base
5319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
5419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
5564bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
5664bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
5719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
5819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
59a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell# A helper sub-library that makes direct use of Honeycomb APIs
60a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powellinclude $(CLEAR_VARS)
61a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_MODULE := android-support-design-honeycomb
62a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_SDK_VERSION := 11
63a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_SRC_FILES := $(call all-java-files-under, honeycomb)
64a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-eclair-mr1
65a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_JAVA_LIBRARIES := android-support-design-res \
66a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell    android-support-v4 \
6764bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
6864bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
69a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powellinclude $(BUILD_STATIC_JAVA_LIBRARY)
70a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell
71631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes# A helper sub-library that makes direct use of Honeycomb MR1 APIs
72631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banesinclude $(CLEAR_VARS)
73631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_MODULE := android-support-design-honeycomb-mr1
74631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_SDK_VERSION := 12
75631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_SRC_FILES := $(call all-java-files-under, honeycomb-mr1)
76631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb
77631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
78631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes    android-support-v4 \
7964bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
8064bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
81631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
82631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes
839ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes# A helper sub-library that makes direct use of ICS APIs
849ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banesinclude $(CLEAR_VARS)
859ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_MODULE := android-support-design-ics
869ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_SDK_VERSION := 14
879ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, ics)
889ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb-mr1
899ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
909ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v4 \
919ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v7-appcompat \
929ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v7-recyclerview
939ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
949ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes
9519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library that makes direct use of Lollipop APIs
9619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
9719b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-lollipop
9819b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 21
9919b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, lollipop)
1009ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-ics
10119b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
10219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
10364bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
10464bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
10519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
10619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
10719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Here is the final static library that apps can link against.
10819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# The R class is automatically excluded from the generated library.
10919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Applications that use this library must specify LOCAL_RESOURCE_DIR
11019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# in their makefiles to include the resources in their package.
11119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
11219b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design
11319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := current
11419b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, src)
11519b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-lollipop
11619b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
11719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
11864bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
11964bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
12019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
12127238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes
12227238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes# API Check
12327238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes# ---------------------------------------------
12427238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module := $(LOCAL_MODULE)
12527238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_api_dir := $(LOCAL_PATH)/api
12627238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_src_files := $(LOCAL_SRC_FILES)
12727238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
128639640523bdb81cc5a2ac2a1ebbe0c4e13a2c82bChris Banessupport_module_java_packages := android.support.design.*
12927238d142f178f9dc071f4bd8e1e7195231b5957Chris Banesinclude $(SUPPORT_API_CHECK)
130