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 \
2619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    frameworks/support/v7/appcompat/res
2719b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_AAPT_FLAGS := \
2819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    --auto-add-overlay \
2919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    --extra-packages android.support.v7.appcompat
3019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAR_EXCLUDE_FILES := none
3119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
3219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
3319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library to resolve cyclic dependencies between src and the platform dependent
3419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# implementations
3519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
3619b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-base
3719b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 7
3819b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, base)
3919b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
4019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
4119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v7-appcompat
4219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
4319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
4419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library that makes direct use of Eclair MR1 APIs
4519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
4619b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-eclair-mr1
4719b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 7
4819b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, eclair-mr1)
4919b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-base
5019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
5119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
5219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v7-appcompat
5319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
5419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
55a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell# A helper sub-library that makes direct use of Honeycomb APIs
56a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powellinclude $(CLEAR_VARS)
57a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_MODULE := android-support-design-honeycomb
58a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_SDK_VERSION := 11
59a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_SRC_FILES := $(call all-java-files-under, honeycomb)
60a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-eclair-mr1
61a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_JAVA_LIBRARIES := android-support-design-res \
62a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell    android-support-v4 \
63a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell    android-support-v7-appcompat
64a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powellinclude $(BUILD_STATIC_JAVA_LIBRARY)
65a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell
66631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes# A helper sub-library that makes direct use of Honeycomb MR1 APIs
67631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banesinclude $(CLEAR_VARS)
68631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_MODULE := android-support-design-honeycomb-mr1
69631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_SDK_VERSION := 12
70631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_SRC_FILES := $(call all-java-files-under, honeycomb-mr1)
71631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb
72631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
73631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes    android-support-v4 \
74631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes    android-support-v7-appcompat
75631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
76631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes
7719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library that makes direct use of Lollipop APIs
7819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
7919b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-lollipop
8019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 21
8119b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, lollipop)
82631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb-mr1
8319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
8419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
8519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v7-appcompat
8619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
8719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
8819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Here is the final static library that apps can link against.
8919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# The R class is automatically excluded from the generated library.
9019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Applications that use this library must specify LOCAL_RESOURCE_DIR
9119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# in their makefiles to include the resources in their package.
9219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
9319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design
9419b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := current
9519b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, src)
9619b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-lollipop
9719b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
9819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
9919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v7-appcompat
10019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
10127238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes
10227238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes# API Check
10327238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes# ---------------------------------------------
10427238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module := $(LOCAL_MODULE)
10527238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_api_dir := $(LOCAL_PATH)/api
10627238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_src_files := $(LOCAL_SRC_FILES)
10727238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
108639640523bdb81cc5a2ac2a1ebbe0c4e13a2c82bChris Banessupport_module_java_packages := android.support.design.*
10927238d142f178f9dc071f4bd8e1e7195231b5957Chris Banesinclude $(SUPPORT_API_CHECK)
110