blob: d4247595a8b178bb62223af135e2adb7ffc7cd9f [file] [log] [blame]
Bruno Martins9265e402022-01-14 19:00:42 +00001#
Adnan Begovicaa8614e2015-04-23 23:16:27 -07002# Copyright (C) 2015 The CyanogenMod Project
Bruno Martins9265e402022-01-14 19:00:42 +00003# 2017-2022 The LineageOS Project
Adnan Begovicaa8614e2015-04-23 23:16:27 -07004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Bruno Martins9265e402022-01-14 19:00:42 +000016#
Adnan Begovicaa8614e2015-04-23 23:16:27 -070017LOCAL_PATH := $(call my-dir)
18
LuK133731ed8722020-09-15 02:29:56 +020019include $(CLEAR_VARS)
20
Adnan Begovic37fc76f2015-05-05 17:37:05 -070021# We have a special case here where we build the library's resources
22# independently from its code, so we need to find where the resource
23# class source got placed in the course of building the resources.
24# Thus, the magic here.
25# Also, this module cannot depend directly on the R.java file; if it
26# did, the PRIVATE_* vars for R.java wouldn't be guaranteed to be correct.
27# Instead, it depends on the R.stamp file, which lists the corresponding
28# R.java file as a prerequisite.
Sam Mortimerd6ad8852018-08-08 23:27:12 -070029lineage_platform_res := APPS/org.lineageos.platform-res_intermediates/aapt
Adnan Begovic37fc76f2015-05-05 17:37:05 -070030
Sam Mortimer542742b2017-09-18 19:44:11 -070031# List of packages used in lineage-api-stubs
Bruno Martins7242fc82022-01-14 21:08:33 +000032lineage_stub_packages := lineageos.app:lineageos.content:lineageos.hardware:lineageos.media:lineageos.os:lineageos.preference:lineageos.profiles:lineageos.providers:lineageos.platform:lineageos.util:lineageos.trust
d34df2fd8362016-03-04 16:07:39 -080033
Sam Mortimer542742b2017-09-18 19:44:11 -070034lineage_framework_module := $(LOCAL_INSTALLED_MODULE)
Adnan Begovic37fc76f2015-05-05 17:37:05 -070035
36# Make sure that R.java and Manifest.java are built before we build
37# the source for this library.
Sam Mortimer542742b2017-09-18 19:44:11 -070038lineage_framework_res_R_stamp := \
39 $(call intermediates-dir-for,APPS,org.lineageos.platform-res,,COMMON)/src/R.stamp
Colin Cross3276a6b2017-10-11 21:34:17 -070040LOCAL_ADDITIONAL_DEPENDENCIES := $(lineage_framework_res_R_stamp)
Adnan Begovic37fc76f2015-05-05 17:37:05 -070041
Sam Mortimer542742b2017-09-18 19:44:11 -070042$(lineage_framework_module): | $(dir $(lineage_framework_module))org.lineageos.platform-res.apk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070043
Sam Mortimer542742b2017-09-18 19:44:11 -070044lineage_framework_built := $(call java-lib-deps, org.lineageos.platform)
Adnan Begovicaa8614e2015-04-23 23:16:27 -070045
Roman Birg620b1eb2016-03-22 14:21:05 -070046# the sdk as an aar for publish, not built as part of full target
Adnan Begovicbbab82e2016-01-05 14:15:09 -080047# DO NOT LINK AGAINST THIS IN BUILD
48# ============================================================
49include $(CLEAR_VARS)
50
Sam Mortimer542742b2017-09-18 19:44:11 -070051LOCAL_MODULE := org.lineageos.platform.sdk.aar
Roman Birg620b1eb2016-03-22 14:21:05 -070052
Adnan Begovicbbab82e2016-01-05 14:15:09 -080053LOCAL_JACK_ENABLED := disabled
54
Jorge Ruesgac6550fd2016-04-29 14:27:41 +020055LOCAL_CONSUMER_PROGUARD_FILE := $(LOCAL_PATH)/sdk/proguard.txt
Adnan Begovicbbab82e2016-01-05 14:15:09 -080056
Roman Birg620b1eb2016-03-22 14:21:05 -070057LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, sdk/res/res)
58LOCAL_MANIFEST_FILE := sdk/AndroidManifest.xml
Adnan Begovicbbab82e2016-01-05 14:15:09 -080059
Sam Mortimer542742b2017-09-18 19:44:11 -070060lineage_sdk_exclude_files := 'lineageos/library'
61LOCAL_JAR_EXCLUDE_PACKAGES := $(lineage_sdk_exclude_files)
Adnan Begovic62604cf2016-04-13 09:51:21 -070062LOCAL_JAR_EXCLUDE_FILES := none
63
Sam Mortimer542742b2017-09-18 19:44:11 -070064LOCAL_STATIC_JAVA_LIBRARIES := org.lineageos.platform.sdk
Adnan Begovicbbab82e2016-01-05 14:15:09 -080065
66include $(BUILD_STATIC_JAVA_LIBRARY)
Roman Birg620b1eb2016-03-22 14:21:05 -070067$(LOCAL_MODULE) : $(built_aar)
Adnan Begovicbbab82e2016-01-05 14:15:09 -080068
Adnan Begovicaa8614e2015-04-23 23:16:27 -070069# ===========================================================
70# Common Droiddoc vars
Sam Mortimer542742b2017-09-18 19:44:11 -070071lineage_platform_docs_src_files := \
72 $(call all-java-files-under, $(lineage_sdk_src)) \
73 $(call all-html-files-under, $(lineage_sdk_src))
Adnan Begovic62c951e2015-05-28 16:13:04 -070074
Sam Mortimer542742b2017-09-18 19:44:11 -070075lineage_platform_docs_java_libraries := \
Sam Mortimer3533d382019-05-13 15:28:04 -070076 org.lineageos.platform.sdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070077
Adnan Begovic62c951e2015-05-28 16:13:04 -070078# SDK version as defined
Michael Bestas3031b612018-01-01 03:20:01 +020079lineage_platform_docs_SDK_VERSION := 15.1
Adnan Begovic62c951e2015-05-28 16:13:04 -070080
81# release version
Joeyfdd21f42018-03-11 15:15:29 +010082lineage_platform_docs_SDK_REL_ID := 9
Adnan Begovic62c951e2015-05-28 16:13:04 -070083
Sam Mortimer542742b2017-09-18 19:44:11 -070084lineage_platform_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
Adnan Begovic62c951e2015-05-28 16:13:04 -070085
Sam Mortimer542742b2017-09-18 19:44:11 -070086lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
87 $(lineage_platform_docs_src_files)
Adnan Begovic62c951e2015-05-28 16:13:04 -070088
Sam Mortimer0bc91412017-09-19 21:16:40 -070089lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR := \
90 $(call intermediates-dir-for,JAVA_LIBRARIES,org.lineageos.platform.sdk,,COMMON)
Adnan Begovic62c951e2015-05-28 16:13:04 -070091
92# ==== the api stubs and current.xml ===========================
93include $(CLEAR_VARS)
94
95LOCAL_SRC_FILES:= \
Sam Mortimer542742b2017-09-18 19:44:11 -070096 $(lineage_platform_docs_src_files)
97LOCAL_INTERMEDIATE_SOURCES:= $(lineage_platform_LOCAL_INTERMEDIATE_SOURCES)
98LOCAL_JAVA_LIBRARIES:= $(lineage_platform_docs_java_libraries)
99LOCAL_MODULE_CLASS:= $(lineage_platform_docs_LOCAL_MODULE_CLASS)
100LOCAL_DROIDDOC_SOURCE_PATH:= $(lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH)
Sam Mortimer0bc91412017-09-19 21:16:40 -0700101LOCAL_ADDITIONAL_JAVA_DIR:= $(lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR)
Sam Mortimer542742b2017-09-18 19:44:11 -0700102LOCAL_ADDITIONAL_DEPENDENCIES:= $(lineage_platform_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
Adnan Begovic62c951e2015-05-28 16:13:04 -0700103
Sam Mortimer542742b2017-09-18 19:44:11 -0700104LOCAL_MODULE := lineage-api-stubs
Adnan Begovic62c951e2015-05-28 16:13:04 -0700105
dianlujitao2cf37e42017-12-07 21:52:29 +0800106LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= external/doclava/res/assets/templates-sdk
Adnan Begovic62c951e2015-05-28 16:13:04 -0700107
Ying Wangd42a6582015-07-16 14:20:22 -0700108LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/lineage-sdk_stubs_current_intermediates/src
109
Adnan Begovic62c951e2015-05-28 16:13:04 -0700110LOCAL_DROIDDOC_OPTIONS:= \
smain@google.com8b356432016-09-01 19:52:17 -0700111 -referenceonly \
Sam Mortimer542742b2017-09-18 19:44:11 -0700112 -stubpackages $(lineage_stub_packages) \
113 -exclude org.lineageos.platform.internal \
114 -api $(INTERNAL_LINEAGE_PLATFORM_API_FILE) \
115 -removedApi $(INTERNAL_LINEAGE_PLATFORM_REMOVED_API_FILE) \
Adnan Begovicc02c64b2016-02-09 11:05:20 -0800116 -nodocs
Adnan Begovic62c951e2015-05-28 16:13:04 -0700117
118LOCAL_UNINSTALLABLE_MODULE := true
119
Sam Mortimer29e2f6b2019-09-05 14:52:51 -0700120#include $(BUILD_DROIDDOC)
Adnan Begovic62c951e2015-05-28 16:13:04 -0700121
Adnan Begovic7bdcaa52015-12-22 11:04:08 -0800122# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
Sam Mortimer542742b2017-09-18 19:44:11 -0700123$(full_target): $(lineage_framework_built) $(gen)
124$(INTERNAL_LINEAGE_PLATFORM_API_FILE): $(full_target)
125$(call dist-for-goals,sdk,$(INTERNAL_LINEAGE_PLATFORM_API_FILE))
Adnan Begovic62c951e2015-05-28 16:13:04 -0700126
Adnan Begovic62c951e2015-05-28 16:13:04 -0700127
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700128# Documentation
129# ===========================================================
130include $(CLEAR_VARS)
131
Sam Mortimer542742b2017-09-18 19:44:11 -0700132LOCAL_MODULE := org.lineageos.platform.sdk
133LOCAL_INTERMEDIATE_SOURCES:= $(lineage_platform_LOCAL_INTERMEDIATE_SOURCES)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700134LOCAL_MODULE_CLASS := JAVA_LIBRARIES
135LOCAL_MODULE_TAGS := optional
136
Sam Mortimer542742b2017-09-18 19:44:11 -0700137LOCAL_SRC_FILES := $(lineage_platform_docs_src_files)
Sam Mortimer0bc91412017-09-19 21:16:40 -0700138LOCAL_ADDITONAL_JAVA_DIR := $(lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700139
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700140LOCAL_IS_HOST_MODULE := false
Sam Mortimer542742b2017-09-18 19:44:11 -0700141LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := vendor/lineage/build/tools/droiddoc/templates-lineage-sdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700142LOCAL_ADDITIONAL_DEPENDENCIES := \
Paul Keitheb055192019-02-19 17:38:01 +0100143 services
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700144
Sam Mortimer542742b2017-09-18 19:44:11 -0700145LOCAL_JAVA_LIBRARIES := $(lineage_platform_docs_java_libraries)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700146
147LOCAL_DROIDDOC_OPTIONS := \
Jeff Sharkeyd1539622017-04-24 18:06:20 -0600148 -android \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700149 -offlinemode \
Sam Mortimer542742b2017-09-18 19:44:11 -0700150 -exclude org.lineageos.platform.internal \
151 -hidePackage org.lineageos.platform.internal \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700152 -hdf android.whichdoc offline \
Sam Mortimer542742b2017-09-18 19:44:11 -0700153 -hdf sdk.version $(lineage_platform_docs_docs_SDK_VERSION) \
154 -hdf sdk.rel.id $(lineage_platform_docs_docs_SDK_REL_ID) \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700155 -hdf sdk.preview 0 \
Sam Mortimer542742b2017-09-18 19:44:11 -0700156 -since $(LINEAGE_SRC_API_DIR)/1.txt 1 \
157 -since $(LINEAGE_SRC_API_DIR)/2.txt 2 \
158 -since $(LINEAGE_SRC_API_DIR)/3.txt 3 \
159 -since $(LINEAGE_SRC_API_DIR)/4.txt 4 \
160 -since $(LINEAGE_SRC_API_DIR)/5.txt 5 \
161 -since $(LINEAGE_SRC_API_DIR)/6.txt 6 \
Michael Bestas3031b612018-01-01 03:20:01 +0200162 -since $(LINEAGE_SRC_API_DIR)/7.txt 7 \
Joeyfdd21f42018-03-11 15:15:29 +0100163 -since $(LINEAGE_SRC_API_DIR)/8.txt 8 \
164 -since $(LINEAGE_SRC_API_DIR)/9.txt 9
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700165
Sam Mortimer542742b2017-09-18 19:44:11 -0700166$(full_target): $(lineage_framework_built) $(gen)
Sam Mortimer29e2f6b2019-09-05 14:52:51 -0700167#include $(BUILD_DROIDDOC)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700168
Adnan Begovic37fc76f2015-05-05 17:37:05 -0700169include $(call first-makefiles-under,$(LOCAL_PATH))
170
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700171# Cleanup temp vars
172# ===========================================================
Sam Mortimer542742b2017-09-18 19:44:11 -0700173lineage_platform_docs_src_files :=
174lineage_platform_docs_java_libraries :=
Sam Mortimer0bc91412017-09-19 21:16:40 -0700175lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR :=