Android.mk revision 64bcb674cc45ab712a591d4f540d5c13404f3b83
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# Build the resources using the current SDK version.
18# We do this here because the final static library must be compiled with an older
19# SDK version than the resources.  The resources library and the R class that it
20# contains will not be linked into the final static library.
21include $(CLEAR_VARS)
22LOCAL_MODULE := android-support-design-res
23LOCAL_SDK_VERSION := current
24LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
25LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
26    frameworks/support/v7/appcompat/res \
27    frameworks/support/v7/recyclerview/res
28LOCAL_AAPT_FLAGS := \
29    --auto-add-overlay \
30    --extra-packages android.support.v7.appcompat \
31    --extra-packages android.support.v7.recyclerview
32LOCAL_JAR_EXCLUDE_FILES := none
33include $(BUILD_STATIC_JAVA_LIBRARY)
34
35# A helper sub-library to resolve cyclic dependencies between src and the platform dependent
36# implementations
37include $(CLEAR_VARS)
38LOCAL_MODULE := android-support-design-base
39LOCAL_SDK_VERSION := 7
40LOCAL_SRC_FILES := $(call all-java-files-under, base)
41LOCAL_JAVA_LIBRARIES := android-support-design-res \
42    android-support-v4 \
43    android-support-v7-appcompat \
44    android-support-v7-recyclerview
45include $(BUILD_STATIC_JAVA_LIBRARY)
46
47# A helper sub-library that makes direct use of Eclair MR1 APIs
48include $(CLEAR_VARS)
49LOCAL_MODULE := android-support-design-eclair-mr1
50LOCAL_SDK_VERSION := 7
51LOCAL_SRC_FILES := $(call all-java-files-under, eclair-mr1)
52LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-base
53LOCAL_JAVA_LIBRARIES := android-support-design-res \
54    android-support-v4 \
55    android-support-v7-appcompat \
56    android-support-v7-recyclerview
57include $(BUILD_STATIC_JAVA_LIBRARY)
58
59# A helper sub-library that makes direct use of Honeycomb APIs
60include $(CLEAR_VARS)
61LOCAL_MODULE := android-support-design-honeycomb
62LOCAL_SDK_VERSION := 11
63LOCAL_SRC_FILES := $(call all-java-files-under, honeycomb)
64LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-eclair-mr1
65LOCAL_JAVA_LIBRARIES := android-support-design-res \
66    android-support-v4 \
67    android-support-v7-appcompat \
68    android-support-v7-recyclerview
69include $(BUILD_STATIC_JAVA_LIBRARY)
70
71# A helper sub-library that makes direct use of Honeycomb MR1 APIs
72include $(CLEAR_VARS)
73LOCAL_MODULE := android-support-design-honeycomb-mr1
74LOCAL_SDK_VERSION := 12
75LOCAL_SRC_FILES := $(call all-java-files-under, honeycomb-mr1)
76LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb
77LOCAL_JAVA_LIBRARIES := android-support-design-res \
78    android-support-v4 \
79    android-support-v7-appcompat \
80    android-support-v7-recyclerview
81include $(BUILD_STATIC_JAVA_LIBRARY)
82
83# A helper sub-library that makes direct use of Lollipop APIs
84include $(CLEAR_VARS)
85LOCAL_MODULE := android-support-design-lollipop
86LOCAL_SDK_VERSION := 21
87LOCAL_SRC_FILES := $(call all-java-files-under, lollipop)
88LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-honeycomb-mr1
89LOCAL_JAVA_LIBRARIES := android-support-design-res \
90    android-support-v4 \
91    android-support-v7-appcompat \
92    android-support-v7-recyclerview
93include $(BUILD_STATIC_JAVA_LIBRARY)
94
95# Here is the final static library that apps can link against.
96# The R class is automatically excluded from the generated library.
97# Applications that use this library must specify LOCAL_RESOURCE_DIR
98# in their makefiles to include the resources in their package.
99include $(CLEAR_VARS)
100LOCAL_MODULE := android-support-design
101LOCAL_SDK_VERSION := current
102LOCAL_SRC_FILES := $(call all-java-files-under, src)
103LOCAL_STATIC_JAVA_LIBRARIES := android-support-design-lollipop
104LOCAL_JAVA_LIBRARIES := android-support-design-res \
105    android-support-v4 \
106    android-support-v7-appcompat \
107    android-support-v7-recyclerview
108include $(BUILD_STATIC_JAVA_LIBRARY)
109
110# API Check
111# ---------------------------------------------
112support_module := $(LOCAL_MODULE)
113support_module_api_dir := $(LOCAL_PATH)/api
114support_module_src_files := $(LOCAL_SRC_FILES)
115support_module_java_libraries := $(LOCAL_JAVA_LIBRARIES)
116support_module_java_packages := android.support.design.*
117include $(SUPPORT_API_CHECK)
118