blob: 56a69b46b12c7ea5628f3374ce939f5baddc2523 [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 Kammer01544b92023-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 ],
Adrian Roos7da1d252023-09-20 10:03:31 +000039 args: metalava_framework_docs_args,
Anton Hansson76d3db42020-04-09 14:16:37 +010040 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",
Adrian Roos38dd1612023-09-06 14:45:35 +000053 baseline_file: ":non-updatable-lint-baseline.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +010054 },
55 },
Anton Hansson85785fe2021-01-20 20:23:34 +000056 dists: [
57 {
Anton Hanssondd8ef672022-01-04 08:53:19 +000058 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +000059 dir: "apistubs/android/public/api",
60 dest: "android-non-updatable.txt",
61 tag: ".api.txt",
62 },
63 {
Anton Hanssondd8ef672022-01-04 08:53:19 +000064 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +000065 dir: "apistubs/android/public/api",
66 dest: "android-non-updatable-removed.txt",
67 tag: ".removed-api.txt",
68 },
69 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +000070 api_surface: "public",
Anton Hansson76d3db42020-04-09 14:16:37 +010071}
72
Anton Hansson240ee482021-04-14 12:52:00 +010073priv_apps = " --show-annotation android.annotation.SystemApi\\(" +
74 "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000075 "\\)"
76
Anton Hansson240ee482021-04-14 12:52:00 +010077priv_apps_in_stubs = " --show-for-stub-purposes-annotation android.annotation.SystemApi\\(" +
78 "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000079 "\\)"
80
Adrian Roos7da1d252023-09-20 10:03:31 +000081test = " --show-annotation android.annotation.TestApi"
Anton Hansson2feb3f12020-11-13 11:44:32 +000082
Anton Hansson240ee482021-04-14 12:52:00 +010083module_libs = " --show-annotation android.annotation.SystemApi\\(" +
84 "client=android.annotation.SystemApi.Client.MODULE_LIBRARIES" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000085 "\\)"
Anton Hansson81969c22020-02-03 20:45:56 +000086
Jiyong Park7fb4b182019-12-20 14:35:43 +090087droidstubs {
Anton Hansson76d3db42020-04-09 14:16:37 +010088 name: "system-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +000089 defaults: [
90 "android-non-updatable-stubs-defaults",
91 "module-classpath-stubs-defaults",
92 ],
Anton Hansson76d3db42020-04-09 14:16:37 +010093 args: metalava_framework_docs_args + priv_apps,
94 check_api: {
95 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +000096 api_file: ":non-updatable-system-current.txt",
97 removed_api_file: ":non-updatable-system-removed.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +010098 },
Anton Hansson37e102e2020-10-05 16:42:40 +010099 last_released: {
100 api_file: ":android-non-updatable.api.system.latest",
101 removed_api_file: ":android-non-updatable-removed.api.system.latest",
Anton Hansson240ee482021-04-14 12:52:00 +0100102 baseline_file: ":android-non-updatable-incompatibilities.api.system.latest",
Anton Hansson37e102e2020-10-05 16:42:40 +0100103 },
Anton Hansson76d3db42020-04-09 14:16:37 +0100104 api_lint: {
105 enabled: true,
Anton Hansson4f90aa52021-06-04 22:23:59 +0100106 new_since: ":android.api.system.latest",
Anton Hanssonb7cda922023-03-03 15:38:28 +0000107 baseline_file: ":non-updatable-system-lint-baseline.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100108 },
109 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000110 dists: [
111 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000112 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000113 dir: "apistubs/android/system/api",
114 dest: "android-non-updatable.txt",
115 tag: ".api.txt",
116 },
117 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000118 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000119 dir: "apistubs/android/system/api",
120 dest: "android-non-updatable-removed.txt",
121 tag: ".removed-api.txt",
122 },
123 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000124 api_surface: "system",
Anton Hansson76d3db42020-04-09 14:16:37 +0100125}
126
127droidstubs {
Anton Hansson022aac52020-11-05 10:45:13 +0000128 name: "test-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +0000129 defaults: [
130 "android-non-updatable-stubs-defaults",
131 "module-classpath-stubs-defaults",
132 ],
Anton Hansson2feb3f12020-11-13 11:44:32 +0000133 args: metalava_framework_docs_args + test + priv_apps_in_stubs,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900134 check_api: {
135 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +0000136 api_file: ":non-updatable-test-current.txt",
137 removed_api_file: ":non-updatable-test-removed.txt",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900138 },
139 api_lint: {
140 enabled: true,
Adrian Roos7da1d252023-09-20 10:03:31 +0000141 new_since: ":android.api.test.latest",
Anton Hanssonb7cda922023-03-03 15:38:28 +0000142 baseline_file: ":non-updatable-test-lint-baseline.txt",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900143 },
144 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000145 dists: [
146 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000147 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000148 dir: "apistubs/android/test/api",
149 dest: "android.txt",
150 tag: ".api.txt",
151 },
152 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000153 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000154 dir: "apistubs/android/test/api",
155 dest: "removed.txt",
156 tag: ".removed-api.txt",
157 },
158 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000159 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000160 dir: "apistubs/android/test/api",
161 dest: "android-non-updatable.txt",
162 tag: ".api.txt",
163 },
164 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000165 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000166 dir: "apistubs/android/test/api",
167 dest: "android-non-updatable-removed.txt",
168 tag: ".removed-api.txt",
169 },
170 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000171 api_surface: "test",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900172}
173
Jiyong Parke3095162019-12-20 15:30:28 +0900174droidstubs {
Anton Hansson76d3db42020-04-09 14:16:37 +0100175 name: "module-lib-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +0000176 defaults: [
177 "android-non-updatable-stubs-defaults",
178 "module-classpath-stubs-defaults",
179 ],
Anton Hansson2feb3f12020-11-13 11:44:32 +0000180 args: metalava_framework_docs_args + priv_apps_in_stubs + module_libs,
Anton Hansson76d3db42020-04-09 14:16:37 +0100181 check_api: {
182 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +0000183 api_file: ":non-updatable-module-lib-current.txt",
184 removed_api_file: ":non-updatable-module-lib-removed.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100185 },
Anton Hanssonc3ef1f562020-10-07 14:55:36 +0100186 last_released: {
187 api_file: ":android-non-updatable.api.module-lib.latest",
188 removed_api_file: ":android-non-updatable-removed.api.module-lib.latest",
Junyu Lai2dbb1772022-01-12 17:38:02 +0000189 baseline_file: ":android-non-updatable-incompatibilities.api.module-lib.latest",
Anton Hanssonc3ef1f562020-10-07 14:55:36 +0100190 },
Anton Hansson76d3db42020-04-09 14:16:37 +0100191 api_lint: {
192 enabled: true,
Anton Hansson4f90aa52021-06-04 22:23:59 +0100193 new_since: ":android.api.module-lib.latest",
Anton Hanssonb7cda922023-03-03 15:38:28 +0000194 baseline_file: ":non-updatable-module-lib-lint-baseline.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100195 },
196 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000197 dists: [
198 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000199 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000200 dir: "apistubs/android/module-lib/api",
201 dest: "android-non-updatable.txt",
202 tag: ".api.txt",
203 },
204 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000205 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000206 dir: "apistubs/android/module-lib/api",
207 dest: "android-non-updatable-removed.txt",
208 tag: ".removed-api.txt",
209 },
210 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000211 api_surface: "module-lib",
Anton Hansson76d3db42020-04-09 14:16:37 +0100212}
Anton Hansson81969c22020-02-03 20:45:56 +0000213
Jiyong Parke3095162019-12-20 15:30:28 +0900214/////////////////////////////////////////////////////////////////////
Jiyong Park7fb4b182019-12-20 14:35:43 +0900215// android_*_stubs_current modules are the stubs libraries compiled
Anton Hansson2feb3f12020-11-13 11:44:32 +0000216// from stub sources
Jiyong Park7fb4b182019-12-20 14:35:43 +0900217/////////////////////////////////////////////////////////////////////
218
219java_defaults {
Anton Hanssonc43a66b2022-03-03 15:14:04 +0000220 name: "android.jar_defaults",
221 sdk_version: "none",
222 system_modules: "none",
223 java_version: "1.8",
224 compile_dex: true,
Anton Hanssonc43a66b2022-03-03 15:14:04 +0000225 visibility: ["//visibility:public"],
226}
227
228java_defaults {
Jihoon Kang491c7082023-06-15 18:37:01 +0000229 name: "android-non-updatable_defaults",
Anton Hanssonfbd32f32020-04-09 14:16:37 +0100230 sdk_version: "none",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900231 system_modules: "none",
232 java_version: "1.8",
233 compile_dex: true,
Jihoon Kang491c7082023-06-15 18:37:01 +0000234}
235
236java_defaults {
237 name: "android-non-updatable_from_source_defaults",
238 libs: ["stub-annotations"],
239 static_libs: ["framework-res-package-jar"], // Export package of framework-res
Anton Hanssona4108912021-04-09 13:40:11 +0100240 dist: {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000241 targets: ["sdk"],
Anton Hanssona4108912021-04-09 13:40:11 +0100242 tag: ".jar",
243 dest: "android-non-updatable.jar",
Anton Hansson240ee482021-04-14 12:52:00 +0100244 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900245}
246
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100247java_library {
Anton Hanssona4748cd2021-04-09 10:16:19 +0100248 name: "android-non-updatable.stubs",
Jihoon Kang491c7082023-06-15 18:37:01 +0000249 defaults: ["android-non-updatable_defaults"],
250 static_libs: [
251 "android-non-updatable.stubs.from-source",
252 ],
253 product_variables: {
254 build_from_text_stub: {
255 static_libs: [
256 "android-non-updatable.stubs.from-text",
257 ],
258 exclude_static_libs: [
259 "android-non-updatable.stubs.from-source",
260 ],
261 },
262 },
263}
264
265java_library {
266 name: "android-non-updatable.stubs.system",
267 defaults: ["android-non-updatable_defaults"],
268 static_libs: [
269 "android-non-updatable.stubs.system.from-source",
270 ],
271 product_variables: {
272 build_from_text_stub: {
273 static_libs: [
274 "android-non-updatable.stubs.system.from-text",
275 ],
276 exclude_static_libs: [
277 "android-non-updatable.stubs.system.from-source",
278 ],
279 },
280 },
281}
282
283java_library {
284 name: "android-non-updatable.stubs.module_lib",
285 defaults: ["android-non-updatable_defaults"],
286 static_libs: [
287 "android-non-updatable.stubs.module_lib.from-source",
288 ],
289 product_variables: {
290 build_from_text_stub: {
291 static_libs: [
292 "android-non-updatable.stubs.module_lib.from-text",
293 ],
294 exclude_static_libs: [
295 "android-non-updatable.stubs.module_lib.from-source",
296 ],
297 },
298 },
299}
300
301java_library {
302 name: "android-non-updatable.stubs.test",
303 defaults: ["android-non-updatable_defaults"],
304 static_libs: [
305 "android-non-updatable.stubs.test.from-source",
306 ],
307 product_variables: {
308 build_from_text_stub: {
309 static_libs: [
310 "android-non-updatable.stubs.test.from-text",
311 ],
312 exclude_static_libs: [
313 "android-non-updatable.stubs.test.from-source",
314 ],
315 },
316 },
317}
318
319java_library {
320 name: "android-non-updatable.stubs.from-source",
321 defaults: [
322 "android-non-updatable_defaults",
323 "android-non-updatable_from_source_defaults",
324 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100325 srcs: [":api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000326 libs: ["all-modules-public-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100327 dist: {
328 dir: "apistubs/android/public",
329 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100330}
331
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100332java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000333 name: "android-non-updatable.stubs.system.from-source",
334 defaults: [
335 "android-non-updatable_defaults",
336 "android-non-updatable_from_source_defaults",
337 ],
Anton Hansson240ee482021-04-14 12:52:00 +0100338 srcs: [":system-api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000339 libs: ["all-modules-system-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100340 dist: {
341 dir: "apistubs/android/system",
342 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100343}
344
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100345java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000346 name: "android-non-updatable.stubs.module_lib.from-source",
347 defaults: [
348 "android-non-updatable_defaults",
349 "android-non-updatable_from_source_defaults",
350 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100351 srcs: [":module-lib-api-stubs-docs-non-updatable"],
352 libs: [
markchiencd813a32021-11-11 00:42:55 +0800353 "sdk_module-lib_current_framework-tethering",
paulhu2a8c2c32022-02-08 21:23:06 +0800354 "sdk_module-lib_current_framework-connectivity-t",
Roopa Sattiraju86058b62022-01-20 10:05:19 -0800355 "sdk_public_current_framework-bluetooth",
356 // NOTE: The below can be removed once the prebuilt stub contains bluetooth.
Anton Hanssona4748cd2021-04-09 10:16:19 +0100357 "sdk_system_current_android",
358 // NOTE: The below can be removed once the prebuilt stub contains IKE.
359 "sdk_system_current_android.net.ipsec.ike",
360 ],
Anton Hanssona4108912021-04-09 13:40:11 +0100361 dist: {
362 dir: "apistubs/android/module-lib",
363 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100364}
365
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100366java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000367 name: "android-non-updatable.stubs.test.from-source",
368 defaults: [
369 "android-non-updatable_defaults",
370 "android-non-updatable_from_source_defaults",
371 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100372 srcs: [":test-api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000373 libs: ["all-modules-system-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100374 dist: {
375 dir: "apistubs/android/test",
376 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100377}
378
379java_defaults {
Jihoon Kang491c7082023-06-15 18:37:01 +0000380 name: "android-non-updatable_from_text_defaults",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000381 static_libs: ["framework-res-package-jar"],
382 libs: ["stub-annotations"],
383}
384
385java_api_library {
386 name: "android-non-updatable.stubs.from-text",
387 api_surface: "public",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000388 api_contributions: [
389 "api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000390 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000391 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000392 full_api_surface_stub: "android_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000393}
394
395java_api_library {
396 name: "android-non-updatable.stubs.system.from-text",
397 api_surface: "system",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000398 api_contributions: [
399 "api-stubs-docs-non-updatable.api.contribution",
400 "system-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000401 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000402 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000403 full_api_surface_stub: "android_system_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000404}
405
406java_api_library {
407 name: "android-non-updatable.stubs.test.from-text",
408 api_surface: "test",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000409 api_contributions: [
410 "api-stubs-docs-non-updatable.api.contribution",
411 "system-api-stubs-docs-non-updatable.api.contribution",
412 "test-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000413 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000414 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000415 full_api_surface_stub: "android_test_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000416}
417
418java_api_library {
419 name: "android-non-updatable.stubs.module_lib.from-text",
420 api_surface: "module_lib",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000421 api_contributions: [
422 "api-stubs-docs-non-updatable.api.contribution",
423 "system-api-stubs-docs-non-updatable.api.contribution",
424 "module-lib-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000425 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000426 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000427 full_api_surface_stub: "android_module_lib_stubs_current_full.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000428}
429
430java_defaults {
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000431 name: "android_stubs_dists_default",
432 dist: {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000433 targets: ["sdk"],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000434 tag: ".jar",
435 dest: "android.jar",
436 },
Anton Hansson86925682021-04-14 14:54:43 +0100437 defaults_visibility: ["//frameworks/base/services"],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000438}
439
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100440java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000441 name: "android_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000442 static_libs: [
443 "all-modules-public-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100444 "android-non-updatable.stubs",
Anton Hanssonbf63f942020-05-20 12:06:23 +0100445 "private-stub-annotations-jar",
Anton Hansson76d3db42020-04-09 14:16:37 +0100446 ],
Anton Hansson65057af2021-04-14 18:52:08 +0100447 defaults: ["android.jar_defaults"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900448}
449
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100450java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000451 name: "android_system_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000452 static_libs: [
453 "all-modules-system-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100454 "android-non-updatable.stubs.system",
Anton Hanssonbf63f942020-05-20 12:06:23 +0100455 "private-stub-annotations-jar",
Anton Hansson76d3db42020-04-09 14:16:37 +0100456 ],
Anton Hanssonc3002e52020-11-18 18:23:55 +0000457 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100458 "android.jar_defaults",
Anton Hanssonc3002e52020-11-18 18:23:55 +0000459 "android_stubs_dists_default",
460 ],
461 dist: {
462 dir: "apistubs/android/system",
463 },
464 dists: [
465 {
466 // Legacy dist path
Anton Hanssondd8ef672022-01-04 08:53:19 +0000467 targets: ["sdk"],
Anton Hanssonc3002e52020-11-18 18:23:55 +0000468 tag: ".jar",
469 dest: "android_system.jar",
470 },
471 ],
Anton Hansson76d3db42020-04-09 14:16:37 +0100472}
473
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100474java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000475 name: "android_test_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000476 static_libs: [
Nikita Ioffe5593fbb2022-12-01 14:52:34 +0000477 // Updatable modules do not have test APIs, but we want to include their SystemApis, like we
478 // include the SystemApi of framework-non-updatable-sources.
479 "all-updatable-modules-system-stubs",
480 // Non-updatable modules on the other hand can have test APIs, so include their test-stubs.
481 "all-non-updatable-modules-test-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100482 "android-non-updatable.stubs.test",
Anton Hansson7ce31c12020-10-15 18:38:49 +0100483 "private-stub-annotations-jar",
484 ],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000485 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100486 "android.jar_defaults",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000487 "android_stubs_dists_default",
488 ],
489 dist: {
490 dir: "apistubs/android/test",
491 },
Jiyong Parke3095162019-12-20 15:30:28 +0900492}
493
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100494java_library {
Mark Whiteb03c1fc2023-08-12 01:31:26 +0000495 name: "android_test_frameworks_core_stubs_current.from-source",
496 static_libs: [
497 "all-updatable-modules-system-stubs",
498 "android-non-updatable.stubs.test",
Mark Whiteb03c1fc2023-08-12 01:31:26 +0000499 ],
500 defaults: [
501 "android.jar_defaults",
502 "android_stubs_dists_default",
503 ],
504 dist: {
505 dir: "apistubs/android/test-core",
506 },
507}
508
509java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000510 name: "android_module_lib_stubs_current.from-source",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000511 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100512 "android.jar_defaults",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000513 "android_stubs_dists_default",
514 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100515 static_libs: [
516 "android-non-updatable.stubs.module_lib",
Victor Chang6b107a92021-06-17 23:49:42 +0100517 "art.module.public.api.stubs.module_lib",
Giulio Fiscella68a04112021-11-30 16:32:44 +0000518 "i18n.module.public.api.stubs",
Anton Hanssonb7d532e2021-02-05 11:40:25 +0000519 ],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000520 dist: {
521 dir: "apistubs/android/module-lib",
522 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900523}
524
Andrei Oneafaa271a2021-03-17 13:32:51 +0000525java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000526 name: "android_system_server_stubs_current.from-source",
Anton Hansson21fb1082023-03-03 16:22:42 +0000527 defaults: [
528 "android.jar_defaults",
529 "android_stubs_dists_default",
530 ],
Andrei Oneafaa271a2021-03-17 13:32:51 +0000531 srcs: [":services-non-updatable-stubs"],
532 installable: false,
533 static_libs: [
Jihoon Kang1453baa2023-05-27 05:32:30 +0000534 "android_module_lib_stubs_current.from-source",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000535 ],
Andrei Oneafaa271a2021-03-17 13:32:51 +0000536 dist: {
537 dir: "apistubs/android/system-server",
538 },
539}
540
Colin Crosscf87a572022-10-20 14:06:53 -0700541java_library {
542 name: "android_stubs_private_jar",
543 defaults: ["android.jar_defaults"],
544 visibility: [
545 "//visibility:override",
546 "//visibility:private",
547 ],
548 static_libs: [
549 "stable.core.platform.api.stubs",
550 "core-lambda-stubs-for-system-modules",
551 "core-generated-annotation-stubs",
552 "framework",
553 "ext",
554 "framework-res-package-jar",
555 // The order of this matters, it has to be last to provide a
556 // package-private androidx.annotation.RecentlyNonNull without
557 // overriding the public android.annotation.Nullable in framework.jar
558 // with its own package-private android.annotation.Nullable.
559 "private-stub-annotations-jar",
560 ],
561}
562
563java_genrule {
564 name: "android_stubs_private_hjar",
Colin Crosscf87a572022-10-20 14:06:53 -0700565 srcs: [":android_stubs_private_jar{.hjar}"],
566 out: ["android_stubs_private.jar"],
567 cmd: "cp $(in) $(out)",
568}
569
570java_library {
571 name: "android_stubs_private",
572 defaults: ["android_stubs_dists_default"],
Colin Crosscf87a572022-10-20 14:06:53 -0700573 sdk_version: "none",
574 system_modules: "none",
575 static_libs: ["android_stubs_private_hjar"],
576 dist: {
577 dir: "apistubs/android/private",
578 },
579}
580
581java_genrule {
582 name: "android_stubs_private_framework_aidl",
Colin Crosscf87a572022-10-20 14:06:53 -0700583 tools: ["sdkparcelables"],
584 srcs: [":android_stubs_private"],
585 out: ["framework.aidl"],
586 cmd: "rm -f $(genDir)/framework.aidl.merged && " +
587 "for i in $(in); do " +
588 " rm -f $(genDir)/framework.aidl.tmp && " +
589 " $(location sdkparcelables) $$i $(genDir)/framework.aidl.tmp && " +
590 " cat $(genDir)/framework.aidl.tmp >> $(genDir)/framework.aidl.merged; " +
591 "done && " +
592 "sort -u $(genDir)/framework.aidl.merged > $(out)",
593 dist: {
594 targets: ["sdk"],
595 dir: "apistubs/android/private",
596 },
597}
598
Jihoon Kang1f406452023-08-16 19:06:38 +0000599//
600// Java API defaults and libraries for single tree build
601//
602
603java_defaults {
604 name: "stub-annotation-defaults",
605 libs: [
606 "stub-annotations",
607 ],
608 static_libs: [
609 // stub annotations do not contribute to the API surfaces but are statically
610 // linked in the stubs for API surfaces (see frameworks/base/StubLibraries.bp).
611 // This is because annotation processors insist on loading the classes for any
612 // annotations found, thus should exist inside android.jar.
613 "private-stub-annotations-jar",
614 ],
615}
616
617// Listing of API domains contribution and dependencies per API surfaces
618java_defaults {
619 name: "android_test_stubs_current_contributions",
620 api_surface: "test",
621 api_contributions: [
Jihoon Kang1f406452023-08-16 19:06:38 +0000622 "framework-virtualization.stubs.source.test.api.contribution",
Mark White9ee18662023-08-07 11:18:09 +0000623 "framework-location.stubs.source.test.api.contribution",
Jihoon Kang1f406452023-08-16 19:06:38 +0000624 ],
625}
626
627java_defaults {
628 name: "android_test_frameworks_core_stubs_current_contributions",
629 api_surface: "test",
630 api_contributions: [
631 "test-api-stubs-docs-non-updatable.api.contribution",
632 ],
633}
634
635java_defaults {
636 name: "android_module_lib_stubs_current_contributions",
637 api_surface: "module-lib",
638 api_contributions: [
639 "api-stubs-docs-non-updatable.api.contribution",
640 "system-api-stubs-docs-non-updatable.api.contribution",
641 "module-lib-api-stubs-docs-non-updatable.api.contribution",
642 "art.module.public.api.stubs.source.api.contribution",
643 "art.module.public.api.stubs.source.system.api.contribution",
644 "art.module.public.api.stubs.source.module_lib.api.contribution",
645 "i18n.module.public.api.stubs.source.api.contribution",
646 "i18n.module.public.api.stubs.source.system.api.contribution",
647 "i18n.module.public.api.stubs.source.module_lib.api.contribution",
648 ],
649}
650
651// Java API library definitions per API surface
652java_api_library {
653 name: "android_stubs_current.from-text",
654 api_surface: "public",
655 defaults: [
656 // This module is dynamically created at frameworks/base/api/api.go
657 // instead of being written out, in order to minimize edits in the codebase
658 // when there is a change in the list of modules.
659 // that contributes to an api surface.
660 "android_stubs_current_contributions",
661 "stub-annotation-defaults",
662 ],
663 api_contributions: [
664 "api-stubs-docs-non-updatable.api.contribution",
665 ],
666 visibility: ["//visibility:public"],
667}
668
669java_api_library {
670 name: "android_system_stubs_current.from-text",
671 api_surface: "system",
672 defaults: [
673 "android_stubs_current_contributions",
674 "android_system_stubs_current_contributions",
675 "stub-annotation-defaults",
676 ],
677 api_contributions: [
678 "api-stubs-docs-non-updatable.api.contribution",
679 "system-api-stubs-docs-non-updatable.api.contribution",
680 ],
681 visibility: ["//visibility:public"],
682}
683
684java_api_library {
685 name: "android_test_stubs_current.from-text",
686 api_surface: "test",
687 defaults: [
688 "android_stubs_current_contributions",
689 "android_system_stubs_current_contributions",
690 "android_test_stubs_current_contributions",
691 "stub-annotation-defaults",
692 ],
693 api_contributions: [
694 "api-stubs-docs-non-updatable.api.contribution",
695 "system-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang1c5022b2023-09-20 22:02:29 +0000696 "test-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang1f406452023-08-16 19:06:38 +0000697 ],
698 visibility: ["//visibility:public"],
699}
700
701java_api_library {
702 name: "android_test_frameworks_core_stubs_current.from-text",
703 api_surface: "test",
704 defaults: [
705 "android_stubs_current_contributions",
706 "android_system_stubs_current_contributions",
707 "android_test_frameworks_core_stubs_current_contributions",
708 "stub-annotation-defaults",
709 ],
710 api_contributions: [
711 "api-stubs-docs-non-updatable.api.contribution",
712 "system-api-stubs-docs-non-updatable.api.contribution",
713 ],
714}
715
716java_api_library {
717 name: "android_module_lib_stubs_current_full.from-text",
718 api_surface: "module-lib",
719 defaults: [
720 "android_stubs_current_contributions",
721 "android_system_stubs_current_contributions",
722 "android_module_lib_stubs_current_contributions_full",
723 ],
724 libs: [
725 "stub-annotations",
726 ],
727 api_contributions: [
728 "api-stubs-docs-non-updatable.api.contribution",
729 "system-api-stubs-docs-non-updatable.api.contribution",
730 "module-lib-api-stubs-docs-non-updatable.api.contribution",
731 ],
732 visibility: ["//visibility:public"],
733}
734
735java_api_library {
736 name: "android_module_lib_stubs_current.from-text",
737 api_surface: "module-lib",
738 defaults: [
739 "android_module_lib_stubs_current_contributions",
740 ],
741 libs: [
742 "android_module_lib_stubs_current_full.from-text",
743 "stub-annotations",
744 ],
745 visibility: ["//visibility:public"],
746}
747
748java_api_library {
749 name: "android_system_server_stubs_current.from-text",
750 api_surface: "system-server",
751 api_contributions: [
752 "services-non-updatable-stubs.api.contribution",
753 ],
754 libs: [
755 "android_module_lib_stubs_current.from-text",
756 "stub-annotations",
757 ],
758 static_libs: [
759 "android_module_lib_stubs_current.from-text",
760 ],
761 visibility: ["//visibility:public"],
762}
763
Anton Hansson36bc27c2021-09-14 15:45:13 +0100764////////////////////////////////////////////////////////////////////////
765// api-versions.xml generation, for public and system. This API database
766// also contains the android.test.* APIs.
767////////////////////////////////////////////////////////////////////////
768
769java_library {
770 name: "android_stubs_current_with_test_libs",
771 static_libs: [
772 "android_stubs_current",
773 "android.test.base.stubs",
774 "android.test.mock.stubs",
775 "android.test.runner.stubs",
776 ],
777 defaults: ["android.jar_defaults"],
778 visibility: [
779 "//visibility:override",
780 "//visibility:private",
781 ],
782}
783
784java_library {
785 name: "android_system_stubs_current_with_test_libs",
786 static_libs: [
787 "android_system_stubs_current",
788 "android.test.base.stubs.system",
789 "android.test.mock.stubs.system",
790 "android.test.runner.stubs.system",
791 ],
792 defaults: ["android.jar_defaults"],
793 visibility: [
794 "//visibility:override",
795 "//visibility:private",
796 ],
797}
798
Cole Faustdcda3702022-10-04 14:46:35 -0700799java_library {
800 name: "android_module_stubs_current_with_test_libs",
801 static_libs: [
802 "android_module_lib_stubs_current",
803 "android.test.base.stubs",
804 "android.test.mock.stubs",
805 "android.test.runner.stubs",
806 ],
807 defaults: ["android.jar_defaults"],
808 visibility: [
809 "//visibility:override",
810 "//visibility:private",
811 ],
812}
813
814java_library {
815 name: "android_system_server_stubs_current_with_test_libs",
816 static_libs: [
817 "android_system_server_stubs_current",
818 "android.test.base.stubs.system",
819 "android.test.mock.stubs.system",
820 "android.test.runner.stubs.system",
821 ],
822 defaults: ["android.jar_defaults"],
823 visibility: [
824 "//visibility:override",
825 "//visibility:private",
826 ],
827}
828
Anton Hansson36bc27c2021-09-14 15:45:13 +0100829droidstubs {
830 name: "api_versions_public",
831 srcs: [":android_stubs_current_with_test_libs{.jar}"],
832 generate_stubs: false,
833 api_levels_annotations_enabled: true,
834 api_levels_annotations_dirs: [
835 "sdk-dir",
836 "api-versions-jars-dir",
837 ],
Cole Faustdcda3702022-10-04 14:46:35 -0700838 api_levels_sdk_type: "public",
Mårten Kongstad54845332022-09-06 15:50:37 +0200839 extensions_info_file: ":sdk-extensions-info",
Anton Hanssonca6e67a2023-03-03 17:55:09 +0000840 visibility: ["//frameworks/base"],
Anton Hansson36bc27c2021-09-14 15:45:13 +0100841}
842
843droidstubs {
844 name: "api_versions_system",
845 srcs: [":android_system_stubs_current_with_test_libs{.jar}"],
846 generate_stubs: false,
847 api_levels_annotations_enabled: true,
848 api_levels_annotations_dirs: [
849 "sdk-dir",
850 "api-versions-jars-dir",
851 ],
852 api_levels_sdk_type: "system",
Mårten Kongstad54845332022-09-06 15:50:37 +0200853 extensions_info_file: ":sdk-extensions-info",
Anton Hansson36bc27c2021-09-14 15:45:13 +0100854}
855
Cole Faustbf4ce752023-02-08 12:46:06 -0800856// This module can be built with:
857// m out/soong/.intermediates/frameworks/base/api_versions_module_lib/android_common/metalava/api-versions.xml
Cole Faustdcda3702022-10-04 14:46:35 -0700858droidstubs {
859 name: "api_versions_module_lib",
860 srcs: [":android_module_stubs_current_with_test_libs{.jar}"],
861 generate_stubs: false,
862 api_levels_annotations_enabled: true,
Cole Faustbf4ce752023-02-08 12:46:06 -0800863 // this only has the non-updatable portions of the module lib sdk,
864 // which can reference classes from updatable apexes, so remove references to them
865 // from this api_versions file.
866 flags: ["--remove-missing-class-references-in-api-levels"],
Cole Faustdcda3702022-10-04 14:46:35 -0700867 api_levels_annotations_dirs: [
868 "sdk-dir",
869 "api-versions-jars-dir",
870 ],
871 api_levels_sdk_type: "module-lib",
Cole Faust1deced12023-02-15 13:24:18 -0800872 // extensions_info_file is purposefully omitted, because this module should just be
873 // the non-updatable portions of the sdk, and extension sdks are updatable.
Cole Faustdcda3702022-10-04 14:46:35 -0700874}
875
876droidstubs {
877 name: "api_versions_system_server",
878 srcs: [":android_system_server_stubs_current_with_test_libs{.jar}"],
879 generate_stubs: false,
880 api_levels_annotations_enabled: true,
Cole Faustbf4ce752023-02-08 12:46:06 -0800881 // this only has the non-updatable portions of the system server sdk,
882 // which can reference classes from updatable apexes, so remove references to them
883 // from this api_versions file.
884 flags: ["--remove-missing-class-references-in-api-levels"],
Cole Faustdcda3702022-10-04 14:46:35 -0700885 api_levels_annotations_dirs: [
886 "sdk-dir",
887 "api-versions-jars-dir",
888 ],
889 api_levels_sdk_type: "system-server",
Cole Faust1deced12023-02-15 13:24:18 -0800890 // extensions_info_file is purposefully omitted, because this module should just be
891 // the non-updatable portions of the sdk, and extension sdks are updatable.
Cole Faustdcda3702022-10-04 14:46:35 -0700892}
893
Jiyong Park7fb4b182019-12-20 14:35:43 +0900894/////////////////////////////////////////////////////////////////////
895// hwbinder.stubs provides APIs required for building HIDL Java
896// libraries.
897/////////////////////////////////////////////////////////////////////
898
899droidstubs {
900 name: "hwbinder-stubs-docs",
Anton Hansson23f319f2023-03-03 16:04:02 +0000901 srcs: [":hwbinder-stubs-srcs"],
Colin Cross037d7fb2021-03-25 17:01:55 -0700902 libs: ["framework-annotations-lib"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900903 installable: false,
904 sdk_version: "core_platform",
905 annotations_enabled: true,
Anton Hansson48ee95e2020-05-02 17:49:26 +0100906 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900907 merge_annotations_dirs: [
908 "metalava-manual",
909 ],
Anton Hansson81969c22020-02-03 20:45:56 +0000910 args: priv_apps,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900911}
912
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100913java_library {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900914 name: "hwbinder.stubs",
915 sdk_version: "core_current",
Colin Cross037d7fb2021-03-25 17:01:55 -0700916 libs: ["framework-annotations-lib"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900917 srcs: [
918 ":hwbinder-stubs-docs",
919 ],
Anton Hansson86925682021-04-14 14:54:43 +0100920 visibility: ["//visibility:public"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900921}