Android.mk revision eb66dab544c4c1eabe4d469b7cea348d4b01e664
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 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-v17-leanback-res
23LOCAL_SDK_VERSION := current
24LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
25LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
26LOCAL_AAPT_FLAGS := \
27        --auto-add-overlay
28LOCAL_JAR_EXCLUDE_FILES := none
29include $(BUILD_STATIC_JAVA_LIBRARY)
30
31# -----------------------------------------------------------------------
32
33#  Base sub-library contains classes both needed by api-level specific libraries
34#  (e.g. KitKat) and final static library.
35include $(CLEAR_VARS)
36LOCAL_MODULE := android-support-v17-leanback-common
37LOCAL_SDK_VERSION := 17
38LOCAL_SRC_FILES := $(call all-java-files-under, common)
39include $(BUILD_STATIC_JAVA_LIBRARY)
40
41# -----------------------------------------------------------------------
42
43#  A helper sub-library that makes direct use of API 21.
44include $(CLEAR_VARS)
45LOCAL_MODULE := android-support-v17-leanback-api21
46LOCAL_SDK_VERSION := current
47LOCAL_SRC_FILES := $(call all-java-files-under, api21)
48LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
49include $(BUILD_STATIC_JAVA_LIBRARY)
50
51# -----------------------------------------------------------------------
52
53#  A helper sub-library that makes direct use of KitKat APIs.
54include $(CLEAR_VARS)
55LOCAL_MODULE := android-support-v17-leanback-kitkat
56LOCAL_SDK_VERSION := 19
57LOCAL_SRC_FILES := $(call all-java-files-under, kitkat)
58LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
59include $(BUILD_STATIC_JAVA_LIBRARY)
60
61# -----------------------------------------------------------------------
62
63#  A helper sub-library that makes direct use of JBMR2 APIs.
64include $(CLEAR_VARS)
65LOCAL_MODULE := android-support-v17-leanback-jbmr2
66LOCAL_SDK_VERSION := 18
67LOCAL_SRC_FILES := $(call all-java-files-under, jbmr2)
68LOCAL_JAVA_LIBRARIES := android-support-v17-leanback-res android-support-v17-leanback-common
69include $(BUILD_STATIC_JAVA_LIBRARY)
70
71# -----------------------------------------------------------------------
72
73# Here is the final static library that apps can link against.
74# The R class is automatically excluded from the generated library.
75# Applications that use this library must specify LOCAL_RESOURCE_DIR
76# in their makefiles to include the resources in their package.
77include $(CLEAR_VARS)
78LOCAL_MODULE := android-support-v17-leanback
79LOCAL_SDK_VERSION := 17
80LOCAL_SRC_FILES := $(call all-java-files-under, src)
81LOCAL_STATIC_JAVA_LIBRARIES := android-support-v17-leanback-kitkat android-support-v17-leanback-jbmr2 \
82        android-support-v17-leanback-api21 android-support-v17-leanback-common
83LOCAL_JAVA_LIBRARIES := \
84        android-support-v4 \
85        android-support-v7-recyclerview \
86        android-support-v17-leanback-res
87include $(BUILD_STATIC_JAVA_LIBRARY)
88
89
90# ===========================================================
91# Common Droiddoc vars
92leanback.docs.src_files := \
93    $(call all-java-files-under, src) \
94    $(call all-html-files-under, src)
95leanback.docs.java_libraries := \
96    framework \
97    android-support-v4 \
98    android-support-v7-recyclerview \
99    android-support-v17-leanback-res \
100    android-support-v17-leanback
101
102# Documentation
103# ===========================================================
104include $(CLEAR_VARS)
105
106LOCAL_MODULE := android-support-v17-leanback
107LOCAL_MODULE_CLASS := JAVA_LIBRARIES
108LOCAL_MODULE_TAGS := optional
109
110intermediates.COMMON := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS),android-support-v17-leanback,,COMMON)
111
112LOCAL_SRC_FILES := $(leanback.docs.src_files)
113LOCAL_ADDITONAL_JAVA_DIR := $(intermediates.COMMON)/src
114
115LOCAL_SDK_VERSION := 19
116LOCAL_IS_HOST_MODULE := false
117LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-sdk
118
119LOCAL_JAVA_LIBRARIES := $(leanback.docs.java_libraries)
120
121LOCAL_DROIDDOC_OPTIONS := \
122    -offlinemode \
123    -hdf android.whichdoc offline \
124    -federate Android http://developer.android.com \
125    -federationapi Android prebuilts/sdk/api/17.txt \
126    -hide 113
127
128include $(BUILD_DROIDDOC)
129
130# Stub source files
131# ===========================================================
132
133leanback_internal_api_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android-support-v17-leanback_api.txt
134leanback.docs.stubpackages := android.support.v17.leanback:android.support.v17.leanback.app:android.support.v17.leanback.database:android.support.v17.leanback.widget
135
136include $(CLEAR_VARS)
137
138LOCAL_MODULE := android-support-v17-leanback-stubs
139LOCAL_MODULE_CLASS := JAVA_LIBRARIES
140LOCAL_MODULE_TAGS := optional
141
142LOCAL_SRC_FILES := $(leanback.docs.src_files)
143LOCAL_JAVA_LIBRARIES := $(leanback.docs.java_libraries)
144LOCAL_SDK_VERSION := current
145
146LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-sdk
147LOCAL_UNINSTALLABLE_MODULE := true
148
149LOCAL_DROIDDOC_OPTIONS := \
150    -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android-support-v17-leanback-stubs_intermediates/src \
151    -stubpackages $(leanback.docs.stubpackages) \
152    -api $(leanback_internal_api_file) \
153    -hide 113 \
154    -nodocs
155
156include $(BUILD_DROIDDOC)
157leanback_stubs_stamp := $(full_target)
158$(leanback_internal_api_file) : $(full_target)
159
160# Cleanup temp vars
161# ===========================================================
162leanback.docs.src_files :=
163leanback.docs.java_libraries :=
164intermediates.COMMON :=
165leanback_internal_api_file :=
166leanback_stubs_stamp :=
167leanback.docs.stubpackages :=
168