Android.mk revision cdbb74ce4c74e4a1b35ee0f38a186f365eb3ba8f
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 := 21
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
110gen_res_src_dirs := $(call intermediates-dir-for,JAVA_LIBRARIES,android-support-v17-leanback-res,,COMMON)/src
111
112LOCAL_SRC_FILES := $(leanback.docs.src_files)
113LOCAL_ADDITIONAL_JAVA_DIR := $(gen_res_src_dirs)
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# API Check
131# ---------------------------------------------
132support_module := $(LOCAL_MODULE)
133support_module_api_dir := $(LOCAL_PATH)/api
134support_module_src_files := $(leanback.docs.src_files)
135support_module_java_libraries := $(leanback.docs.java_libraries)
136support_module_java_packages := \
137    android.support.v17.leanback.animation \
138    android.support.v17.leanback.app \
139    android.support.v17.leanback.database \
140    android.support.v17.leanback.graphics \
141    android.support.v17.leanback.os \
142    android.support.v17.leanback.transition \
143    android.support.v17.leanback.view \
144    android.support.v17.leanback.widget    
145include $(SUPPORT_API_CHECK)
146
147# Cleanup temp vars
148# ===========================================================
149leanback.docs.src_files :=
150leanback.docs.java_libraries :=
151gen_res_src_dirs :=
152leanback_internal_api_file :=
153leanback_stubs_stamp :=
154leanback.docs.stubpackages :=
155