blob: 377cbc8d6b89ffbe9bea2e263af8bb7546cd9e04 [file] [log] [blame]
Adnan Begovicaa8614e2015-04-23 23:16:27 -07001# Copyright (C) 2015 The CyanogenMod Project
Paul Keitheb055192019-02-19 17:38:01 +01002# Copyright (C) 2017-2019 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
Adnan Begovic37fc76f2015-05-05 17:37:05 -070017# We have a special case here where we build the library's resources
18# independently from its code, so we need to find where the resource
19# class source got placed in the course of building the resources.
20# Thus, the magic here.
21# Also, this module cannot depend directly on the R.java file; if it
22# did, the PRIVATE_* vars for R.java wouldn't be guaranteed to be correct.
23# Instead, it depends on the R.stamp file, which lists the corresponding
24# R.java file as a prerequisite.
Sam Mortimerd6ad8852018-08-08 23:27:12 -070025lineage_platform_res := APPS/org.lineageos.platform-res_intermediates/aapt
Adnan Begovic37fc76f2015-05-05 17:37:05 -070026
Sam Mortimer542742b2017-09-18 19:44:11 -070027# List of packages used in lineage-api-stubs
Joeyc0b21ca2018-04-03 15:42:18 +020028lineage_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.weather:lineageos.weatherservice:lineageos.style:lineageos.trust
d34df2fd8362016-03-04 16:07:39 -080029
Sam Mortimer542742b2017-09-18 19:44:11 -070030lineage_framework_module := $(LOCAL_INSTALLED_MODULE)
Adnan Begovic37fc76f2015-05-05 17:37:05 -070031
32# Make sure that R.java and Manifest.java are built before we build
33# the source for this library.
Sam Mortimer542742b2017-09-18 19:44:11 -070034lineage_framework_res_R_stamp := \
35 $(call intermediates-dir-for,APPS,org.lineageos.platform-res,,COMMON)/src/R.stamp
Colin Cross3276a6b2017-10-11 21:34:17 -070036LOCAL_ADDITIONAL_DEPENDENCIES := $(lineage_framework_res_R_stamp)
Adnan Begovic37fc76f2015-05-05 17:37:05 -070037
Sam Mortimer542742b2017-09-18 19:44:11 -070038$(lineage_framework_module): | $(dir $(lineage_framework_module))org.lineageos.platform-res.apk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070039
Sam Mortimer542742b2017-09-18 19:44:11 -070040lineage_framework_built := $(call java-lib-deps, org.lineageos.platform)
Adnan Begovicaa8614e2015-04-23 23:16:27 -070041
Roman Birg620b1eb2016-03-22 14:21:05 -070042# the sdk as an aar for publish, not built as part of full target
Adnan Begovicbbab82e2016-01-05 14:15:09 -080043# DO NOT LINK AGAINST THIS IN BUILD
44# ============================================================
45include $(CLEAR_VARS)
46
Sam Mortimer542742b2017-09-18 19:44:11 -070047LOCAL_MODULE := org.lineageos.platform.sdk.aar
Roman Birg620b1eb2016-03-22 14:21:05 -070048
Adnan Begovicbbab82e2016-01-05 14:15:09 -080049LOCAL_JACK_ENABLED := disabled
50
Jorge Ruesgac6550fd2016-04-29 14:27:41 +020051LOCAL_CONSUMER_PROGUARD_FILE := $(LOCAL_PATH)/sdk/proguard.txt
Adnan Begovicbbab82e2016-01-05 14:15:09 -080052
Roman Birg620b1eb2016-03-22 14:21:05 -070053LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, sdk/res/res)
54LOCAL_MANIFEST_FILE := sdk/AndroidManifest.xml
Adnan Begovicbbab82e2016-01-05 14:15:09 -080055
Sam Mortimer542742b2017-09-18 19:44:11 -070056lineage_sdk_exclude_files := 'lineageos/library'
57LOCAL_JAR_EXCLUDE_PACKAGES := $(lineage_sdk_exclude_files)
Adnan Begovic62604cf2016-04-13 09:51:21 -070058LOCAL_JAR_EXCLUDE_FILES := none
59
Sam Mortimer542742b2017-09-18 19:44:11 -070060LOCAL_STATIC_JAVA_LIBRARIES := org.lineageos.platform.sdk
Adnan Begovicbbab82e2016-01-05 14:15:09 -080061
62include $(BUILD_STATIC_JAVA_LIBRARY)
Roman Birg620b1eb2016-03-22 14:21:05 -070063$(LOCAL_MODULE) : $(built_aar)
Adnan Begovicbbab82e2016-01-05 14:15:09 -080064
Adnan Begovicaa8614e2015-04-23 23:16:27 -070065# ===========================================================
66# Common Droiddoc vars
Sam Mortimer542742b2017-09-18 19:44:11 -070067lineage_platform_docs_src_files := \
68 $(call all-java-files-under, $(lineage_sdk_src)) \
69 $(call all-html-files-under, $(lineage_sdk_src))
Adnan Begovic62c951e2015-05-28 16:13:04 -070070
Sam Mortimer542742b2017-09-18 19:44:11 -070071lineage_platform_docs_java_libraries := \
Sam Mortimer3533d382019-05-13 15:28:04 -070072 org.lineageos.platform.sdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -070073
Adnan Begovic62c951e2015-05-28 16:13:04 -070074# SDK version as defined
Michael Bestas3031b612018-01-01 03:20:01 +020075lineage_platform_docs_SDK_VERSION := 15.1
Adnan Begovic62c951e2015-05-28 16:13:04 -070076
77# release version
Joeyfdd21f42018-03-11 15:15:29 +010078lineage_platform_docs_SDK_REL_ID := 9
Adnan Begovic62c951e2015-05-28 16:13:04 -070079
Sam Mortimer542742b2017-09-18 19:44:11 -070080lineage_platform_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
Adnan Begovic62c951e2015-05-28 16:13:04 -070081
Sam Mortimer542742b2017-09-18 19:44:11 -070082lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH := \
83 $(lineage_platform_docs_src_files)
Adnan Begovic62c951e2015-05-28 16:13:04 -070084
Sam Mortimer0bc91412017-09-19 21:16:40 -070085lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR := \
86 $(call intermediates-dir-for,JAVA_LIBRARIES,org.lineageos.platform.sdk,,COMMON)
Adnan Begovic62c951e2015-05-28 16:13:04 -070087
88# ==== the api stubs and current.xml ===========================
89include $(CLEAR_VARS)
90
91LOCAL_SRC_FILES:= \
Sam Mortimer542742b2017-09-18 19:44:11 -070092 $(lineage_platform_docs_src_files)
93LOCAL_INTERMEDIATE_SOURCES:= $(lineage_platform_LOCAL_INTERMEDIATE_SOURCES)
94LOCAL_JAVA_LIBRARIES:= $(lineage_platform_docs_java_libraries)
95LOCAL_MODULE_CLASS:= $(lineage_platform_docs_LOCAL_MODULE_CLASS)
96LOCAL_DROIDDOC_SOURCE_PATH:= $(lineage_platform_docs_LOCAL_DROIDDOC_SOURCE_PATH)
Sam Mortimer0bc91412017-09-19 21:16:40 -070097LOCAL_ADDITIONAL_JAVA_DIR:= $(lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR)
Sam Mortimer542742b2017-09-18 19:44:11 -070098LOCAL_ADDITIONAL_DEPENDENCIES:= $(lineage_platform_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
Adnan Begovic62c951e2015-05-28 16:13:04 -070099
Sam Mortimer542742b2017-09-18 19:44:11 -0700100LOCAL_MODULE := lineage-api-stubs
Adnan Begovic62c951e2015-05-28 16:13:04 -0700101
dianlujitao2cf37e42017-12-07 21:52:29 +0800102LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:= external/doclava/res/assets/templates-sdk
Adnan Begovic62c951e2015-05-28 16:13:04 -0700103
Ying Wangd42a6582015-07-16 14:20:22 -0700104LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/lineage-sdk_stubs_current_intermediates/src
105
Adnan Begovic62c951e2015-05-28 16:13:04 -0700106LOCAL_DROIDDOC_OPTIONS:= \
smain@google.com8b356432016-09-01 19:52:17 -0700107 -referenceonly \
Sam Mortimer542742b2017-09-18 19:44:11 -0700108 -stubpackages $(lineage_stub_packages) \
109 -exclude org.lineageos.platform.internal \
110 -api $(INTERNAL_LINEAGE_PLATFORM_API_FILE) \
111 -removedApi $(INTERNAL_LINEAGE_PLATFORM_REMOVED_API_FILE) \
Adnan Begovicc02c64b2016-02-09 11:05:20 -0800112 -nodocs
Adnan Begovic62c951e2015-05-28 16:13:04 -0700113
114LOCAL_UNINSTALLABLE_MODULE := true
115
Sam Mortimer29e2f6b2019-09-05 14:52:51 -0700116#include $(BUILD_DROIDDOC)
Adnan Begovic62c951e2015-05-28 16:13:04 -0700117
Adnan Begovic7bdcaa52015-12-22 11:04:08 -0800118# $(gen), i.e. framework.aidl, is also needed while building against the current stub.
Sam Mortimer542742b2017-09-18 19:44:11 -0700119$(full_target): $(lineage_framework_built) $(gen)
120$(INTERNAL_LINEAGE_PLATFORM_API_FILE): $(full_target)
121$(call dist-for-goals,sdk,$(INTERNAL_LINEAGE_PLATFORM_API_FILE))
Adnan Begovic62c951e2015-05-28 16:13:04 -0700122
Adnan Begovic62c951e2015-05-28 16:13:04 -0700123
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700124# Documentation
125# ===========================================================
126include $(CLEAR_VARS)
127
Sam Mortimer542742b2017-09-18 19:44:11 -0700128LOCAL_MODULE := org.lineageos.platform.sdk
129LOCAL_INTERMEDIATE_SOURCES:= $(lineage_platform_LOCAL_INTERMEDIATE_SOURCES)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700130LOCAL_MODULE_CLASS := JAVA_LIBRARIES
131LOCAL_MODULE_TAGS := optional
132
Sam Mortimer542742b2017-09-18 19:44:11 -0700133LOCAL_SRC_FILES := $(lineage_platform_docs_src_files)
Sam Mortimer0bc91412017-09-19 21:16:40 -0700134LOCAL_ADDITONAL_JAVA_DIR := $(lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700135
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700136LOCAL_IS_HOST_MODULE := false
Jackeagleb19fd372019-09-24 09:12:01 -0400137LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := vendor/bliss/build/tools/droiddoc/templates-lineage-sdk
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700138LOCAL_ADDITIONAL_DEPENDENCIES := \
Paul Keitheb055192019-02-19 17:38:01 +0100139 services
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700140
Sam Mortimer542742b2017-09-18 19:44:11 -0700141LOCAL_JAVA_LIBRARIES := $(lineage_platform_docs_java_libraries)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700142
143LOCAL_DROIDDOC_OPTIONS := \
Jeff Sharkeyd1539622017-04-24 18:06:20 -0600144 -android \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700145 -offlinemode \
Sam Mortimer542742b2017-09-18 19:44:11 -0700146 -exclude org.lineageos.platform.internal \
147 -hidePackage org.lineageos.platform.internal \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700148 -hdf android.whichdoc offline \
Sam Mortimer542742b2017-09-18 19:44:11 -0700149 -hdf sdk.version $(lineage_platform_docs_docs_SDK_VERSION) \
150 -hdf sdk.rel.id $(lineage_platform_docs_docs_SDK_REL_ID) \
Adnan Begovic62c951e2015-05-28 16:13:04 -0700151 -hdf sdk.preview 0 \
Sam Mortimer542742b2017-09-18 19:44:11 -0700152 -since $(LINEAGE_SRC_API_DIR)/1.txt 1 \
153 -since $(LINEAGE_SRC_API_DIR)/2.txt 2 \
154 -since $(LINEAGE_SRC_API_DIR)/3.txt 3 \
155 -since $(LINEAGE_SRC_API_DIR)/4.txt 4 \
156 -since $(LINEAGE_SRC_API_DIR)/5.txt 5 \
157 -since $(LINEAGE_SRC_API_DIR)/6.txt 6 \
Michael Bestas3031b612018-01-01 03:20:01 +0200158 -since $(LINEAGE_SRC_API_DIR)/7.txt 7 \
Joeyfdd21f42018-03-11 15:15:29 +0100159 -since $(LINEAGE_SRC_API_DIR)/8.txt 8 \
160 -since $(LINEAGE_SRC_API_DIR)/9.txt 9
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700161
Sam Mortimer542742b2017-09-18 19:44:11 -0700162$(full_target): $(lineage_framework_built) $(gen)
Sam Mortimer29e2f6b2019-09-05 14:52:51 -0700163#include $(BUILD_DROIDDOC)
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700164
Adnan Begovic37fc76f2015-05-05 17:37:05 -0700165include $(call first-makefiles-under,$(LOCAL_PATH))
166
Adnan Begovicaa8614e2015-04-23 23:16:27 -0700167# Cleanup temp vars
168# ===========================================================
Sam Mortimer542742b2017-09-18 19:44:11 -0700169lineage_platform_docs_src_files :=
170lineage_platform_docs_java_libraries :=
Sam Mortimer0bc91412017-09-19 21:16:40 -0700171lineage_platform_docs_LOCAL_ADDITIONAL_JAVA_DIR :=