blob: d15b44f166214c2ae5f2c50fe56051ade31f013b [file] [log] [blame]
Jiyong Park7fb4b182019-12-20 14:35:43 +09001// Copyright (C) 2019 The Android Open Source 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
15// How stubs are generated:
16//
17// raw source files --(metalava)--> stub source files --(javac)--> stub jar files
18//
Anton Hansson2feb3f12020-11-13 11:44:32 +000019// - The metalava conversion is done by droidstub modules
20// - The javac compilation is done by java_library modules
21//
Jiyong Park7fb4b182019-12-20 14:35:43 +090022// The metalava conversion is also responsible for creating API signature files
Anton Hansson2feb3f12020-11-13 11:44:32 +000023// and comparing them against the checked in API signature, and also checking compatibility
24// with the latest frozen API signature.
Jiyong Park7fb4b182019-12-20 14:35:43 +090025
26/////////////////////////////////////////////////////////////////////
Anton Hansson51861e72020-11-13 09:55:29 +000027// These modules provide source files for the stub libraries
Jiyong Park7fb4b182019-12-20 14:35:43 +090028/////////////////////////////////////////////////////////////////////
29
Anton Hansson76d3db42020-04-09 14:16:37 +010030droidstubs {
31 name: "api-stubs-docs-non-updatable",
Liz Kammer56896172023-09-20 15:15:43 +000032 srcs: [
33 ":framework-minus-apex-aconfig-srcjars",
34 ],
Anton Hansson9dce8322022-01-24 14:14:33 +000035 defaults: [
36 "android-non-updatable-stubs-defaults",
37 "module-classpath-stubs-defaults",
38 ],
Anton Hansson76d3db42020-04-09 14:16:37 +010039 args: metalava_framework_docs_args,
40 check_api: {
41 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +000042 api_file: ":non-updatable-current.txt",
43 removed_api_file: ":non-updatable-removed.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +010044 },
Anton Hansson37e102e2020-10-05 16:42:40 +010045 last_released: {
46 api_file: ":android-non-updatable.api.public.latest",
47 removed_api_file: ":android-non-updatable-removed.api.public.latest",
Anton Hansson7f3393d2021-04-12 11:56:53 +010048 baseline_file: ":android-non-updatable-incompatibilities.api.public.latest",
Anton Hansson37e102e2020-10-05 16:42:40 +010049 },
Anton Hansson76d3db42020-04-09 14:16:37 +010050 api_lint: {
51 enabled: true,
Anton Hansson4f90aa52021-06-04 22:23:59 +010052 new_since: ":android.api.public.latest",
Anton Hansson76d3db42020-04-09 14:16:37 +010053 },
54 },
Anton Hansson85785fe2021-01-20 20:23:34 +000055 dists: [
56 {
Anton Hanssondd8ef672022-01-04 08:53:19 +000057 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +000058 dir: "apistubs/android/public/api",
59 dest: "android-non-updatable.txt",
60 tag: ".api.txt",
61 },
62 {
Anton Hanssondd8ef672022-01-04 08:53:19 +000063 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +000064 dir: "apistubs/android/public/api",
65 dest: "android-non-updatable-removed.txt",
66 tag: ".removed-api.txt",
67 },
68 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +000069 api_surface: "public",
Anton Hansson76d3db42020-04-09 14:16:37 +010070}
71
Anton Hansson240ee482021-04-14 12:52:00 +010072priv_apps = " --show-annotation android.annotation.SystemApi\\(" +
73 "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000074 "\\)"
75
Anton Hansson240ee482021-04-14 12:52:00 +010076priv_apps_in_stubs = " --show-for-stub-purposes-annotation android.annotation.SystemApi\\(" +
77 "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000078 "\\)"
79
80test = " --show-annotation android.annotation.TestApi"
81
Anton Hansson240ee482021-04-14 12:52:00 +010082module_libs = " --show-annotation android.annotation.SystemApi\\(" +
83 "client=android.annotation.SystemApi.Client.MODULE_LIBRARIES" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000084 "\\)"
Anton Hansson81969c22020-02-03 20:45:56 +000085
Jiyong Park7fb4b182019-12-20 14:35:43 +090086droidstubs {
Anton Hansson76d3db42020-04-09 14:16:37 +010087 name: "system-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +000088 defaults: [
89 "android-non-updatable-stubs-defaults",
90 "module-classpath-stubs-defaults",
91 ],
Anton Hansson76d3db42020-04-09 14:16:37 +010092 args: metalava_framework_docs_args + priv_apps,
93 check_api: {
94 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +000095 api_file: ":non-updatable-system-current.txt",
96 removed_api_file: ":non-updatable-system-removed.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +010097 },
Anton Hansson37e102e2020-10-05 16:42:40 +010098 last_released: {
99 api_file: ":android-non-updatable.api.system.latest",
100 removed_api_file: ":android-non-updatable-removed.api.system.latest",
Anton Hansson240ee482021-04-14 12:52:00 +0100101 baseline_file: ":android-non-updatable-incompatibilities.api.system.latest",
Anton Hansson37e102e2020-10-05 16:42:40 +0100102 },
Anton Hansson76d3db42020-04-09 14:16:37 +0100103 api_lint: {
104 enabled: true,
Anton Hansson4f90aa52021-06-04 22:23:59 +0100105 new_since: ":android.api.system.latest",
Anton Hanssonb7cda922023-03-03 15:38:28 +0000106 baseline_file: ":non-updatable-system-lint-baseline.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100107 },
108 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000109 dists: [
110 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000111 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000112 dir: "apistubs/android/system/api",
113 dest: "android-non-updatable.txt",
114 tag: ".api.txt",
115 },
116 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000117 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000118 dir: "apistubs/android/system/api",
119 dest: "android-non-updatable-removed.txt",
120 tag: ".removed-api.txt",
121 },
122 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000123 api_surface: "system",
Anton Hansson76d3db42020-04-09 14:16:37 +0100124}
125
126droidstubs {
Anton Hansson022aac52020-11-05 10:45:13 +0000127 name: "test-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +0000128 defaults: [
129 "android-non-updatable-stubs-defaults",
130 "module-classpath-stubs-defaults",
131 ],
Anton Hansson2feb3f12020-11-13 11:44:32 +0000132 args: metalava_framework_docs_args + test + priv_apps_in_stubs,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900133 check_api: {
134 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +0000135 api_file: ":non-updatable-test-current.txt",
136 removed_api_file: ":non-updatable-test-removed.txt",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900137 },
138 api_lint: {
139 enabled: true,
Anton Hanssonb7cda922023-03-03 15:38:28 +0000140 baseline_file: ":non-updatable-test-lint-baseline.txt",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900141 },
142 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000143 dists: [
144 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000145 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000146 dir: "apistubs/android/test/api",
147 dest: "android.txt",
148 tag: ".api.txt",
149 },
150 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000151 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000152 dir: "apistubs/android/test/api",
153 dest: "removed.txt",
154 tag: ".removed-api.txt",
155 },
156 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000157 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000158 dir: "apistubs/android/test/api",
159 dest: "android-non-updatable.txt",
160 tag: ".api.txt",
161 },
162 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000163 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000164 dir: "apistubs/android/test/api",
165 dest: "android-non-updatable-removed.txt",
166 tag: ".removed-api.txt",
167 },
168 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000169 api_surface: "test",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900170}
171
Jiyong Parke3095162019-12-20 15:30:28 +0900172droidstubs {
Anton Hansson76d3db42020-04-09 14:16:37 +0100173 name: "module-lib-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +0000174 defaults: [
175 "android-non-updatable-stubs-defaults",
176 "module-classpath-stubs-defaults",
177 ],
Anton Hansson2feb3f12020-11-13 11:44:32 +0000178 args: metalava_framework_docs_args + priv_apps_in_stubs + module_libs,
Anton Hansson76d3db42020-04-09 14:16:37 +0100179 check_api: {
180 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +0000181 api_file: ":non-updatable-module-lib-current.txt",
182 removed_api_file: ":non-updatable-module-lib-removed.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100183 },
Anton Hanssonc3ef1f562020-10-07 14:55:36 +0100184 last_released: {
185 api_file: ":android-non-updatable.api.module-lib.latest",
186 removed_api_file: ":android-non-updatable-removed.api.module-lib.latest",
Junyu Lai2dbb1772022-01-12 17:38:02 +0000187 baseline_file: ":android-non-updatable-incompatibilities.api.module-lib.latest",
Anton Hanssonc3ef1f562020-10-07 14:55:36 +0100188 },
Anton Hansson76d3db42020-04-09 14:16:37 +0100189 api_lint: {
190 enabled: true,
Anton Hansson4f90aa52021-06-04 22:23:59 +0100191 new_since: ":android.api.module-lib.latest",
Anton Hanssonb7cda922023-03-03 15:38:28 +0000192 baseline_file: ":non-updatable-module-lib-lint-baseline.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100193 },
194 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000195 dists: [
196 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000197 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000198 dir: "apistubs/android/module-lib/api",
199 dest: "android-non-updatable.txt",
200 tag: ".api.txt",
201 },
202 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000203 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000204 dir: "apistubs/android/module-lib/api",
205 dest: "android-non-updatable-removed.txt",
206 tag: ".removed-api.txt",
207 },
208 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000209 api_surface: "module-lib",
Anton Hansson76d3db42020-04-09 14:16:37 +0100210}
Anton Hansson81969c22020-02-03 20:45:56 +0000211
Jiyong Parke3095162019-12-20 15:30:28 +0900212/////////////////////////////////////////////////////////////////////
Jiyong Park7fb4b182019-12-20 14:35:43 +0900213// android_*_stubs_current modules are the stubs libraries compiled
Anton Hansson2feb3f12020-11-13 11:44:32 +0000214// from stub sources
Jiyong Park7fb4b182019-12-20 14:35:43 +0900215/////////////////////////////////////////////////////////////////////
216
217java_defaults {
Anton Hanssonc43a66b2022-03-03 15:14:04 +0000218 name: "android.jar_defaults",
219 sdk_version: "none",
220 system_modules: "none",
221 java_version: "1.8",
222 compile_dex: true,
Anton Hanssonc43a66b2022-03-03 15:14:04 +0000223 visibility: ["//visibility:public"],
224}
225
226java_defaults {
Jihoon Kang491c7082023-06-15 18:37:01 +0000227 name: "android-non-updatable_defaults",
Anton Hanssonfbd32f32020-04-09 14:16:37 +0100228 sdk_version: "none",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900229 system_modules: "none",
230 java_version: "1.8",
231 compile_dex: true,
Jihoon Kang491c7082023-06-15 18:37:01 +0000232}
233
234java_defaults {
235 name: "android-non-updatable_from_source_defaults",
236 libs: ["stub-annotations"],
237 static_libs: ["framework-res-package-jar"], // Export package of framework-res
Anton Hanssona4108912021-04-09 13:40:11 +0100238 dist: {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000239 targets: ["sdk"],
Anton Hanssona4108912021-04-09 13:40:11 +0100240 tag: ".jar",
241 dest: "android-non-updatable.jar",
Anton Hansson240ee482021-04-14 12:52:00 +0100242 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900243}
244
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100245java_library {
Anton Hanssona4748cd2021-04-09 10:16:19 +0100246 name: "android-non-updatable.stubs",
Jihoon Kang491c7082023-06-15 18:37:01 +0000247 defaults: ["android-non-updatable_defaults"],
248 static_libs: [
249 "android-non-updatable.stubs.from-source",
250 ],
251 product_variables: {
252 build_from_text_stub: {
253 static_libs: [
254 "android-non-updatable.stubs.from-text",
255 ],
256 exclude_static_libs: [
257 "android-non-updatable.stubs.from-source",
258 ],
259 },
260 },
261}
262
263java_library {
264 name: "android-non-updatable.stubs.system",
265 defaults: ["android-non-updatable_defaults"],
266 static_libs: [
267 "android-non-updatable.stubs.system.from-source",
268 ],
269 product_variables: {
270 build_from_text_stub: {
271 static_libs: [
272 "android-non-updatable.stubs.system.from-text",
273 ],
274 exclude_static_libs: [
275 "android-non-updatable.stubs.system.from-source",
276 ],
277 },
278 },
279}
280
281java_library {
282 name: "android-non-updatable.stubs.module_lib",
283 defaults: ["android-non-updatable_defaults"],
284 static_libs: [
285 "android-non-updatable.stubs.module_lib.from-source",
286 ],
287 product_variables: {
288 build_from_text_stub: {
289 static_libs: [
290 "android-non-updatable.stubs.module_lib.from-text",
291 ],
292 exclude_static_libs: [
293 "android-non-updatable.stubs.module_lib.from-source",
294 ],
295 },
296 },
297}
298
299java_library {
300 name: "android-non-updatable.stubs.test",
301 defaults: ["android-non-updatable_defaults"],
302 static_libs: [
303 "android-non-updatable.stubs.test.from-source",
304 ],
305 product_variables: {
306 build_from_text_stub: {
307 static_libs: [
308 "android-non-updatable.stubs.test.from-text",
309 ],
310 exclude_static_libs: [
311 "android-non-updatable.stubs.test.from-source",
312 ],
313 },
314 },
315}
316
317java_library {
318 name: "android-non-updatable.stubs.from-source",
319 defaults: [
320 "android-non-updatable_defaults",
321 "android-non-updatable_from_source_defaults",
322 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100323 srcs: [":api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000324 libs: ["all-modules-public-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100325 dist: {
326 dir: "apistubs/android/public",
327 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100328}
329
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100330java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000331 name: "android-non-updatable.stubs.system.from-source",
332 defaults: [
333 "android-non-updatable_defaults",
334 "android-non-updatable_from_source_defaults",
335 ],
Anton Hansson240ee482021-04-14 12:52:00 +0100336 srcs: [":system-api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000337 libs: ["all-modules-system-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100338 dist: {
339 dir: "apistubs/android/system",
340 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100341}
342
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100343java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000344 name: "android-non-updatable.stubs.module_lib.from-source",
345 defaults: [
346 "android-non-updatable_defaults",
347 "android-non-updatable_from_source_defaults",
348 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100349 srcs: [":module-lib-api-stubs-docs-non-updatable"],
350 libs: [
markchiencd813a32021-11-11 00:42:55 +0800351 "sdk_module-lib_current_framework-tethering",
paulhu2a8c2c32022-02-08 21:23:06 +0800352 "sdk_module-lib_current_framework-connectivity-t",
Roopa Sattiraju86058b62022-01-20 10:05:19 -0800353 "sdk_public_current_framework-bluetooth",
354 // NOTE: The below can be removed once the prebuilt stub contains bluetooth.
Anton Hanssona4748cd2021-04-09 10:16:19 +0100355 "sdk_system_current_android",
356 // NOTE: The below can be removed once the prebuilt stub contains IKE.
357 "sdk_system_current_android.net.ipsec.ike",
358 ],
Anton Hanssona4108912021-04-09 13:40:11 +0100359 dist: {
360 dir: "apistubs/android/module-lib",
361 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100362}
363
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100364java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000365 name: "android-non-updatable.stubs.test.from-source",
366 defaults: [
367 "android-non-updatable_defaults",
368 "android-non-updatable_from_source_defaults",
369 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100370 srcs: [":test-api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000371 libs: ["all-modules-system-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100372 dist: {
373 dir: "apistubs/android/test",
374 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100375}
376
377java_defaults {
Jihoon Kang491c7082023-06-15 18:37:01 +0000378 name: "android-non-updatable_from_text_defaults",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000379 static_libs: ["framework-res-package-jar"],
380 libs: ["stub-annotations"],
381}
382
383java_api_library {
384 name: "android-non-updatable.stubs.from-text",
385 api_surface: "public",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000386 api_contributions: [
387 "api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000388 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000389 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000390 full_api_surface_stub: "android_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000391}
392
393java_api_library {
394 name: "android-non-updatable.stubs.system.from-text",
395 api_surface: "system",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000396 api_contributions: [
397 "api-stubs-docs-non-updatable.api.contribution",
398 "system-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000399 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000400 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000401 full_api_surface_stub: "android_system_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000402}
403
404java_api_library {
405 name: "android-non-updatable.stubs.test.from-text",
406 api_surface: "test",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000407 api_contributions: [
408 "api-stubs-docs-non-updatable.api.contribution",
409 "system-api-stubs-docs-non-updatable.api.contribution",
410 "test-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000411 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000412 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000413 full_api_surface_stub: "android_test_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000414}
415
416java_api_library {
417 name: "android-non-updatable.stubs.module_lib.from-text",
418 api_surface: "module_lib",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000419 api_contributions: [
420 "api-stubs-docs-non-updatable.api.contribution",
421 "system-api-stubs-docs-non-updatable.api.contribution",
422 "module-lib-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000423 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000424 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000425 full_api_surface_stub: "android_module_lib_stubs_current_full.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000426}
427
428java_defaults {
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000429 name: "android_stubs_dists_default",
430 dist: {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000431 targets: ["sdk"],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000432 tag: ".jar",
433 dest: "android.jar",
434 },
Anton Hansson86925682021-04-14 14:54:43 +0100435 defaults_visibility: ["//frameworks/base/services"],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000436}
437
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100438java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000439 name: "android_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000440 static_libs: [
441 "all-modules-public-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100442 "android-non-updatable.stubs",
Anton Hanssonbf63f942020-05-20 12:06:23 +0100443 "private-stub-annotations-jar",
Anton Hansson76d3db42020-04-09 14:16:37 +0100444 ],
Anton Hansson65057af2021-04-14 18:52:08 +0100445 defaults: ["android.jar_defaults"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900446}
447
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100448java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000449 name: "android_system_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000450 static_libs: [
451 "all-modules-system-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100452 "android-non-updatable.stubs.system",
Anton Hanssonbf63f942020-05-20 12:06:23 +0100453 "private-stub-annotations-jar",
Anton Hansson76d3db42020-04-09 14:16:37 +0100454 ],
Anton Hanssonc3002e52020-11-18 18:23:55 +0000455 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100456 "android.jar_defaults",
Anton Hanssonc3002e52020-11-18 18:23:55 +0000457 "android_stubs_dists_default",
458 ],
459 dist: {
460 dir: "apistubs/android/system",
461 },
462 dists: [
463 {
464 // Legacy dist path
Anton Hanssondd8ef672022-01-04 08:53:19 +0000465 targets: ["sdk"],
Anton Hanssonc3002e52020-11-18 18:23:55 +0000466 tag: ".jar",
467 dest: "android_system.jar",
468 },
469 ],
Anton Hansson76d3db42020-04-09 14:16:37 +0100470}
471
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100472java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000473 name: "android_test_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000474 static_libs: [
Nikita Ioffe5593fbb2022-12-01 14:52:34 +0000475 // Updatable modules do not have test APIs, but we want to include their SystemApis, like we
476 // include the SystemApi of framework-non-updatable-sources.
477 "all-updatable-modules-system-stubs",
478 // Non-updatable modules on the other hand can have test APIs, so include their test-stubs.
479 "all-non-updatable-modules-test-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100480 "android-non-updatable.stubs.test",
Anton Hansson7ce31c12020-10-15 18:38:49 +0100481 "private-stub-annotations-jar",
482 ],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000483 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100484 "android.jar_defaults",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000485 "android_stubs_dists_default",
486 ],
487 dist: {
488 dir: "apistubs/android/test",
489 },
Jiyong Parke3095162019-12-20 15:30:28 +0900490}
491
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100492java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000493 name: "android_module_lib_stubs_current.from-source",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000494 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100495 "android.jar_defaults",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000496 "android_stubs_dists_default",
497 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100498 static_libs: [
499 "android-non-updatable.stubs.module_lib",
Victor Chang6b107a92021-06-17 23:49:42 +0100500 "art.module.public.api.stubs.module_lib",
Giulio Fiscella68a04112021-11-30 16:32:44 +0000501 "i18n.module.public.api.stubs",
Anton Hanssonb7d532e2021-02-05 11:40:25 +0000502 ],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000503 dist: {
504 dir: "apistubs/android/module-lib",
505 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900506}
507
Andrei Oneafaa271a2021-03-17 13:32:51 +0000508java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000509 name: "android_system_server_stubs_current.from-source",
Anton Hansson21fb1082023-03-03 16:22:42 +0000510 defaults: [
511 "android.jar_defaults",
512 "android_stubs_dists_default",
513 ],
Andrei Oneafaa271a2021-03-17 13:32:51 +0000514 srcs: [":services-non-updatable-stubs"],
515 installable: false,
516 static_libs: [
Jihoon Kang1453baa2023-05-27 05:32:30 +0000517 "android_module_lib_stubs_current.from-source",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000518 ],
Andrei Oneafaa271a2021-03-17 13:32:51 +0000519 dist: {
520 dir: "apistubs/android/system-server",
521 },
522}
523
Colin Crosscf87a572022-10-20 14:06:53 -0700524java_library {
525 name: "android_stubs_private_jar",
526 defaults: ["android.jar_defaults"],
527 visibility: [
528 "//visibility:override",
529 "//visibility:private",
530 ],
531 static_libs: [
532 "stable.core.platform.api.stubs",
533 "core-lambda-stubs-for-system-modules",
534 "core-generated-annotation-stubs",
535 "framework",
536 "ext",
537 "framework-res-package-jar",
538 // The order of this matters, it has to be last to provide a
539 // package-private androidx.annotation.RecentlyNonNull without
540 // overriding the public android.annotation.Nullable in framework.jar
541 // with its own package-private android.annotation.Nullable.
542 "private-stub-annotations-jar",
543 ],
544}
545
546java_genrule {
547 name: "android_stubs_private_hjar",
Colin Crosscf87a572022-10-20 14:06:53 -0700548 srcs: [":android_stubs_private_jar{.hjar}"],
549 out: ["android_stubs_private.jar"],
550 cmd: "cp $(in) $(out)",
551}
552
553java_library {
554 name: "android_stubs_private",
555 defaults: ["android_stubs_dists_default"],
Colin Crosscf87a572022-10-20 14:06:53 -0700556 sdk_version: "none",
557 system_modules: "none",
558 static_libs: ["android_stubs_private_hjar"],
559 dist: {
560 dir: "apistubs/android/private",
561 },
562}
563
564java_genrule {
565 name: "android_stubs_private_framework_aidl",
Colin Crosscf87a572022-10-20 14:06:53 -0700566 tools: ["sdkparcelables"],
567 srcs: [":android_stubs_private"],
568 out: ["framework.aidl"],
569 cmd: "rm -f $(genDir)/framework.aidl.merged && " +
570 "for i in $(in); do " +
571 " rm -f $(genDir)/framework.aidl.tmp && " +
572 " $(location sdkparcelables) $$i $(genDir)/framework.aidl.tmp && " +
573 " cat $(genDir)/framework.aidl.tmp >> $(genDir)/framework.aidl.merged; " +
574 "done && " +
575 "sort -u $(genDir)/framework.aidl.merged > $(out)",
576 dist: {
577 targets: ["sdk"],
578 dir: "apistubs/android/private",
579 },
580}
581
Jihoon Kang21f8b0e2023-08-17 18:14:35 +0000582//
583// Java API defaults and libraries for single tree build
584//
585
586java_defaults {
587 name: "stub-annotation-defaults",
588 libs: [
589 "stub-annotations",
590 ],
591 static_libs: [
592 // stub annotations do not contribute to the API surfaces but are statically
593 // linked in the stubs for API surfaces (see frameworks/base/StubLibraries.bp).
594 // This is because annotation processors insist on loading the classes for any
595 // annotations found, thus should exist inside android.jar.
596 "private-stub-annotations-jar",
597 ],
598}
599
600// Listing of API domains contribution and dependencies per API surfaces
601java_defaults {
602 name: "android_test_stubs_current_contributions",
603 api_surface: "test",
604 api_contributions: [
Jihoon Kang21f8b0e2023-08-17 18:14:35 +0000605 "framework-virtualization.stubs.source.test.api.contribution",
606 ],
607}
608
609java_defaults {
610 name: "android_module_lib_stubs_current_contributions",
611 api_surface: "module-lib",
612 api_contributions: [
613 "api-stubs-docs-non-updatable.api.contribution",
614 "system-api-stubs-docs-non-updatable.api.contribution",
615 "module-lib-api-stubs-docs-non-updatable.api.contribution",
616 "art.module.public.api.stubs.source.api.contribution",
617 "art.module.public.api.stubs.source.system.api.contribution",
618 "art.module.public.api.stubs.source.module_lib.api.contribution",
619 "i18n.module.public.api.stubs.source.api.contribution",
620 "i18n.module.public.api.stubs.source.system.api.contribution",
621 "i18n.module.public.api.stubs.source.module_lib.api.contribution",
622 ],
623}
624
625// Java API library definitions per API surface
626java_api_library {
627 name: "android_stubs_current.from-text",
628 api_surface: "public",
629 defaults: [
630 // This module is dynamically created at frameworks/base/api/api.go
631 // instead of being written out, in order to minimize edits in the codebase
632 // when there is a change in the list of modules.
633 // that contributes to an api surface.
634 "android_stubs_current_contributions",
635 "stub-annotation-defaults",
636 ],
637 api_contributions: [
638 "api-stubs-docs-non-updatable.api.contribution",
639 ],
640 visibility: ["//visibility:public"],
641}
642
643java_api_library {
644 name: "android_system_stubs_current.from-text",
645 api_surface: "system",
646 defaults: [
647 "android_stubs_current_contributions",
648 "android_system_stubs_current_contributions",
649 "stub-annotation-defaults",
650 ],
651 api_contributions: [
652 "api-stubs-docs-non-updatable.api.contribution",
653 "system-api-stubs-docs-non-updatable.api.contribution",
654 ],
655 visibility: ["//visibility:public"],
656}
657
658java_api_library {
659 name: "android_test_stubs_current.from-text",
660 api_surface: "test",
661 defaults: [
662 "android_stubs_current_contributions",
663 "android_system_stubs_current_contributions",
664 "android_test_stubs_current_contributions",
665 "stub-annotation-defaults",
666 ],
667 api_contributions: [
668 "api-stubs-docs-non-updatable.api.contribution",
669 "system-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang1c5022b2023-09-20 22:02:29 +0000670 "test-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang21f8b0e2023-08-17 18:14:35 +0000671 ],
672 visibility: ["//visibility:public"],
673}
674
675java_api_library {
676 name: "android_module_lib_stubs_current_full.from-text",
677 api_surface: "module-lib",
678 defaults: [
679 "android_stubs_current_contributions",
680 "android_system_stubs_current_contributions",
681 "android_module_lib_stubs_current_contributions_full",
682 ],
683 libs: [
684 "stub-annotations",
685 ],
686 api_contributions: [
687 "api-stubs-docs-non-updatable.api.contribution",
688 "system-api-stubs-docs-non-updatable.api.contribution",
689 "module-lib-api-stubs-docs-non-updatable.api.contribution",
690 ],
691 visibility: ["//visibility:public"],
692}
693
694java_api_library {
695 name: "android_module_lib_stubs_current.from-text",
696 api_surface: "module-lib",
697 defaults: [
698 "android_module_lib_stubs_current_contributions",
699 ],
700 libs: [
701 "android_module_lib_stubs_current_full.from-text",
702 "stub-annotations",
703 ],
704 visibility: ["//visibility:public"],
705}
706
707java_api_library {
708 name: "android_system_server_stubs_current.from-text",
709 api_surface: "system-server",
710 api_contributions: [
711 "services-non-updatable-stubs.api.contribution",
712 ],
713 libs: [
714 "android_module_lib_stubs_current.from-text",
715 "stub-annotations",
716 ],
717 static_libs: [
718 "android_module_lib_stubs_current.from-text",
719 ],
720 visibility: ["//visibility:public"],
721}
722
Anton Hansson36bc27c2021-09-14 15:45:13 +0100723////////////////////////////////////////////////////////////////////////
724// api-versions.xml generation, for public and system. This API database
725// also contains the android.test.* APIs.
726////////////////////////////////////////////////////////////////////////
727
728java_library {
729 name: "android_stubs_current_with_test_libs",
730 static_libs: [
731 "android_stubs_current",
732 "android.test.base.stubs",
733 "android.test.mock.stubs",
734 "android.test.runner.stubs",
735 ],
736 defaults: ["android.jar_defaults"],
737 visibility: [
738 "//visibility:override",
739 "//visibility:private",
740 ],
741}
742
743java_library {
744 name: "android_system_stubs_current_with_test_libs",
745 static_libs: [
746 "android_system_stubs_current",
747 "android.test.base.stubs.system",
748 "android.test.mock.stubs.system",
749 "android.test.runner.stubs.system",
750 ],
751 defaults: ["android.jar_defaults"],
752 visibility: [
753 "//visibility:override",
754 "//visibility:private",
755 ],
756}
757
Cole Faustdcda3702022-10-04 14:46:35 -0700758java_library {
759 name: "android_module_stubs_current_with_test_libs",
760 static_libs: [
761 "android_module_lib_stubs_current",
762 "android.test.base.stubs",
763 "android.test.mock.stubs",
764 "android.test.runner.stubs",
765 ],
766 defaults: ["android.jar_defaults"],
767 visibility: [
768 "//visibility:override",
769 "//visibility:private",
770 ],
771}
772
773java_library {
774 name: "android_system_server_stubs_current_with_test_libs",
775 static_libs: [
776 "android_system_server_stubs_current",
777 "android.test.base.stubs.system",
778 "android.test.mock.stubs.system",
779 "android.test.runner.stubs.system",
780 ],
781 defaults: ["android.jar_defaults"],
782 visibility: [
783 "//visibility:override",
784 "//visibility:private",
785 ],
786}
787
Anton Hansson36bc27c2021-09-14 15:45:13 +0100788droidstubs {
789 name: "api_versions_public",
790 srcs: [":android_stubs_current_with_test_libs{.jar}"],
791 generate_stubs: false,
792 api_levels_annotations_enabled: true,
793 api_levels_annotations_dirs: [
794 "sdk-dir",
795 "api-versions-jars-dir",
796 ],
Cole Faustdcda3702022-10-04 14:46:35 -0700797 api_levels_sdk_type: "public",
Mårten Kongstad54845332022-09-06 15:50:37 +0200798 extensions_info_file: ":sdk-extensions-info",
Anton Hanssonca6e67a2023-03-03 17:55:09 +0000799 visibility: ["//frameworks/base"],
Anton Hansson36bc27c2021-09-14 15:45:13 +0100800}
801
802droidstubs {
803 name: "api_versions_system",
804 srcs: [":android_system_stubs_current_with_test_libs{.jar}"],
805 generate_stubs: false,
806 api_levels_annotations_enabled: true,
807 api_levels_annotations_dirs: [
808 "sdk-dir",
809 "api-versions-jars-dir",
810 ],
811 api_levels_sdk_type: "system",
Mårten Kongstad54845332022-09-06 15:50:37 +0200812 extensions_info_file: ":sdk-extensions-info",
Anton Hansson36bc27c2021-09-14 15:45:13 +0100813}
814
Cole Faustbf4ce752023-02-08 12:46:06 -0800815// This module can be built with:
816// m out/soong/.intermediates/frameworks/base/api_versions_module_lib/android_common/metalava/api-versions.xml
Cole Faustdcda3702022-10-04 14:46:35 -0700817droidstubs {
818 name: "api_versions_module_lib",
819 srcs: [":android_module_stubs_current_with_test_libs{.jar}"],
820 generate_stubs: false,
821 api_levels_annotations_enabled: true,
Cole Faustbf4ce752023-02-08 12:46:06 -0800822 // this only has the non-updatable portions of the module lib sdk,
823 // which can reference classes from updatable apexes, so remove references to them
824 // from this api_versions file.
825 flags: ["--remove-missing-class-references-in-api-levels"],
Cole Faustdcda3702022-10-04 14:46:35 -0700826 api_levels_annotations_dirs: [
827 "sdk-dir",
828 "api-versions-jars-dir",
829 ],
830 api_levels_sdk_type: "module-lib",
Cole Faust1deced12023-02-15 13:24:18 -0800831 // extensions_info_file is purposefully omitted, because this module should just be
832 // the non-updatable portions of the sdk, and extension sdks are updatable.
Cole Faustdcda3702022-10-04 14:46:35 -0700833}
834
835droidstubs {
836 name: "api_versions_system_server",
837 srcs: [":android_system_server_stubs_current_with_test_libs{.jar}"],
838 generate_stubs: false,
839 api_levels_annotations_enabled: true,
Cole Faustbf4ce752023-02-08 12:46:06 -0800840 // this only has the non-updatable portions of the system server sdk,
841 // which can reference classes from updatable apexes, so remove references to them
842 // from this api_versions file.
843 flags: ["--remove-missing-class-references-in-api-levels"],
Cole Faustdcda3702022-10-04 14:46:35 -0700844 api_levels_annotations_dirs: [
845 "sdk-dir",
846 "api-versions-jars-dir",
847 ],
848 api_levels_sdk_type: "system-server",
Cole Faust1deced12023-02-15 13:24:18 -0800849 // extensions_info_file is purposefully omitted, because this module should just be
850 // the non-updatable portions of the sdk, and extension sdks are updatable.
Cole Faustdcda3702022-10-04 14:46:35 -0700851}
852
Jiyong Park7fb4b182019-12-20 14:35:43 +0900853/////////////////////////////////////////////////////////////////////
854// hwbinder.stubs provides APIs required for building HIDL Java
855// libraries.
856/////////////////////////////////////////////////////////////////////
857
858droidstubs {
859 name: "hwbinder-stubs-docs",
Anton Hansson23f319f2023-03-03 16:04:02 +0000860 srcs: [":hwbinder-stubs-srcs"],
Colin Cross037d7fb2021-03-25 17:01:55 -0700861 libs: ["framework-annotations-lib"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900862 installable: false,
863 sdk_version: "core_platform",
864 annotations_enabled: true,
Anton Hansson48ee95e2020-05-02 17:49:26 +0100865 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900866 merge_annotations_dirs: [
867 "metalava-manual",
868 ],
Anton Hansson81969c22020-02-03 20:45:56 +0000869 args: priv_apps,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900870}
871
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100872java_library {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900873 name: "hwbinder.stubs",
874 sdk_version: "core_current",
Colin Cross037d7fb2021-03-25 17:01:55 -0700875 libs: ["framework-annotations-lib"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900876 srcs: [
877 ":hwbinder-stubs-docs",
878 ],
Anton Hansson86925682021-04-14 14:54:43 +0100879 visibility: ["//visibility:public"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900880}