blob: 76d4ea1d53808d0ba7c5f6ab666e840f6faa1413 [file] [log] [blame]
Adnan Begovicaa8614e2015-04-23 23:16:27 -07001# Copyright (C) 2015 The CyanogenMod 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.
Adnan Begovicaa8614e2015-04-23 23:16:27 -070014LOCAL_PATH := $(call my-dir)
15
Adnan Begovic37fc76f2015-05-05 17:37:05 -070016# We have a special case here where we build the library's resources
17# independently from its code, so we need to find where the resource
18# class source got placed in the course of building the resources.
19# Thus, the magic here.
20# Also, this module cannot depend directly on the R.java file; if it
21# did, the PRIVATE_* vars for R.java wouldn't be guaranteed to be correct.
22# Instead, it depends on the R.stamp file, which lists the corresponding
23# R.java file as a prerequisite.
24cm_platform_res := APPS/org.cyanogenmod.platform-res_intermediates/src
25
Adnan Begovicaa8614e2015-04-23 23:16:27 -070026# The CyanogenMod Platform Framework Library
27# ============================================================
28include $(CLEAR_VARS)
29
Adnan Begovic5ff5e102015-07-18 17:12:21 -070030cyanogenmod_src := src/java/cyanogenmod
31cyanogenmod_internal_src := src/java/org/cyanogenmod/internal
Adnan Begovica7d6fc52015-04-30 11:10:56 -070032library_src := cm/lib/main/java
Adnan Begovicaa8614e2015-04-23 23:16:27 -070033
34LOCAL_MODULE := org.cyanogenmod.platform
35LOCAL_MODULE_TAGS := optional
Adnan Begovic37fc76f2015-05-05 17:37:05 -070036
37LOCAL_JAVA_LIBRARIES := \
Steve Kondik5ee87cb2015-08-16 22:33:30 -070038 services \
39 org.cyanogenmod.hardware
Adnan Begovicaa8614e2015-04-23 23:16:27 -070040
41LOCAL_SRC_FILES := \
Adnan Begovic5ff5e102015-07-18 17:12:21 -070042 $(call all-java-files-under, $(cyanogenmod_src)) \
43 $(call all-java-files-under, $(cyanogenmod_internal_src)) \
Adnan Begovic37fc76f2015-05-05 17:37:05 -070044 $(call all-java-files-under, $(library_src))
Adnan Begovicaa8614e2015-04-23 23:16:27 -070045
46## READ ME: ########################################################
47##
48## When updating this list of aidl files, consider if that aidl is
49## part of the SDK API. If it is, also add it to the list below that
50## is preprocessed and distributed with the SDK. This list should
51## not contain any aidl files for parcelables, but the one below should
52## if you intend for 3rd parties to be able to send those objects
53## across process boundaries.
54##
55## READ ME: ########################################################
56LOCAL_SRC_FILES += \
Adnan Begovic5ff5e102015-07-18 17:12:21 -070057 $(call all-Iaidl-files-under, $(cyanogenmod_src)) \
58 $(call all-Iaidl-files-under, $(cyanogenmod_internal_src))
Adnan Begovic37fc76f2015-05-05 17:37:05 -070059
Adnan Begovic62c951e2015-05-28 16:13:04 -070060cmplat_LOCAL_INTERMEDIATE_SOURCES := \
Adnan Begovic37c4b962015-05-13 04:48:42 -070061 $(cm_platform_res)/cyanogenmod/platform/R.java \
62 $(cm_platform_res)/cyanogenmod/platform/Manifest.java \
Adnan Begovic37fc76f2015-05-05 17:37:05 -070063 $(cm_platform_res)/org/cyanogenmod/platform/internal/R.java
Adnan Begovicaa8614e2015-04-23 23:16:27 -070064
Adnan Begovic8c36c412015-05-19 13:27:17 -070065LOCAL_INTERMEDIATE_SOURCES := \
Adnan Begovic62c951e2015-05-28 16:13:04 -070066 $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
Adnan Begovic8c36c412015-05-19 13:27:17 -070067
Adnan Begovicaa8614e2015-04-23 23:16:27 -070068# Include aidl files from cyanogenmod.app namespace as well as internal src aidl files
69LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java
70
71include $(BUILD_JAVA_LIBRARY)
Adnan Begovic37fc76f2015-05-05 17:37:05 -070072cm_framework_module := $(LOCAL_INSTALLED_MODULE)
73
74# Make sure that R.java and Manifest.java are built before we build
75# the source for this library.
76cm_framework_res_R_stamp := \
77 $(call intermediates-dir-for,APPS,org.cyanogenmod.platform-res,,COMMON)/src/R.stamp
78$(full_classes_compiled_jar): $(cm_framework_res_R_stamp)
Steve Kondik1a5c2492015-11-03 10:13:04 -080079$(built_dex_intermediate): $(cm_framework_res_R_stamp)
Adnan Begovic37fc76f2015-05-05 17:37:05 -070080
81$(cm_framework_module): | $(dir $(cm_framework_module))org.cyanogenmod.platform-res.apk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070082
83cm_framework_built := $(call java-lib-deps, org.cyanogenmod.platform)
84
85# ==== org.cyanogenmod.platform.xml lib def ========================
86include $(CLEAR_VARS)
87
88LOCAL_MODULE := org.cyanogenmod.platform.xml
89LOCAL_MODULE_TAGS := optional
90
91LOCAL_MODULE_CLASS := ETC
92
93# This will install the file in /system/etc/permissions
94LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
95
96LOCAL_SRC_FILES := $(LOCAL_MODULE)
97
98include $(BUILD_PREBUILT)
99
100# the sdk
101# ============================================================
102include $(CLEAR_VARS)
103
104LOCAL_MODULE:= org.cyanogenmod.platform.sdk
105LOCAL_MODULE_TAGS := optional
106LOCAL_REQUIRED_MODULES := services
107
108LOCAL_SRC_FILES := \
Adnan Begovic5ff5e102015-07-18 17:12:21 -0700109 $(call all-java-files-under, $(cyanogenmod_src)) \
110 $(call all-Iaidl-files-under, $(cyanogenmod_src)) \
111 $(call all-Iaidl-files-under, $(cyanogenmod_internal_src))
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700112
113# Included aidl files from cyanogenmod.app namespace
114LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java
115
Adnan Begovice9494332015-08-28 15:28:23 -0700116cmsdk_LOCAL_INTERMEDIATE_SOURCES := \
117 $(cm_platform_res)/cyanogenmod/platform/R.java \
118 $(cm_platform_res)/cyanogenmod/platform/Manifest.java
119
120LOCAL_INTERMEDIATE_SOURCES := \
121 $(cmsdk_LOCAL_INTERMEDIATE_SOURCES)
122
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700123$(full_target): $(cm_framework_built) $(gen)
124include $(BUILD_STATIC_JAVA_LIBRARY)
125
Steve Kondik5e522e62015-11-03 17:34:01 -0800126# full target for use by platform apps
127#
128include $(CLEAR_VARS)
129
130LOCAL_MODULE:= org.cyanogenmod.platform.internal
131LOCAL_MODULE_TAGS := optional
132LOCAL_REQUIRED_MODULES := services
133
134LOCAL_SRC_FILES := \
135 $(call all-java-files-under, $(cyanogenmod_src)) \
Adnan Begovic33fecfb2015-11-30 10:57:06 -0800136 $(call all-java-files-under, $(cyanogenmod_internal_src)) \
Steve Kondik5e522e62015-11-03 17:34:01 -0800137 $(call all-Iaidl-files-under, $(cyanogenmod_src)) \
138 $(call all-Iaidl-files-under, $(cyanogenmod_internal_src))
139
140# Included aidl files from cyanogenmod.app namespace
141LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java
142
143cmsdk_LOCAL_INTERMEDIATE_SOURCES := \
144 $(cm_platform_res)/cyanogenmod/platform/R.java \
145 $(cm_platform_res)/cyanogenmod/platform/Manifest.java \
146 $(cm_platform_res)/org/cyanogenmod/platform/internal/R.java \
147 $(cm_platform_res)/org/cyanogenmod/platform/internal/Manifest.java
148
149LOCAL_INTERMEDIATE_SOURCES := \
150 $(cmsdk_LOCAL_INTERMEDIATE_SOURCES)
151
152$(full_target): $(cm_framework_built) $(gen)
153include $(BUILD_STATIC_JAVA_LIBRARY)
154
155
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700156# ===========================================================
157# Common Droiddoc vars
Adnan Begovic62c951e2015-05-28 16:13:04 -0700158cmplat_docs_src_files := \
Adnan Begovic5ff5e102015-07-18 17:12:21 -0700159 $(call all-java-files-under, $(cyanogenmod_src)) \
160 $(call all-html-files-under, $(cyanogenmod_src))
Adnan Begovic62c951e2015-05-28 16:13:04 -0700161
162cmplat_docs_java_libraries := \
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700163 org.cyanogenmod.platform.sdk
164
Adnan Begovic62c951e2015-05-28 16:13:04 -0700165# SDK version as defined
166cmplat_docs_SDK_VERSION := 0.1
167
168# release version
169cmplat_docs_SDK_REL_ID := 0
170
171cmplat_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
172
Adnan Begovic62c951e2015-05-28 16:13:04 -0700173cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
174 $(cmplat_docs_src_files)
175
176intermediates.COMMON := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS), org.cyanogenmod.platform.sdk,,COMMON)
177
178# ==== the api stubs and current.xml ===========================
179include $(CLEAR_VARS)
180
181LOCAL_SRC_FILES:= \
182 $(cmplat_docs_src_files) \
183 $(call all-java-files-under, $(library_src))
184LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
185LOCAL_JAVA_LIBRARIES:= $(cmplat_docs_java_libraries)
186LOCAL_MODULE_CLASS:= $(cmplat_docs_LOCAL_MODULE_CLASS)
187LOCAL_DROIDDOC_SOURCE_PATH:= $(cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH)
188LOCAL_ADDITIONAL_JAVA_DIR:= $(intermediates.COMMON)/src
189LOCAL_ADDITIONAL_DEPENDENCIES:= $(cmplat_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
190
191LOCAL_MODULE := cm-api-stubs
192
193LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= build/tools/droiddoc/templates-sdk
194
195LOCAL_DROIDDOC_OPTIONS:= \
196 -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/cmsdk_stubs_current_intermediates/src \
Steve Kondik620c35b2015-11-02 17:43:44 -0800197 -stubpackages cyanogenmod.alarmclock:cyanogenmod.app:cyanogenmod.content:cyanogenmod.hardware:cyanogenmod.media:cyanogenmod.os:cyanogenmod.profiles:cyanogenmod.providers:cyanogenmod.platform:cyanogenmod.power:org.cyanogenmod.platform \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700198 -api $(INTERNAL_CM_PLATFORM_API_FILE) \
199 -removedApi $(INTERNAL_CM_PLATFORM_REMOVED_API_FILE) \
Adnan Begovicf1f9f252015-06-22 20:34:55 -0700200 -nodocs \
201 -verbose
Adnan Begovic62c951e2015-05-28 16:13:04 -0700202
203LOCAL_UNINSTALLABLE_MODULE := true
204
205include $(BUILD_DROIDDOC)
206
207$(full_target): $(cm_framework_built) $(gen)
208$(INTERNAL_CM_PLATFORM_API_FILE): $(full_target)
209
210# ==== the system api stubs ===================================
211include $(CLEAR_VARS)
212
213LOCAL_SRC_FILES:= \
214 $(cmplat_docs_src_files) \
215 $(call all-java-files-under, $(library_src))
216LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
217LOCAL_JAVA_LIBRARIES:= $(cmplat_docs_java_libraries)
218LOCAL_MODULE_CLASS:= $(cmplat_docs_LOCAL_MODULE_CLASS)
219LOCAL_DROIDDOC_SOURCE_PATH:= $(cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH)
220LOCAL_ADDITIONAL_JAVA_DIR:= $(intermediates.COMMON)/src
Adnan Begovic62c951e2015-05-28 16:13:04 -0700221
222LOCAL_MODULE := cm-system-api-stubs
223
224LOCAL_DROIDDOC_OPTIONS:=\
225 -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/cmsdk_system_stubs_current_intermediates/src \
Steve Kondik620c35b2015-11-02 17:43:44 -0800226 -stubpackages cyanogenmod.alarmclock:cyanogenmod.app:cyanogenmod.content:cyanogenmod.hardware:cyanogenmod.media:cyanogenmod.os:cyanogenmod.profiles:cyanogenmod.providers:cyanogenmod.platform:cyanogenmod.power:org.cyanogenmod.platform \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700227 -showAnnotation android.annotation.SystemApi \
228 -api $(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE) \
229 -removedApi $(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE) \
Adnan Begovicf1f9f252015-06-22 20:34:55 -0700230 -nodocs \
231 -verbose
Adnan Begovic62c951e2015-05-28 16:13:04 -0700232
233LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= build/tools/droiddoc/templates-sdk
234
235LOCAL_UNINSTALLABLE_MODULE := true
236
237include $(BUILD_DROIDDOC)
238
239$(full_target): $(cm_framework_built) $(gen)
240$(INTERNAL_CM_PLATFORM_API_FILE): $(full_target)
241
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700242# Documentation
243# ===========================================================
244include $(CLEAR_VARS)
245
246LOCAL_MODULE := org.cyanogenmod.platform.sdk
Adnan Begovic62c951e2015-05-28 16:13:04 -0700247LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700248LOCAL_MODULE_CLASS := JAVA_LIBRARIES
249LOCAL_MODULE_TAGS := optional
250
Adnan Begovic62c951e2015-05-28 16:13:04 -0700251LOCAL_SRC_FILES := $(cmplat_docs_src_files)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700252LOCAL_ADDITONAL_JAVA_DIR := $(intermediates.COMMON)/src
253
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700254LOCAL_IS_HOST_MODULE := false
Adnan Begovicfb079832015-05-19 15:56:13 -0700255LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := vendor/cm/build/tools/droiddoc/templates-cmsdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700256LOCAL_ADDITIONAL_DEPENDENCIES := \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700257 services
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700258
Adnan Begovic62c951e2015-05-28 16:13:04 -0700259LOCAL_JAVA_LIBRARIES := $(cmplat_docs_java_libraries)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700260
261LOCAL_DROIDDOC_OPTIONS := \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700262 -offlinemode \
263 -hidePackage org.cyanogenmod.platform.internal \
264 -hdf android.whichdoc offline \
265 -hdf sdk.version $(cmplat_docs_docs_SDK_VERSION) \
266 -hdf sdk.rel.id $(cmplat_docs_docs_SDK_REL_ID) \
267 -hdf sdk.preview 0 \
Adnan Begovice3ad3912015-07-13 14:52:14 -0700268 -since $(CM_SRC_API_DIR)/1.txt 1 \
Adnan Begovic38e8b112015-09-29 11:40:29 -0700269 -since $(CM_SRC_API_DIR)/2.txt 2 \
Adnan Begovic4e534612015-10-07 11:32:41 -0700270 -since $(CM_SRC_API_DIR)/3.txt 3 \
271 -since $(CM_SRC_API_DIR)/4.txt 4
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700272
273$(full_target): $(cm_framework_built) $(gen)
274include $(BUILD_DROIDDOC)
275
Adnan Begovic37fc76f2015-05-05 17:37:05 -0700276include $(call first-makefiles-under,$(LOCAL_PATH))
277
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700278# Cleanup temp vars
279# ===========================================================
280cmplat.docs.src_files :=
281cmplat.docs.java_libraries :=
282intermediates.COMMON :=