1# Copyright (C) 2014 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 latest applicable 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_USE_AAPT2 := true
23LOCAL_MODULE := android-support-v17-leanback-res
24LOCAL_SDK_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
25LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
26LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
27LOCAL_JAR_EXCLUDE_FILES := none
28LOCAL_JAVA_LANGUAGE_VERSION := 1.7
29include $(BUILD_STATIC_JAVA_LIBRARY)
30
31support_module_src_files := $(LOCAL_SRC_FILES)
32
33# -----------------------------------------------------------------------
34
35#  Base sub-library contains classes both needed by api-level specific libraries
36#  (e.g. KitKat) and final static library.
37include $(CLEAR_VARS)
38LOCAL_MODULE := android-support-v17-leanback-common
39LOCAL_SDK_VERSION := 17
40LOCAL_SRC_FILES := $(call all-java-files-under, common)
41LOCAL_JAVA_LANGUAGE_VERSION := 1.7
42include $(BUILD_STATIC_JAVA_LIBRARY)
43
44support_module_src_files += $(LOCAL_SRC_FILES)
45
46# -----------------------------------------------------------------------
47
48#  A helper sub-library that makes direct use of API 23.
49include $(CLEAR_VARS)
50LOCAL_MODULE := android-support-v17-leanback-api23
51LOCAL_SDK_VERSION := 23
52LOCAL_SRC_FILES := $(call all-java-files-under, api23)
53LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
54LOCAL_JAVA_LANGUAGE_VERSION := 1.7
55include $(BUILD_STATIC_JAVA_LIBRARY)
56
57support_module_src_files += $(LOCAL_SRC_FILES)
58
59# -----------------------------------------------------------------------
60
61#  A helper sub-library that makes direct use of API 21.
62include $(CLEAR_VARS)
63LOCAL_MODULE := android-support-v17-leanback-api21
64LOCAL_SDK_VERSION := 21
65LOCAL_SRC_FILES := $(call all-java-files-under, api21)
66LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
67LOCAL_JAVA_LANGUAGE_VERSION := 1.7
68include $(BUILD_STATIC_JAVA_LIBRARY)
69
70support_module_src_files += $(LOCAL_SRC_FILES)
71
72# -----------------------------------------------------------------------
73
74#  A helper sub-library that makes direct use of KitKat APIs.
75include $(CLEAR_VARS)
76LOCAL_MODULE := android-support-v17-leanback-kitkat
77LOCAL_SDK_VERSION := 19
78LOCAL_SRC_FILES := $(call all-java-files-under, kitkat)
79LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
80LOCAL_JAVA_LANGUAGE_VERSION := 1.7
81include $(BUILD_STATIC_JAVA_LIBRARY)
82
83support_module_src_files += $(LOCAL_SRC_FILES)
84
85# -----------------------------------------------------------------------
86
87#  A helper sub-library that makes direct use of JBMR2 APIs.
88include $(CLEAR_VARS)
89LOCAL_MODULE := android-support-v17-leanback-jbmr2
90LOCAL_SDK_VERSION := 18
91LOCAL_SRC_FILES := $(call all-java-files-under, jbmr2)
92LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
93LOCAL_JAVA_LANGUAGE_VERSION := 1.7
94include $(BUILD_STATIC_JAVA_LIBRARY)
95
96support_module_src_files += $(LOCAL_SRC_FILES)
97
98# -----------------------------------------------------------------------
99
100# Here is the final static library that apps can link against.
101# Applications that use this library must specify
102#
103#   LOCAL_STATIC_ANDROID_LIBRARIES := \
104#       android-support-v17-leanback \
105#       android-support-v7-recyclerview \
106#       android-support-v4
107#
108# in their makefiles to include the resources and their dependencies in their package.
109include $(CLEAR_VARS)
110LOCAL_USE_AAPT2 := true
111LOCAL_MODULE := android-support-v17-leanback
112LOCAL_SDK_VERSION := 17
113LOCAL_SDK_RES_VERSION := $(SUPPORT_CURRENT_SDK_VERSION)
114LOCAL_SRC_FILES := $(call all-java-files-under, src)
115LOCAL_STATIC_JAVA_LIBRARIES := \
116    android-support-v17-leanback-kitkat \
117    android-support-v17-leanback-jbmr2 \
118    android-support-v17-leanback-api23 \
119    android-support-v17-leanback-api21 \
120    android-support-v17-leanback-common
121LOCAL_STATIC_ANDROID_LIBRARIES := \
122    android-support-v17-leanback-res
123LOCAL_SHARED_ANDROID_LIBRARIES := \
124    android-support-v7-recyclerview \
125    android-support-v4
126LOCAL_JAR_EXCLUDE_FILES := none
127LOCAL_JAVA_LANGUAGE_VERSION := 1.7
128LOCAL_AAPT_FLAGS := --add-javadoc-annotation doconly
129include $(BUILD_STATIC_JAVA_LIBRARY)
130
131support_module_src_files += $(LOCAL_SRC_FILES)
132
133# ===========================================================
134# Common Droiddoc vars
135leanback.docs.src_files := \
136    $(call all-java-files-under, src) \
137    $(call all-html-files-under, src)
138leanback.docs.java_libraries := \
139    android-support-v4 \
140    android-support-v7-recyclerview \
141    android-support-v17-leanback-res \
142    android-support-v17-leanback
143
144# Documentation
145# ===========================================================
146include $(CLEAR_VARS)
147
148LOCAL_MODULE := android-support-v17-leanback
149LOCAL_MODULE_CLASS := JAVA_LIBRARIES
150LOCAL_MODULE_TAGS := optional
151
152gen_res_src_dirs := $(call intermediates-dir-for,JAVA_LIBRARIES,android-support-v17-leanback-res,,COMMON)/src
153
154LOCAL_SRC_FILES := $(leanback.docs.src_files)
155LOCAL_ADDITIONAL_JAVA_DIR := $(gen_res_src_dirs)
156
157LOCAL_SDK_VERSION := 21
158LOCAL_IS_HOST_MODULE := false
159LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-sdk
160
161LOCAL_JAVA_LIBRARIES := $(leanback.docs.java_libraries)
162
163LOCAL_DROIDDOC_OPTIONS := \
164    -offlinemode \
165    -hdf android.whichdoc offline \
166    -federate Android http://developer.android.com \
167    -federationapi Android prebuilts/sdk/api/17.txt \
168    -hide 113
169
170include $(BUILD_DROIDDOC)
171
172# API Check
173# ---------------------------------------------
174support_module := $(LOCAL_MODULE)
175support_module_api_dir := $(LOCAL_PATH)/api
176support_module_java_libraries := $(leanback.docs.java_libraries)
177support_module_java_packages := android.support.v17.leanback*
178include $(SUPPORT_API_CHECK)
179
180# Cleanup temp vars
181# ===========================================================
182leanback.docs.src_files :=
183leanback.docs.java_libraries :=
184gen_res_src_dirs :=
185leanback_internal_api_file :=
186leanback_stubs_stamp :=
187leanback.docs.stubpackages :=
188