Android.mk revision 529cd2167c1db38f878d476b455bf61097378ba8
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
176759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski# Android libraries referenced by this module's resources.
186759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinskiresource_libs := \
196759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski    android-support-v7-appcompat \
206759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski    android-support-v7-recyclerview
216759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski
2282b55491586ac50a0f95b60e39a3c18d068941cfChris Banes# Build the resources using the latest applicable SDK version.
2319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# We do this here because the final static library must be compiled with an older
2419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# SDK version than the resources.  The resources library and the R class that it
2519b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# contains will not be linked into the final static library.
2619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
276759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_USE_AAPT2 := true
2819b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-res
2982b55491586ac50a0f95b60e39a3c18d068941cfChris BanesLOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
3019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, dummy)
316759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
326759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_SHARED_ANDROID_LIBRARIES := $(resource_libs)
336759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_AAPT_FLAGS := --no-version-vectors
3419b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_JAR_EXCLUDE_FILES := none
35e1cd5a1f80010eece43cb4608505fd39f4832c00Neil FullerLOCAL_JAVA_LANGUAGE_VERSION := 1.7
3619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
3719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
3895ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files := $(LOCAL_SRC_FILES)
3995ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
4019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library to resolve cyclic dependencies between src and the platform dependent
4119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# implementations
4219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
4319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-base
44529cd2167c1db38f878d476b455bf61097378ba8Kirill GrouchnikovLOCAL_SDK_VERSION := 9
4519b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, base)
466759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_JAVA_LIBRARIES := \
476759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski    android-support-design-res \
4819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
4964bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
5064bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
51e1cd5a1f80010eece43cb4608505fd39f4832c00Neil FullerLOCAL_JAVA_LANGUAGE_VERSION := 1.7
5219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
5319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
5495ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
5595ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
56f4893cfe0dd5314e8c7835e6c7c3907c8765faf8Kirill Grouchnikov# A helper sub-library that makes direct use of Gingerbread APIs
5719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
58f4893cfe0dd5314e8c7835e6c7c3907c8765faf8Kirill GrouchnikovLOCAL_MODULE := android-support-design-gingerbread
59529cd2167c1db38f878d476b455bf61097378ba8Kirill GrouchnikovLOCAL_SDK_VERSION := 9
60f4893cfe0dd5314e8c7835e6c7c3907c8765faf8Kirill GrouchnikovLOCAL_SRC_FILES := $(call all-java-files-under, gingerbread)
6119b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-base
626759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_JAVA_LIBRARIES := \
636759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski    android-support-design-res \
6419b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
6564bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
6664bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
67e1cd5a1f80010eece43cb4608505fd39f4832c00Neil FullerLOCAL_JAVA_LANGUAGE_VERSION := 1.7
6819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
6919b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
7095ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
7195ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
72a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell# A helper sub-library that makes direct use of Honeycomb APIs
73a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powellinclude $(CLEAR_VARS)
74a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_MODULE := android-support-design-honeycomb
75a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_SDK_VERSION := 11
76a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam PowellLOCAL_SRC_FILES := $(call all-java-files-under, honeycomb)
77f4893cfe0dd5314e8c7835e6c7c3907c8765faf8Kirill GrouchnikovLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-gingerbread
786759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_JAVA_LIBRARIES := \
796759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski    android-support-design-res \
80a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell    android-support-v4 \
8164bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
8264bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
83e1cd5a1f80010eece43cb4608505fd39f4832c00Neil FullerLOCAL_JAVA_LANGUAGE_VERSION := 1.7
84a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powellinclude $(BUILD_STATIC_JAVA_LIBRARY)
85a966c6cda6a3aa562fcfdb842b6c6b35bdd6a3dcAdam Powell
8695ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
8795ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
88631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes# A helper sub-library that makes direct use of Honeycomb MR1 APIs
89631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banesinclude $(CLEAR_VARS)
90631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_MODULE := android-support-design-honeycomb-mr1
91631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_SDK_VERSION := 12
92631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_SRC_FILES := $(call all-java-files-under, honeycomb-mr1)
93631f64ec9c6255f38a7f746d7949b6a537c1180fChris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb
946759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_JAVA_LIBRARIES := \
956759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski    android-support-design-res \
96631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes    android-support-v4 \
9764bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
9864bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
99e1cd5a1f80010eece43cb4608505fd39f4832c00Neil FullerLOCAL_JAVA_LANGUAGE_VERSION := 1.7
100631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
101631f64ec9c6255f38a7f746d7949b6a537c1180fChris Banes
10295ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
10395ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
1049ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes# A helper sub-library that makes direct use of ICS APIs
1059ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banesinclude $(CLEAR_VARS)
1069ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_MODULE := android-support-design-ics
1079ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_SDK_VERSION := 14
1089ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, ics)
1099ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb-mr1
1106759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_JAVA_LIBRARIES := \
1116759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski    android-support-design-res \
1129ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v4 \
1139ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v7-appcompat \
1149ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes    android-support-v7-recyclerview
115e1cd5a1f80010eece43cb4608505fd39f4832c00Neil FullerLOCAL_JAVA_LANGUAGE_VERSION := 1.7
1169ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
1179ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris Banes
11895ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
11995ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
12019b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# A helper sub-library that makes direct use of Lollipop APIs
12119b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
12219b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design-lollipop
12319b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SDK_VERSION := 21
12419b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, lollipop)
1259ec922c215ed95a4bbd8bd7940e81dcfe6926893Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-ics
1266759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_JAVA_LIBRARIES := \
1276759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski    android-support-design-res \
12819b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes    android-support-v4 \
12964bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-appcompat \
13064bcb674cc45ab712a591d4f540d5c13404f3b83Yuichi Araki    android-support-v7-recyclerview
131e1cd5a1f80010eece43cb4608505fd39f4832c00Neil FullerLOCAL_JAVA_LANGUAGE_VERSION := 1.7
13219b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
13319b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes
13495ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
13595ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
13619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banes# Here is the final static library that apps can link against.
1376759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski# Applications that use this library must specify
1386759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski#
1396759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski#   LOCAL_STATIC_ANDROID_LIBRARIES := \
1406759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski#       android-support-design \
1416759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski#       android-support-v7-appcompat \
1426759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski#       android-support-v7-recyclerview \
1436759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski#       android-support-v4
1446759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski#
1456759b1021d8198ad1d239bb30e5a102b99624bceAdam Lesinski# in their makefiles to include the resources and their dependencies in their package.
14619b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(CLEAR_VARS)
1476759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_USE_AAPT2 := true
14819b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_MODULE := android-support-design
14982b55491586ac50a0f95b60e39a3c18d068941cfChris BanesLOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
15019b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_SRC_FILES := $(call all-java-files-under, src)
15119b2eeafda0769c523c1cef0971cc79dcca49d60Chris BanesLOCAL_STATIC_JAVA_LIBRARIES := android-support-design-lollipop
1526759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_STATIC_ANDROID_LIBRARIES := android-support-design-res
1536759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_SHARED_ANDROID_LIBRARIES := $(resource_libs) android-support-v4
1546759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_JAR_EXCLUDE_FILES := none
155e1cd5a1f80010eece43cb4608505fd39f4832c00Neil FullerLOCAL_JAVA_LANGUAGE_VERSION := 1.7
1566759b1021d8198ad1d239bb30e5a102b99624bceAdam LesinskiLOCAL_AAPT_FLAGS := --add-javadoc-annotation doconly
15719b2eeafda0769c523c1cef0971cc79dcca49d60Chris Banesinclude $(BUILD_STATIC_JAVA_LIBRARY)
15827238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes
15995ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banessupport_module_src_files += $(LOCAL_SRC_FILES)
16095ad49b720f4990d39d05f7e46a5c7bc83afc9d6Chris Banes
16127238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes# API Check
16227238d142f178f9dc071f4bd8e1e7195231b5957Chris Banes# ---------------------------------------------
16327238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module := $(LOCAL_MODULE)
16427238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_api_dir := $(LOCAL_PATH)/api
16527238d142f178f9dc071f4bd8e1e7195231b5957Chris Banessupport_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
166639640523bdb81cc5a2ac2a1ebbe0c4e13a2c82bChris Banessupport_module_java_packages := android.support.design.*
16727238d142f178f9dc071f4bd8e1e7195231b5957Chris Banesinclude $(SUPPORT_API_CHECK)
168