1# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17# Android libraries referenced by this module's resources.
18resource_libs := \
19    android-support-v7-appcompat \
20    android-support-v7-recyclerview
21
22# Build the resources using the latest applicable SDK version.
23# We do this here because the final static library must be compiled with an older
24# SDK version than the resources.  The resources library and the R class that it
25# contains will not be linked into the final static library.
26include $(CLEAR_VARS)
27LOCAL_USE_AAPT2 := true
28LOCAL_MODULE := android-support-design-res
29LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
30LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
31LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
32LOCAL_SHARED_ANDROID_LIBRARIES := $(resource_libs)
33LOCAL_AAPT_FLAGS := --no-version-vectors
34LOCAL_JAR_EXCLUDE_FILES := none
35LOCAL_JAVA_LANGUAGE_VERSION := 1.7
36include $(BUILD_STATIC_JAVA_LIBRARY)
37
38support_module_src_files := $(LOCAL_SRC_FILES)
39
40# A helper sub-library to resolve cyclic dependencies between src and the platform dependent
41# implementations
42include $(CLEAR_VARS)
43LOCAL_MODULE := android-support-design-base
44LOCAL_SDK_VERSION := 7
45LOCAL_SRC_FILES := $(call all-java-files-under, base)
46LOCAL_JAVA_LIBRARIES := \
47    android-support-design-res \
48    android-support-v4 \
49    android-support-v7-appcompat \
50    android-support-v7-recyclerview
51LOCAL_JAVA_LANGUAGE_VERSION := 1.7
52include $(BUILD_STATIC_JAVA_LIBRARY)
53
54support_module_src_files += $(LOCAL_SRC_FILES)
55
56# A helper sub-library that makes direct use of Eclair MR1 APIs
57include $(CLEAR_VARS)
58LOCAL_MODULE := android-support-design-eclair-mr1
59LOCAL_SDK_VERSION := 7
60LOCAL_SRC_FILES := $(call all-java-files-under, eclair-mr1)
61LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-base
62LOCAL_JAVA_LIBRARIES := \
63    android-support-design-res \
64    android-support-v4 \
65    android-support-v7-appcompat \
66    android-support-v7-recyclerview
67LOCAL_JAVA_LANGUAGE_VERSION := 1.7
68include $(BUILD_STATIC_JAVA_LIBRARY)
69
70support_module_src_files += $(LOCAL_SRC_FILES)
71
72# A helper sub-library that makes direct use of Honeycomb APIs
73include $(CLEAR_VARS)
74LOCAL_MODULE := android-support-design-honeycomb
75LOCAL_SDK_VERSION := 11
76LOCAL_SRC_FILES := $(call all-java-files-under, honeycomb)
77LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-eclair-mr1
78LOCAL_JAVA_LIBRARIES := \
79    android-support-design-res \
80    android-support-v4 \
81    android-support-v7-appcompat \
82    android-support-v7-recyclerview
83LOCAL_JAVA_LANGUAGE_VERSION := 1.7
84include $(BUILD_STATIC_JAVA_LIBRARY)
85
86support_module_src_files += $(LOCAL_SRC_FILES)
87
88# A helper sub-library that makes direct use of Honeycomb MR1 APIs
89include $(CLEAR_VARS)
90LOCAL_MODULE := android-support-design-honeycomb-mr1
91LOCAL_SDK_VERSION := 12
92LOCAL_SRC_FILES := $(call all-java-files-under, honeycomb-mr1)
93LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb
94LOCAL_JAVA_LIBRARIES := \
95    android-support-design-res \
96    android-support-v4 \
97    android-support-v7-appcompat \
98    android-support-v7-recyclerview
99LOCAL_JAVA_LANGUAGE_VERSION := 1.7
100include $(BUILD_STATIC_JAVA_LIBRARY)
101
102support_module_src_files += $(LOCAL_SRC_FILES)
103
104# A helper sub-library that makes direct use of ICS APIs
105include $(CLEAR_VARS)
106LOCAL_MODULE := android-support-design-ics
107LOCAL_SDK_VERSION := 14
108LOCAL_SRC_FILES := $(call all-java-files-under, ics)
109LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb-mr1
110LOCAL_JAVA_LIBRARIES := \
111    android-support-design-res \
112    android-support-v4 \
113    android-support-v7-appcompat \
114    android-support-v7-recyclerview
115LOCAL_JAVA_LANGUAGE_VERSION := 1.7
116include $(BUILD_STATIC_JAVA_LIBRARY)
117
118support_module_src_files += $(LOCAL_SRC_FILES)
119
120# A helper sub-library that makes direct use of Lollipop APIs
121include $(CLEAR_VARS)
122LOCAL_MODULE := android-support-design-lollipop
123LOCAL_SDK_VERSION := 21
124LOCAL_SRC_FILES := $(call all-java-files-under, lollipop)
125LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-ics
126LOCAL_JAVA_LIBRARIES := \
127    android-support-design-res \
128    android-support-v4 \
129    android-support-v7-appcompat \
130    android-support-v7-recyclerview
131LOCAL_JAVA_LANGUAGE_VERSION := 1.7
132include $(BUILD_STATIC_JAVA_LIBRARY)
133
134support_module_src_files += $(LOCAL_SRC_FILES)
135
136# Here is the final static library that apps can link against.
137# Applications that use this library must specify
138#
139#   LOCAL_STATIC_ANDROID_LIBRARIES := \
140#       android-support-design \
141#       android-support-v7-appcompat \
142#       android-support-v7-recyclerview \
143#       android-support-v4
144#
145# in their makefiles to include the resources and their dependencies in their package.
146include $(CLEAR_VARS)
147LOCAL_USE_AAPT2 := true
148LOCAL_MODULE := android-support-design
149LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
150LOCAL_SRC_FILES := $(call all-java-files-under, src)
151LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-lollipop
152LOCAL_STATIC_ANDROID_LIBRARIES := android-support-design-res
153LOCAL_SHARED_ANDROID_LIBRARIES := $(resource_libs) android-support-v4
154LOCAL_JAR_EXCLUDE_FILES := none
155LOCAL_JAVA_LANGUAGE_VERSION := 1.7
156LOCAL_AAPT_FLAGS := --add-javadoc-annotation doconly
157include $(BUILD_STATIC_JAVA_LIBRARY)
158
159support_module_src_files += $(LOCAL_SRC_FILES)
160
161# API Check
162# ---------------------------------------------
163support_module := $(LOCAL_MODULE)
164support_module_api_dir := $(LOCAL_PATH)/api
165support_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
166support_module_java_packages := android.support.design.*
167include $(SUPPORT_API_CHECK)
168