blob: 36177b17bc4f3b19f86417f0c936a6453db66c53 [file] [log] [blame]
Adnan Begovicaa8614e2015-04-23 23:16:27 -07001# Copyright (C) 2015 The CyanogenMod Project
LuK133731ed8722020-09-15 02:29:56 +02002# Copyright (C) 2017-2020 The LineageOS Project
Adnan Begovicaa8614e2015-04-23 23:16:27 -07003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Adnan Begovicaa8614e2015-04-23 23:16:27 -070015LOCAL_PATH := $(call my-dir)
16
LuK133731ed8722020-09-15 02:29:56 +020017include $(CLEAR_VARS)
18
Adnan Begovic37fc76f2015-05-05 17:37:05 -070019# We have a special case here where we build the library's resources
20# independently from its code, so we need to find where the resource
21# class source got placed in the course of building the resources.
22# Thus, the magic here.
23# Also, this module cannot depend directly on the R.java file; if it
24# did, the PRIVATE_* vars for R.java wouldn't be guaranteed to be correct.
25# Instead, it depends on the R.stamp file, which lists the corresponding
26# R.java file as a prerequisite.
Sam Mortimerd6ad8852018-08-08 23:27:12 -070027lineage_platform_res := APPS/org.lineageos.platform-res_intermediates/aapt
Adnan Begovic37fc76f2015-05-05 17:37:05 -070028
Sam Mortimer542742b2017-09-18 19:44:11 -070029# List of packages used in lineage-api-stubs
Michael Bestaseb64e792021-10-27 23:18:39 +030030lineage_stub_packages := lineageos.app:lineageos.content:lineageos.hardware:lineageos.media:lineageos.os:lineageos.preference:lineageos.profiles:lineageos.providers:lineageos.platform:lineageos.power:lineageos.util:lineageos.style:lineageos.trust
d34df2fd8362016-03-04 16:07:39 -080031
Sam Mortimer542742b2017-09-18 19:44:11 -070032lineage_framework_module := $(LOCAL_INSTALLED_MODULE)
Adnan Begovic37fc76f2015-05-05 17:37:05 -070033
34# Make sure that R.java and Manifest.java are built before we build
35# the source for this library.
Sam Mortimer542742b2017-09-18 19:44:11 -070036lineage_framework_res_R_stamp := \
37 $(call intermediates-dir-for,APPS,org.lineageos.platform-res,,COMMON)/src/R.stamp
Colin Cross3276a6b2017-10-11 21:34:17 -070038LOCAL_ADDITIONAL_DEPENDENCIES := $(lineage_framework_res_R_stamp)
Adnan Begovic37fc76f2015-05-05 17:37:05 -070039
Sam Mortimer542742b2017-09-18 19:44:11 -070040$(lineage_framework_module): | $(dir $(lineage_framework_module))org.lineageos.platform-res.apk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070041
Sam Mortimer542742b2017-09-18 19:44:11 -070042lineage_framework_built := $(call java-lib-deps, org.lineageos.platform)
Adnan Begovicaa8614e2015-04-23 23:16:27 -070043
Roman Birg620b1eb2016-03-22 14:21:05 -070044# the sdk as an aar for publish, not built as part of full target
Adnan Begovicbbab82e2016-01-05 14:15:09 -080045# DO NOT LINK AGAINST THIS IN BUILD
46# ============================================================
47include $(CLEAR_VARS)
48
Sam Mortimer542742b2017-09-18 19:44:11 -070049LOCAL_MODULE := org.lineageos.platform.sdk.aar
Roman Birg620b1eb2016-03-22 14:21:05 -070050
Adnan Begovicbbab82e2016-01-05 14:15:09 -080051LOCAL_JACK_ENABLED := disabled
52
Jorge Ruesgac6550fd2016-04-29 14:27:41 +020053LOCAL_CONSUMER_PROGUARD_FILE := $(LOCAL_PATH)/sdk/proguard.txt
Adnan Begovicbbab82e2016-01-05 14:15:09 -080054
Roman Birg620b1eb2016-03-22 14:21:05 -070055LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, sdk/res/res)
56LOCAL_MANIFEST_FILE := sdk/AndroidManifest.xml
Adnan Begovicbbab82e2016-01-05 14:15:09 -080057
Sam Mortimer542742b2017-09-18 19:44:11 -070058lineage_sdk_exclude_files := 'lineageos/library'
59LOCAL_JAR_EXCLUDE_PACKAGES := $(lineage_sdk_exclude_files)
Adnan Begovic62604cf2016-04-13 09:51:21 -070060LOCAL_JAR_EXCLUDE_FILES := none
61
Sam Mortimer542742b2017-09-18 19:44:11 -070062LOCAL_STATIC_JAVA_LIBRARIES := org.lineageos.platform.sdk
Adnan Begovicbbab82e2016-01-05 14:15:09 -080063
64include $(BUILD_STATIC_JAVA_LIBRARY)
Roman Birg620b1eb2016-03-22 14:21:05 -070065$(LOCAL_MODULE) : $(built_aar)
Adnan Begovicbbab82e2016-01-05 14:15:09 -080066
Adnan Begovicaa8614e2015-04-23 23:16:27 -070067# ===========================================================
68# Common Droiddoc vars
Sam Mortimer542742b2017-09-18 19:44:11 -070069lineage_platform_docs_src_files := \
70 $(call all-java-files-under, $(lineage_sdk_src)) \
71 $(call all-html-files-under, $(lineage_sdk_src))
Adnan Begovic62c951e2015-05-28 16:13:04 -070072
Sam Mortimer542742b2017-09-18 19:44:11 -070073lineage_platform_docs_java_libraries := \
Sam Mortimer3533d382019-05-13 15:28:04 -070074 org.lineageos.platform.sdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070075
Adnan Begovic62c951e2015-05-28 16:13:04 -070076# SDK version as defined
Michael Bestas3031b612018-01-01 03:20:01 +020077lineage_platform_docs_SDK_VERSION := 15.1
Adnan Begovic62c951e2015-05-28 16:13:04 -070078
79# release version
Joeyfdd21f42018-03-11 15:15:29 +010080lineage_platform_docs_SDK_REL_ID := 9
Adnan Begovic62c951e2015-05-28 16:13:04 -070081
Sam Mortimer542742b2017-09-18 19:44:11 -070082lineage_platform_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
Adnan Begovic62c951e2015-05-28 16:13:04 -070083
Sam Mortimer542742b2017-09-18 19:44:11 -070084lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
85 $(lineage_platform_docs_src_files)
Adnan Begovic62c951e2015-05-28 16:13:04 -070086
Sam Mortimer0bc91412017-09-19 21:16:40 -070087lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR := \
88 $(call intermediates-dir-for,JAVA_LIBRARIES,org.lineageos.platform.sdk,,COMMON)
Adnan Begovic62c951e2015-05-28 16:13:04 -070089
90# ==== the api stubs and current.xml ===========================
91include $(CLEAR_VARS)
92
93LOCAL_SRC_FILES:= \
Sam Mortimer542742b2017-09-18 19:44:11 -070094 $(lineage_platform_docs_src_files)
95LOCAL_INTERMEDIATE_SOURCES:= $(lineage_platform_LOCAL_INTERMEDIATE_SOURCES)
96LOCAL_JAVA_LIBRARIES:= $(lineage_platform_docs_java_libraries)
97LOCAL_MODULE_CLASS:= $(lineage_platform_docs_LOCAL_MODULE_CLASS)
98LOCAL_DROIDDOC_SOURCE_PATH:= $(lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH)
Sam Mortimer0bc91412017-09-19 21:16:40 -070099LOCAL_ADDITIONAL_JAVA_DIR:= $(lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR)
Sam Mortimer542742b2017-09-18 19:44:11 -0700100LOCAL_ADDITIONAL_DEPENDENCIES:= $(lineage_platform_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
Adnan Begovic62c951e2015-05-28 16:13:04 -0700101
Sam Mortimer542742b2017-09-18 19:44:11 -0700102LOCAL_MODULE := lineage-api-stubs
Adnan Begovic62c951e2015-05-28 16:13:04 -0700103
dianlujitao2cf37e42017-12-07 21:52:29 +0800104LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= external/doclava/res/assets/templates-sdk
Adnan Begovic62c951e2015-05-28 16:13:04 -0700105
Ying Wangd42a6582015-07-16 14:20:22 -0700106LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/lineage-sdk_stubs_current_intermediates/src
107
Adnan Begovic62c951e2015-05-28 16:13:04 -0700108LOCAL_DROIDDOC_OPTIONS:= \
smain@google.com8b356432016-09-01 19:52:17 -0700109 -referenceonly \
Sam Mortimer542742b2017-09-18 19:44:11 -0700110 -stubpackages $(lineage_stub_packages) \
111 -exclude org.lineageos.platform.internal \
112 -api $(INTERNAL_LINEAGE_PLATFORM_API_FILE) \
113 -removedApi $(INTERNAL_LINEAGE_PLATFORM_REMOVED_API_FILE) \
Adnan Begovicc02c64b2016-02-09 11:05:20 -0800114 -nodocs
Adnan Begovic62c951e2015-05-28 16:13:04 -0700115
116LOCAL_UNINSTALLABLE_MODULE := true
117
Sam Mortimer29e2f6b2019-09-05 14:52:51 -0700118#include $(BUILD_DROIDDOC)
Adnan Begovic62c951e2015-05-28 16:13:04 -0700119
Adnan Begovic7bdcaa52015-12-22 11:04:08 -0800120# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
Sam Mortimer542742b2017-09-18 19:44:11 -0700121$(full_target): $(lineage_framework_built) $(gen)
122$(INTERNAL_LINEAGE_PLATFORM_API_FILE): $(full_target)
123$(call dist-for-goals,sdk,$(INTERNAL_LINEAGE_PLATFORM_API_FILE))
Adnan Begovic62c951e2015-05-28 16:13:04 -0700124
Adnan Begovic62c951e2015-05-28 16:13:04 -0700125
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700126# Documentation
127# ===========================================================
128include $(CLEAR_VARS)
129
Sam Mortimer542742b2017-09-18 19:44:11 -0700130LOCAL_MODULE := org.lineageos.platform.sdk
131LOCAL_INTERMEDIATE_SOURCES:= $(lineage_platform_LOCAL_INTERMEDIATE_SOURCES)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700132LOCAL_MODULE_CLASS := JAVA_LIBRARIES
133LOCAL_MODULE_TAGS := optional
134
Sam Mortimer542742b2017-09-18 19:44:11 -0700135LOCAL_SRC_FILES := $(lineage_platform_docs_src_files)
Sam Mortimer0bc91412017-09-19 21:16:40 -0700136LOCAL_ADDITONAL_JAVA_DIR := $(lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700137
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700138LOCAL_IS_HOST_MODULE := false
Sam Mortimer542742b2017-09-18 19:44:11 -0700139LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := vendor/lineage/build/tools/droiddoc/templates-lineage-sdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700140LOCAL_ADDITIONAL_DEPENDENCIES := \
Paul Keitheb055192019-02-19 17:38:01 +0100141 services
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700142
Sam Mortimer542742b2017-09-18 19:44:11 -0700143LOCAL_JAVA_LIBRARIES := $(lineage_platform_docs_java_libraries)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700144
145LOCAL_DROIDDOC_OPTIONS := \
Jeff Sharkeyd1539622017-04-24 18:06:20 -0600146 -android \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700147 -offlinemode \
Sam Mortimer542742b2017-09-18 19:44:11 -0700148 -exclude org.lineageos.platform.internal \
149 -hidePackage org.lineageos.platform.internal \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700150 -hdf android.whichdoc offline \
Sam Mortimer542742b2017-09-18 19:44:11 -0700151 -hdf sdk.version $(lineage_platform_docs_docs_SDK_VERSION) \
152 -hdf sdk.rel.id $(lineage_platform_docs_docs_SDK_REL_ID) \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700153 -hdf sdk.preview 0 \
Sam Mortimer542742b2017-09-18 19:44:11 -0700154 -since $(LINEAGE_SRC_API_DIR)/1.txt 1 \
155 -since $(LINEAGE_SRC_API_DIR)/2.txt 2 \
156 -since $(LINEAGE_SRC_API_DIR)/3.txt 3 \
157 -since $(LINEAGE_SRC_API_DIR)/4.txt 4 \
158 -since $(LINEAGE_SRC_API_DIR)/5.txt 5 \
159 -since $(LINEAGE_SRC_API_DIR)/6.txt 6 \
Michael Bestas3031b612018-01-01 03:20:01 +0200160 -since $(LINEAGE_SRC_API_DIR)/7.txt 7 \
Joeyfdd21f42018-03-11 15:15:29 +0100161 -since $(LINEAGE_SRC_API_DIR)/8.txt 8 \
162 -since $(LINEAGE_SRC_API_DIR)/9.txt 9
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700163
Sam Mortimer542742b2017-09-18 19:44:11 -0700164$(full_target): $(lineage_framework_built) $(gen)
Sam Mortimer29e2f6b2019-09-05 14:52:51 -0700165#include $(BUILD_DROIDDOC)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700166
Adnan Begovic37fc76f2015-05-05 17:37:05 -0700167include $(call first-makefiles-under,$(LOCAL_PATH))
168
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700169# Cleanup temp vars
170# ===========================================================
Sam Mortimer542742b2017-09-18 19:44:11 -0700171lineage_platform_docs_src_files :=
172lineage_platform_docs_java_libraries :=
Sam Mortimer0bc91412017-09-19 21:16:40 -0700173lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR :=