blob: 412ce3011967826b0df39ad32bb49b1d939a7f6e [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
Joeyd5e79622023-05-17 20:55:33 +02003# 2017-2023 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
Adnan Begovicaa8614e2015-04-23 23:16:27 -070046# ===========================================================
47# Common Droiddoc vars
Sam Mortimer542742b2017-09-18 19:44:11 -070048lineage_platform_docs_src_files := \
49 $(call all-java-files-under, $(lineage_sdk_src)) \
50 $(call all-html-files-under, $(lineage_sdk_src))
Adnan Begovic62c951e2015-05-28 16:13:04 -070051
Sam Mortimer542742b2017-09-18 19:44:11 -070052lineage_platform_docs_java_libraries := \
Sam Mortimer3533d382019-05-13 15:28:04 -070053 org.lineageos.platform.sdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070054
Adnan Begovic62c951e2015-05-28 16:13:04 -070055# SDK version as defined
Michael Bestas3031b612018-01-01 03:20:01 +020056lineage_platform_docs_SDK_VERSION := 15.1
Adnan Begovic62c951e2015-05-28 16:13:04 -070057
58# release version
Joeyfdd21f42018-03-11 15:15:29 +010059lineage_platform_docs_SDK_REL_ID := 9
Adnan Begovic62c951e2015-05-28 16:13:04 -070060
Sam Mortimer542742b2017-09-18 19:44:11 -070061lineage_platform_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
Adnan Begovic62c951e2015-05-28 16:13:04 -070062
Sam Mortimer542742b2017-09-18 19:44:11 -070063lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
64 $(lineage_platform_docs_src_files)
Adnan Begovic62c951e2015-05-28 16:13:04 -070065
Sam Mortimer0bc91412017-09-19 21:16:40 -070066lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR := \
67 $(call intermediates-dir-for,JAVA_LIBRARIES,org.lineageos.platform.sdk,,COMMON)
Adnan Begovic62c951e2015-05-28 16:13:04 -070068
69# ==== the api stubs and current.xml ===========================
70include $(CLEAR_VARS)
71
72LOCAL_SRC_FILES:= \
Sam Mortimer542742b2017-09-18 19:44:11 -070073 $(lineage_platform_docs_src_files)
74LOCAL_INTERMEDIATE_SOURCES:= $(lineage_platform_LOCAL_INTERMEDIATE_SOURCES)
75LOCAL_JAVA_LIBRARIES:= $(lineage_platform_docs_java_libraries)
76LOCAL_MODULE_CLASS:= $(lineage_platform_docs_LOCAL_MODULE_CLASS)
77LOCAL_DROIDDOC_SOURCE_PATH:= $(lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH)
Sam Mortimer0bc91412017-09-19 21:16:40 -070078LOCAL_ADDITIONAL_JAVA_DIR:= $(lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR)
Sam Mortimer542742b2017-09-18 19:44:11 -070079LOCAL_ADDITIONAL_DEPENDENCIES:= $(lineage_platform_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
Adnan Begovic62c951e2015-05-28 16:13:04 -070080
Sam Mortimer542742b2017-09-18 19:44:11 -070081LOCAL_MODULE := lineage-api-stubs
Adnan Begovic62c951e2015-05-28 16:13:04 -070082
dianlujitao2cf37e42017-12-07 21:52:29 +080083LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= external/doclava/res/assets/templates-sdk
Adnan Begovic62c951e2015-05-28 16:13:04 -070084
Ying Wangd42a6582015-07-16 14:20:22 -070085LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/lineage-sdk_stubs_current_intermediates/src
86
Adnan Begovic62c951e2015-05-28 16:13:04 -070087LOCAL_DROIDDOC_OPTIONS:= \
smain@google.com8b356432016-09-01 19:52:17 -070088 -referenceonly \
Sam Mortimer542742b2017-09-18 19:44:11 -070089 -stubpackages $(lineage_stub_packages) \
90 -exclude org.lineageos.platform.internal \
91 -api $(INTERNAL_LINEAGE_PLATFORM_API_FILE) \
92 -removedApi $(INTERNAL_LINEAGE_PLATFORM_REMOVED_API_FILE) \
Adnan Begovicc02c64b2016-02-09 11:05:20 -080093 -nodocs
Adnan Begovic62c951e2015-05-28 16:13:04 -070094
95LOCAL_UNINSTALLABLE_MODULE := true
96
Sam Mortimer29e2f6b2019-09-05 14:52:51 -070097#include $(BUILD_DROIDDOC)
Adnan Begovic62c951e2015-05-28 16:13:04 -070098
Adnan Begovic7bdcaa52015-12-22 11:04:08 -080099# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
Sam Mortimer542742b2017-09-18 19:44:11 -0700100$(full_target): $(lineage_framework_built) $(gen)
101$(INTERNAL_LINEAGE_PLATFORM_API_FILE): $(full_target)
102$(call dist-for-goals,sdk,$(INTERNAL_LINEAGE_PLATFORM_API_FILE))
Adnan Begovic62c951e2015-05-28 16:13:04 -0700103
Adnan Begovic62c951e2015-05-28 16:13:04 -0700104
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700105# Documentation
106# ===========================================================
107include $(CLEAR_VARS)
108
Sam Mortimer542742b2017-09-18 19:44:11 -0700109LOCAL_MODULE := org.lineageos.platform.sdk
110LOCAL_INTERMEDIATE_SOURCES:= $(lineage_platform_LOCAL_INTERMEDIATE_SOURCES)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700111LOCAL_MODULE_CLASS := JAVA_LIBRARIES
112LOCAL_MODULE_TAGS := optional
113
Sam Mortimer542742b2017-09-18 19:44:11 -0700114LOCAL_SRC_FILES := $(lineage_platform_docs_src_files)
Sam Mortimer0bc91412017-09-19 21:16:40 -0700115LOCAL_ADDITONAL_JAVA_DIR := $(lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700116
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700117LOCAL_IS_HOST_MODULE := false
Sam Mortimer542742b2017-09-18 19:44:11 -0700118LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := vendor/lineage/build/tools/droiddoc/templates-lineage-sdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700119LOCAL_ADDITIONAL_DEPENDENCIES := \
Paul Keitheb055192019-02-19 17:38:01 +0100120 services
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700121
Sam Mortimer542742b2017-09-18 19:44:11 -0700122LOCAL_JAVA_LIBRARIES := $(lineage_platform_docs_java_libraries)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700123
124LOCAL_DROIDDOC_OPTIONS := \
Jeff Sharkeyd1539622017-04-24 18:06:20 -0600125 -android \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700126 -offlinemode \
Sam Mortimer542742b2017-09-18 19:44:11 -0700127 -exclude org.lineageos.platform.internal \
128 -hidePackage org.lineageos.platform.internal \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700129 -hdf android.whichdoc offline \
Sam Mortimer542742b2017-09-18 19:44:11 -0700130 -hdf sdk.version $(lineage_platform_docs_docs_SDK_VERSION) \
131 -hdf sdk.rel.id $(lineage_platform_docs_docs_SDK_REL_ID) \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700132 -hdf sdk.preview 0 \
Sam Mortimer542742b2017-09-18 19:44:11 -0700133 -since $(LINEAGE_SRC_API_DIR)/1.txt 1 \
134 -since $(LINEAGE_SRC_API_DIR)/2.txt 2 \
135 -since $(LINEAGE_SRC_API_DIR)/3.txt 3 \
136 -since $(LINEAGE_SRC_API_DIR)/4.txt 4 \
137 -since $(LINEAGE_SRC_API_DIR)/5.txt 5 \
138 -since $(LINEAGE_SRC_API_DIR)/6.txt 6 \
Michael Bestas3031b612018-01-01 03:20:01 +0200139 -since $(LINEAGE_SRC_API_DIR)/7.txt 7 \
Joeyfdd21f42018-03-11 15:15:29 +0100140 -since $(LINEAGE_SRC_API_DIR)/8.txt 8 \
141 -since $(LINEAGE_SRC_API_DIR)/9.txt 9
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700142
Sam Mortimer542742b2017-09-18 19:44:11 -0700143$(full_target): $(lineage_framework_built) $(gen)
Sam Mortimer29e2f6b2019-09-05 14:52:51 -0700144#include $(BUILD_DROIDDOC)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700145
Adnan Begovic37fc76f2015-05-05 17:37:05 -0700146include $(call first-makefiles-under,$(LOCAL_PATH))
147
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700148# Cleanup temp vars
149# ===========================================================
Sam Mortimer542742b2017-09-18 19:44:11 -0700150lineage_platform_docs_src_files :=
151lineage_platform_docs_java_libraries :=
Sam Mortimer0bc91412017-09-19 21:16:40 -0700152lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR :=