blob: b224af8dc2251431b2af28ea843b482608df4ea3 [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)
79
80$(cm_framework_module): | $(dir $(cm_framework_module))org.cyanogenmod.platform-res.apk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070081
82cm_framework_built := $(call java-lib-deps, org.cyanogenmod.platform)
83
84# ==== org.cyanogenmod.platform.xml lib def ========================
85include $(CLEAR_VARS)
86
87LOCAL_MODULE := org.cyanogenmod.platform.xml
88LOCAL_MODULE_TAGS := optional
89
90LOCAL_MODULE_CLASS := ETC
91
92# This will install the file in /system/etc/permissions
93LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
94
95LOCAL_SRC_FILES := $(LOCAL_MODULE)
96
97include $(BUILD_PREBUILT)
98
99# the sdk
100# ============================================================
101include $(CLEAR_VARS)
102
103LOCAL_MODULE:= org.cyanogenmod.platform.sdk
104LOCAL_MODULE_TAGS := optional
105LOCAL_REQUIRED_MODULES := services
106
107LOCAL_SRC_FILES := \
Adnan Begovic5ff5e102015-07-18 17:12:21 -0700108 $(call all-java-files-under, $(cyanogenmod_src)) \
109 $(call all-Iaidl-files-under, $(cyanogenmod_src)) \
110 $(call all-Iaidl-files-under, $(cyanogenmod_internal_src))
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700111
112# Included aidl files from cyanogenmod.app namespace
113LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java
114
115$(full_target): $(cm_framework_built) $(gen)
116include $(BUILD_STATIC_JAVA_LIBRARY)
117
118# ===========================================================
119# Common Droiddoc vars
Adnan Begovic62c951e2015-05-28 16:13:04 -0700120cmplat_docs_src_files := \
Adnan Begovic5ff5e102015-07-18 17:12:21 -0700121 $(call all-java-files-under, $(cyanogenmod_src)) \
122 $(call all-html-files-under, $(cyanogenmod_src))
Adnan Begovic62c951e2015-05-28 16:13:04 -0700123
124cmplat_docs_java_libraries := \
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700125 org.cyanogenmod.platform.sdk
126
Adnan Begovic62c951e2015-05-28 16:13:04 -0700127# SDK version as defined
128cmplat_docs_SDK_VERSION := 0.1
129
130# release version
131cmplat_docs_SDK_REL_ID := 0
132
133cmplat_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
134
Adnan Begovic62c951e2015-05-28 16:13:04 -0700135cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
136 $(cmplat_docs_src_files)
137
138intermediates.COMMON := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS), org.cyanogenmod.platform.sdk,,COMMON)
139
140# ==== the api stubs and current.xml ===========================
141include $(CLEAR_VARS)
142
143LOCAL_SRC_FILES:= \
144 $(cmplat_docs_src_files) \
145 $(call all-java-files-under, $(library_src))
146LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
147LOCAL_JAVA_LIBRARIES:= $(cmplat_docs_java_libraries)
148LOCAL_MODULE_CLASS:= $(cmplat_docs_LOCAL_MODULE_CLASS)
149LOCAL_DROIDDOC_SOURCE_PATH:= $(cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH)
150LOCAL_ADDITIONAL_JAVA_DIR:= $(intermediates.COMMON)/src
151LOCAL_ADDITIONAL_DEPENDENCIES:= $(cmplat_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
152
153LOCAL_MODULE := cm-api-stubs
154
155LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= build/tools/droiddoc/templates-sdk
156
157LOCAL_DROIDDOC_OPTIONS:= \
158 -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/cmsdk_stubs_current_intermediates/src \
Steve Kondik5ee87cb2015-08-16 22:33:30 -0700159 -stubpackages cyanogenmod.alarmclock:cyanogenmod.app:cyanogenmod.hardware:cyanogenmod.os:cyanogenmod.profiles:cyanogenmod.platform:org.cyanogenmod.platform \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700160 -api $(INTERNAL_CM_PLATFORM_API_FILE) \
161 -removedApi $(INTERNAL_CM_PLATFORM_REMOVED_API_FILE) \
Adnan Begovicf1f9f252015-06-22 20:34:55 -0700162 -nodocs \
163 -verbose
Adnan Begovic62c951e2015-05-28 16:13:04 -0700164
165LOCAL_UNINSTALLABLE_MODULE := true
166
167include $(BUILD_DROIDDOC)
168
169$(full_target): $(cm_framework_built) $(gen)
170$(INTERNAL_CM_PLATFORM_API_FILE): $(full_target)
171
172# ==== the system api stubs ===================================
173include $(CLEAR_VARS)
174
175LOCAL_SRC_FILES:= \
176 $(cmplat_docs_src_files) \
177 $(call all-java-files-under, $(library_src))
178LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
179LOCAL_JAVA_LIBRARIES:= $(cmplat_docs_java_libraries)
180LOCAL_MODULE_CLASS:= $(cmplat_docs_LOCAL_MODULE_CLASS)
181LOCAL_DROIDDOC_SOURCE_PATH:= $(cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH)
182LOCAL_ADDITIONAL_JAVA_DIR:= $(intermediates.COMMON)/src
Adnan Begovic62c951e2015-05-28 16:13:04 -0700183
184LOCAL_MODULE := cm-system-api-stubs
185
186LOCAL_DROIDDOC_OPTIONS:=\
187 -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/cmsdk_system_stubs_current_intermediates/src \
Steve Kondik5ee87cb2015-08-16 22:33:30 -0700188 -stubpackages cyanogenmod.alarmclock:cyanogenmod.app:cyanogenmod.hardware:cyanogenmod.os:cyanogenmod.profiles:cyanogenmod.platform:org.cyanogenmod.platform \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700189 -showAnnotation android.annotation.SystemApi \
190 -api $(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE) \
191 -removedApi $(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE) \
Adnan Begovicf1f9f252015-06-22 20:34:55 -0700192 -nodocs \
193 -verbose
Adnan Begovic62c951e2015-05-28 16:13:04 -0700194
195LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= build/tools/droiddoc/templates-sdk
196
197LOCAL_UNINSTALLABLE_MODULE := true
198
199include $(BUILD_DROIDDOC)
200
201$(full_target): $(cm_framework_built) $(gen)
202$(INTERNAL_CM_PLATFORM_API_FILE): $(full_target)
203
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700204# Documentation
205# ===========================================================
206include $(CLEAR_VARS)
207
208LOCAL_MODULE := org.cyanogenmod.platform.sdk
Adnan Begovic62c951e2015-05-28 16:13:04 -0700209LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700210LOCAL_MODULE_CLASS := JAVA_LIBRARIES
211LOCAL_MODULE_TAGS := optional
212
Adnan Begovic62c951e2015-05-28 16:13:04 -0700213LOCAL_SRC_FILES := $(cmplat_docs_src_files)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700214LOCAL_ADDITONAL_JAVA_DIR := $(intermediates.COMMON)/src
215
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700216LOCAL_IS_HOST_MODULE := false
Adnan Begovicfb079832015-05-19 15:56:13 -0700217LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := vendor/cm/build/tools/droiddoc/templates-cmsdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700218LOCAL_ADDITIONAL_DEPENDENCIES := \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700219 services
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700220
Adnan Begovic62c951e2015-05-28 16:13:04 -0700221LOCAL_JAVA_LIBRARIES := $(cmplat_docs_java_libraries)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700222
223LOCAL_DROIDDOC_OPTIONS := \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700224 -offlinemode \
225 -hidePackage org.cyanogenmod.platform.internal \
226 -hdf android.whichdoc offline \
227 -hdf sdk.version $(cmplat_docs_docs_SDK_VERSION) \
228 -hdf sdk.rel.id $(cmplat_docs_docs_SDK_REL_ID) \
229 -hdf sdk.preview 0 \
Adnan Begovice3ad3912015-07-13 14:52:14 -0700230 -since $(CM_SRC_API_DIR)/1.txt 1 \
231 -since $(CM_SRC_API_DIR)/2.txt 2
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700232
233$(full_target): $(cm_framework_built) $(gen)
234include $(BUILD_DROIDDOC)
235
Adnan Begovic37fc76f2015-05-05 17:37:05 -0700236include $(call first-makefiles-under,$(LOCAL_PATH))
237
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700238# Cleanup temp vars
239# ===========================================================
240cmplat.docs.src_files :=
241cmplat.docs.java_libraries :=
242intermediates.COMMON :=