You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

325 lines
12 KiB

  1. # 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.
  14. LOCAL_PATH := $(call my-dir)
  15. # We have a special case here where we build the library's resources
  16. # independently from its code, so we need to find where the resource
  17. # class source got placed in the course of building the resources.
  18. # Thus, the magic here.
  19. # Also, this module cannot depend directly on the R.java file; if it
  20. # did, the PRIVATE_* vars for R.java wouldn't be guaranteed to be correct.
  21. # Instead, it depends on the R.stamp file, which lists the corresponding
  22. # R.java file as a prerequisite.
  23. cm_platform_res := APPS/org.cyanogenmod.platform-res_intermediates/src
  24. # List of packages used in cm-api-stubs and cm-system-api-stubs
  25. cm_stub_packages := cyanogenmod.alarmclock:cyanogenmod.app:cyanogenmod.content:cyanogenmod.externalviews:cyanogenmod.hardware:cyanogenmod.media:cyanogenmod.os:cyanogenmod.profiles:cyanogenmod.providers:cyanogenmod.platform:cyanogenmod.power:cyanogenmod.themes:cyanogenmod.util:cyanogenmod.weather:cyanogenmod.weatherservice
  26. # The CyanogenMod Platform Framework Library
  27. # ============================================================
  28. include $(CLEAR_VARS)
  29. cyanogenmod_sdk_src := sdk/src/java/cyanogenmod
  30. cyanogenmod_sdk_internal_src := sdk/src/java/org/cyanogenmod/internal
  31. library_src := cm/lib/main/java
  32. LOCAL_MODULE := org.cyanogenmod.platform
  33. LOCAL_MODULE_TAGS := optional
  34. LOCAL_JAVA_LIBRARIES := \
  35. services \
  36. org.cyanogenmod.hardware
  37. LOCAL_SRC_FILES := \
  38. $(call all-java-files-under, $(cyanogenmod_sdk_src)) \
  39. $(call all-java-files-under, $(cyanogenmod_sdk_internal_src)) \
  40. $(call all-java-files-under, $(library_src))
  41. ## READ ME: ########################################################
  42. ##
  43. ## When updating this list of aidl files, consider if that aidl is
  44. ## part of the SDK API. If it is, also add it to the list below that
  45. ## is preprocessed and distributed with the SDK. This list should
  46. ## not contain any aidl files for parcelables, but the one below should
  47. ## if you intend for 3rd parties to be able to send those objects
  48. ## across process boundaries.
  49. ##
  50. ## READ ME: ########################################################
  51. LOCAL_SRC_FILES += \
  52. $(call all-Iaidl-files-under, $(cyanogenmod_sdk_src)) \
  53. $(call all-Iaidl-files-under, $(cyanogenmod_sdk_internal_src))
  54. cmplat_LOCAL_INTERMEDIATE_SOURCES := \
  55. $(cm_platform_res)/cyanogenmod/platform/R.java \
  56. $(cm_platform_res)/cyanogenmod/platform/Manifest.java \
  57. $(cm_platform_res)/org/cyanogenmod/platform/internal/R.java
  58. LOCAL_INTERMEDIATE_SOURCES := \
  59. $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
  60. # Include aidl files from cyanogenmod.app namespace as well as internal src aidl files
  61. LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/sdk/src/java
  62. LOCAL_AIDL_FLAGS := -n
  63. include $(BUILD_JAVA_LIBRARY)
  64. cm_framework_module := $(LOCAL_INSTALLED_MODULE)
  65. # Make sure that R.java and Manifest.java are built before we build
  66. # the source for this library.
  67. cm_framework_res_R_stamp := \
  68. $(call intermediates-dir-for,APPS,org.cyanogenmod.platform-res,,COMMON)/src/R.stamp
  69. $(full_classes_compiled_jar): $(cm_framework_res_R_stamp)
  70. $(built_dex_intermediate): $(cm_framework_res_R_stamp)
  71. $(cm_framework_module): | $(dir $(cm_framework_module))org.cyanogenmod.platform-res.apk
  72. cm_framework_built := $(call java-lib-deps, org.cyanogenmod.platform)
  73. # ==== org.cyanogenmod.platform.xml lib def ========================
  74. include $(CLEAR_VARS)
  75. LOCAL_MODULE := org.cyanogenmod.platform.xml
  76. LOCAL_MODULE_TAGS := optional
  77. LOCAL_MODULE_CLASS := ETC
  78. # This will install the file in /system/etc/permissions
  79. LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
  80. LOCAL_SRC_FILES := $(LOCAL_MODULE)
  81. include $(BUILD_PREBUILT)
  82. # the sdk
  83. # ============================================================
  84. include $(CLEAR_VARS)
  85. LOCAL_MODULE:= org.cyanogenmod.platform.sdk
  86. LOCAL_MODULE_TAGS := optional
  87. LOCAL_REQUIRED_MODULES := services
  88. LOCAL_SRC_FILES := \
  89. $(call all-java-files-under, $(cyanogenmod_sdk_src)) \
  90. $(call all-Iaidl-files-under, $(cyanogenmod_sdk_src)) \
  91. $(call all-Iaidl-files-under, $(cyanogenmod_sdk_internal_src))
  92. # Included aidl files from cyanogenmod.app namespace
  93. LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/sdk/src/java
  94. cmsdk_LOCAL_INTERMEDIATE_SOURCES := \
  95. $(cm_platform_res)/cyanogenmod/platform/R.java \
  96. $(cm_platform_res)/cyanogenmod/platform/Manifest.java
  97. LOCAL_INTERMEDIATE_SOURCES := \
  98. $(cmsdk_LOCAL_INTERMEDIATE_SOURCES)
  99. # Make sure that R.java and Manifest.java are built before we build
  100. # the source for this library.
  101. cm_framework_res_R_stamp := \
  102. $(call intermediates-dir-for,APPS,org.cyanogenmod.platform-res,,COMMON)/src/R.stamp
  103. $(full_classes_compiled_jar): $(cm_framework_res_R_stamp)
  104. $(built_dex_intermediate): $(cm_framework_res_R_stamp)
  105. $(full_target): $(cm_framework_built) $(gen)
  106. include $(BUILD_STATIC_JAVA_LIBRARY)
  107. # the sdk as an aar for publish, not built as part of full target
  108. # DO NOT LINK AGAINST THIS IN BUILD
  109. # ============================================================
  110. include $(CLEAR_VARS)
  111. LOCAL_MODULE := org.cyanogenmod.platform.sdk.aar
  112. LOCAL_JACK_ENABLED := disabled
  113. # just need to define this, $(TOP)/dummy should not exist
  114. LOCAL_SRC_FILES := $(call all-java-files-under, dummy)
  115. LOCAL_CONSUMER_PROGUARD_FILE := $(LOCAL_PATH)/sdk/proguard.txt
  116. LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, sdk/res/res)
  117. LOCAL_MANIFEST_FILE := sdk/AndroidManifest.xml
  118. cmsdk_exclude_files := 'cyanogenmod/library'
  119. LOCAL_JAR_EXCLUDE_PACKAGES := $(cmsdk_exclude_files)
  120. LOCAL_JAR_EXCLUDE_FILES := none
  121. LOCAL_STATIC_JAVA_LIBRARIES := org.cyanogenmod.platform.sdk
  122. include $(BUILD_STATIC_JAVA_LIBRARY)
  123. $(LOCAL_MODULE) : $(built_aar)
  124. # full target for use by platform apps
  125. #
  126. include $(CLEAR_VARS)
  127. LOCAL_MODULE:= org.cyanogenmod.platform.internal
  128. LOCAL_MODULE_TAGS := optional
  129. LOCAL_REQUIRED_MODULES := services
  130. LOCAL_SRC_FILES := \
  131. $(call all-java-files-under, $(cyanogenmod_sdk_src)) \
  132. $(call all-java-files-under, $(cyanogenmod_sdk_internal_src)) \
  133. $(call all-Iaidl-files-under, $(cyanogenmod_sdk_src)) \
  134. $(call all-Iaidl-files-under, $(cyanogenmod_sdk_internal_src))
  135. # Included aidl files from cyanogenmod.app namespace
  136. LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/sdk/src/java
  137. LOCAL_AIDL_FLAGS := -n
  138. cmsdk_LOCAL_INTERMEDIATE_SOURCES := \
  139. $(cm_platform_res)/cyanogenmod/platform/R.java \
  140. $(cm_platform_res)/cyanogenmod/platform/Manifest.java \
  141. $(cm_platform_res)/org/cyanogenmod/platform/internal/R.java \
  142. $(cm_platform_res)/org/cyanogenmod/platform/internal/Manifest.java
  143. LOCAL_INTERMEDIATE_SOURCES := \
  144. $(cmsdk_LOCAL_INTERMEDIATE_SOURCES)
  145. $(full_target): $(cm_framework_built) $(gen)
  146. include $(BUILD_STATIC_JAVA_LIBRARY)
  147. # ===========================================================
  148. # Common Droiddoc vars
  149. cmplat_docs_src_files := \
  150. $(call all-java-files-under, $(cyanogenmod_sdk_src)) \
  151. $(call all-html-files-under, $(cyanogenmod_sdk_src))
  152. cmplat_docs_java_libraries := \
  153. org.cyanogenmod.platform.sdk
  154. # SDK version as defined
  155. cmplat_docs_SDK_VERSION := 13.0
  156. # release version
  157. cmplat_docs_SDK_REL_ID := 6
  158. cmplat_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
  159. cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
  160. $(cmplat_docs_src_files)
  161. intermediates.COMMON := $(call intermediates-dir-for,$(LOCAL_MODULE_CLASS), org.cyanogenmod.platform.sdk,,COMMON)
  162. # ==== the api stubs and current.xml ===========================
  163. include $(CLEAR_VARS)
  164. LOCAL_SRC_FILES:= \
  165. $(cmplat_docs_src_files)
  166. LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
  167. LOCAL_JAVA_LIBRARIES:= $(cmplat_docs_java_libraries)
  168. LOCAL_MODULE_CLASS:= $(cmplat_docs_LOCAL_MODULE_CLASS)
  169. LOCAL_DROIDDOC_SOURCE_PATH:= $(cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH)
  170. LOCAL_ADDITIONAL_JAVA_DIR:= $(intermediates.COMMON)/src
  171. LOCAL_ADDITIONAL_DEPENDENCIES:= $(cmplat_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
  172. LOCAL_MODULE := cm-api-stubs
  173. LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= build/tools/droiddoc/templates-sdk
  174. LOCAL_DROIDDOC_OPTIONS:= \
  175. -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/cmsdk_stubs_current_intermediates/src \
  176. -stubpackages $(cm_stub_packages) \
  177. -exclude org.cyanogenmod.platform.internal \
  178. -api $(INTERNAL_CM_PLATFORM_API_FILE) \
  179. -removedApi $(INTERNAL_CM_PLATFORM_REMOVED_API_FILE) \
  180. -nodocs
  181. LOCAL_UNINSTALLABLE_MODULE := true
  182. include $(BUILD_DROIDDOC)
  183. # $(gen), i.e. framework.aidl, is also needed while building against the current stub.
  184. $(full_target): $(cm_framework_built) $(gen)
  185. $(INTERNAL_CM_PLATFORM_API_FILE): $(full_target)
  186. $(call dist-for-goals,sdk,$(INTERNAL_CM_PLATFORM_API_FILE))
  187. # ==== the system api stubs ===================================
  188. include $(CLEAR_VARS)
  189. LOCAL_SRC_FILES:= \
  190. $(cmplat_docs_src_files)
  191. LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
  192. LOCAL_JAVA_LIBRARIES:= $(cmplat_docs_java_libraries)
  193. LOCAL_MODULE_CLASS:= $(cmplat_docs_LOCAL_MODULE_CLASS)
  194. LOCAL_DROIDDOC_SOURCE_PATH:= $(cmplat_docs_LOCAL_DROIDDOC_SOURCE_PATH)
  195. LOCAL_ADDITIONAL_JAVA_DIR:= $(intermediates.COMMON)/src
  196. LOCAL_MODULE := cm-system-api-stubs
  197. LOCAL_DROIDDOC_OPTIONS:=\
  198. -stubs $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/cmsdk_system_stubs_current_intermediates/src \
  199. -stubpackages $(cm_stub_packages) \
  200. -showAnnotation android.annotation.SystemApi \
  201. -exclude org.cyanogenmod.platform.internal \
  202. -api $(INTERNAL_CM_PLATFORM_SYSTEM_API_FILE) \
  203. -removedApi $(INTERNAL_CM_PLATFORM_SYSTEM_REMOVED_API_FILE) \
  204. -nodocs
  205. LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= build/tools/droiddoc/templates-sdk
  206. LOCAL_UNINSTALLABLE_MODULE := true
  207. include $(BUILD_DROIDDOC)
  208. # $(gen), i.e. framework.aidl, is also needed while building against the current stub.
  209. $(full_target): $(cm_framework_built) $(gen)
  210. $(INTERNAL_CM_PLATFORM_API_FILE): $(full_target)
  211. $(call dist-for-goals,sdk,$(INTERNAL_CM_PLATFORM_API_FILE))
  212. # Documentation
  213. # ===========================================================
  214. include $(CLEAR_VARS)
  215. LOCAL_MODULE := org.cyanogenmod.platform.sdk
  216. LOCAL_INTERMEDIATE_SOURCES:= $(cmplat_LOCAL_INTERMEDIATE_SOURCES)
  217. LOCAL_MODULE_CLASS := JAVA_LIBRARIES
  218. LOCAL_MODULE_TAGS := optional
  219. LOCAL_SRC_FILES := $(cmplat_docs_src_files)
  220. LOCAL_ADDITONAL_JAVA_DIR := $(intermediates.COMMON)/src
  221. LOCAL_IS_HOST_MODULE := false
  222. LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := vendor/replicant/build/tools/droiddoc/templates-cmsdk
  223. LOCAL_ADDITIONAL_DEPENDENCIES := \
  224. services \
  225. org.cyanogenmod.hardware
  226. LOCAL_JAVA_LIBRARIES := $(cmplat_docs_java_libraries)
  227. LOCAL_DROIDDOC_OPTIONS := \
  228. -offlinemode \
  229. -exclude org.cyanogenmod.platform.internal \
  230. -hidePackage org.cyanogenmod.platform.internal \
  231. -hdf android.whichdoc offline \
  232. -hdf sdk.version $(cmplat_docs_docs_SDK_VERSION) \
  233. -hdf sdk.rel.id $(cmplat_docs_docs_SDK_REL_ID) \
  234. -hdf sdk.preview 0 \
  235. -since $(CM_SRC_API_DIR)/1.txt 1 \
  236. -since $(CM_SRC_API_DIR)/2.txt 2 \
  237. -since $(CM_SRC_API_DIR)/3.txt 3 \
  238. -since $(CM_SRC_API_DIR)/4.txt 4 \
  239. -since $(CM_SRC_API_DIR)/5.txt 5 \
  240. -since $(CM_SRC_API_DIR)/6.txt 6
  241. $(full_target): $(cm_framework_built) $(gen)
  242. include $(BUILD_DROIDDOC)
  243. include $(call first-makefiles-under,$(LOCAL_PATH))
  244. # Cleanup temp vars
  245. # ===========================================================
  246. cmplat.docs.src_files :=
  247. cmplat.docs.java_libraries :=
  248. intermediates.COMMON :=