Android.mk revision 95ad49b720f4990d39d05f7e46a5c7bc83afc9d6
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
3595ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files := $(LOCAL_SRC_FILES)
3695ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
3719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library to resolve cyclic dependencies between src and the platform dependent
3819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# implementations
3919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
4019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-base
4119b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 7
4219b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, base)
4319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
4419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
4564bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
4664bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
4719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
4819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
4995ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
5095ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
5119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library that makes direct use of Eclair MR1 APIs
5219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
5319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-eclair-mr1
5419b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 7
5519b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, eclair-mr1)
5619b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-base
5719b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
5819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
5964bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
6064bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
6119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
6219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
6395ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
6495ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
65a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell# A helper sub-library that makes direct use of Honeycomb APIs
66a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powellinclude $(CLEAR_VARS)
67a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_MODULE := android-support-design-honeycomb
68a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_SDK_VERSION := 11
69a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_SRC_FILES := $(call all-java-files-under, honeycomb)
70a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-eclair-mr1
71a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_JAVA_LIBRARIES := android-support-design-res \
72a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell    android-support-v4 \
7364bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
7464bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
75a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powellinclude $(BUILD_STATIC_JAVA_LIBRARY)
76a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell
7795ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
7895ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
79631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes# A helper sub-library that makes direct use of Honeycomb MR1 APIs
80631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banesinclude $(CLEAR_VARS)
81631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_MODULE := android-support-design-honeycomb-mr1
82631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_SDK_VERSION := 12
83631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_SRC_FILES := $(call all-java-files-under, honeycomb-mr1)
84631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb
85631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
86631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes    android-support-v4 \
8764bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
8864bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
89631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
90631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes
9195ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
9295ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
939ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes# A helper sub-library that makes direct use of ICS APIs
949ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banesinclude $(CLEAR_VARS)
959ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_MODULE := android-support-design-ics
969ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_SDK_VERSION := 14
979ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, ics)
989ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb-mr1
999ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
1009ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v4 \
1019ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v7-appcompat \
1029ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v7-recyclerview
1039ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
1049ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes
10595ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
10695ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
10719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library that makes direct use of Lollipop APIs
10819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
10919b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-lollipop
11019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 21
11119b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, lollipop)
1129ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-ics
11319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
11419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
11564bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
11664bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
11719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
11819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
11995ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
12095ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
12119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Here is the final static library that apps can link against.
12219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# The R class is automatically excluded from the generated library.
12319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Applications that use this library must specify LOCAL_RESOURCE_DIR
12419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# in their makefiles to include the resources in their package.
12519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
12619b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design
12719b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := current
12819b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, src)
12919b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-lollipop
13019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAVA_LIBRARIES := android-support-design-res \
13119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
13264bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
13364bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
13419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
13527238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes
13695ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
13795ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
13827238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes# API Check
13927238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes# ---------------------------------------------
14027238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module := $(LOCAL_MODULE)
14127238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_api_dir := $(LOCAL_PATH)/api
14227238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
143639640523bdb81cc5a2ac2a1ebbe0c4e13a2c82bChris Banessupport_module_java_packages := android.support.design.*
14427238d142f178f9dc071f4bd8e1e7195231b5957Chris Banesinclude $(SUPPORT_API_CHECK)
145