blob: f2fe2052e0c3c859f916bb5b6e8a1de2d035c889 [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",
Anton Hansson9dce8322022-01-24 14:14:33 +000032 defaults: [
33 "android-non-updatable-stubs-defaults",
34 "module-classpath-stubs-defaults",
35 ],
Anton Hansson76d3db42020-04-09 14:16:37 +010036 args: metalava_framework_docs_args,
37 check_api: {
38 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +000039 api_file: ":non-updatable-current.txt",
40 removed_api_file: ":non-updatable-removed.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +010041 },
Anton Hansson37e102e2020-10-05 16:42:40 +010042 last_released: {
43 api_file: ":android-non-updatable.api.public.latest",
44 removed_api_file: ":android-non-updatable-removed.api.public.latest",
Anton Hansson7f3393d2021-04-12 11:56:53 +010045 baseline_file: ":android-non-updatable-incompatibilities.api.public.latest",
Anton Hansson37e102e2020-10-05 16:42:40 +010046 },
Anton Hansson76d3db42020-04-09 14:16:37 +010047 api_lint: {
48 enabled: true,
Anton Hansson4f90aa52021-06-04 22:23:59 +010049 new_since: ":android.api.public.latest",
Anton Hansson76d3db42020-04-09 14:16:37 +010050 },
51 },
Anton Hansson85785fe2021-01-20 20:23:34 +000052 dists: [
53 {
Anton Hanssondd8ef672022-01-04 08:53:19 +000054 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +000055 dir: "apistubs/android/public/api",
56 dest: "android-non-updatable.txt",
57 tag: ".api.txt",
58 },
59 {
Anton Hanssondd8ef672022-01-04 08:53:19 +000060 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +000061 dir: "apistubs/android/public/api",
62 dest: "android-non-updatable-removed.txt",
63 tag: ".removed-api.txt",
64 },
65 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +000066 api_surface: "public",
Anton Hansson76d3db42020-04-09 14:16:37 +010067}
68
Anton Hansson240ee482021-04-14 12:52:00 +010069priv_apps = " --show-annotation android.annotation.SystemApi\\(" +
70 "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000071 "\\)"
72
Anton Hansson240ee482021-04-14 12:52:00 +010073priv_apps_in_stubs = " --show-for-stub-purposes-annotation android.annotation.SystemApi\\(" +
74 "client=android.annotation.SystemApi.Client.PRIVILEGED_APPS" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000075 "\\)"
76
77test = " --show-annotation android.annotation.TestApi"
78
Anton Hansson240ee482021-04-14 12:52:00 +010079module_libs = " --show-annotation android.annotation.SystemApi\\(" +
80 "client=android.annotation.SystemApi.Client.MODULE_LIBRARIES" +
Anton Hansson2feb3f12020-11-13 11:44:32 +000081 "\\)"
Anton Hansson81969c22020-02-03 20:45:56 +000082
Jiyong Park7fb4b182019-12-20 14:35:43 +090083droidstubs {
Anton Hansson76d3db42020-04-09 14:16:37 +010084 name: "system-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +000085 defaults: [
86 "android-non-updatable-stubs-defaults",
87 "module-classpath-stubs-defaults",
88 ],
Anton Hansson76d3db42020-04-09 14:16:37 +010089 args: metalava_framework_docs_args + priv_apps,
90 check_api: {
91 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +000092 api_file: ":non-updatable-system-current.txt",
93 removed_api_file: ":non-updatable-system-removed.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +010094 },
Anton Hansson37e102e2020-10-05 16:42:40 +010095 last_released: {
96 api_file: ":android-non-updatable.api.system.latest",
97 removed_api_file: ":android-non-updatable-removed.api.system.latest",
Anton Hansson240ee482021-04-14 12:52:00 +010098 baseline_file: ":android-non-updatable-incompatibilities.api.system.latest",
Anton Hansson37e102e2020-10-05 16:42:40 +010099 },
Anton Hansson76d3db42020-04-09 14:16:37 +0100100 api_lint: {
101 enabled: true,
Anton Hansson4f90aa52021-06-04 22:23:59 +0100102 new_since: ":android.api.system.latest",
Anton Hanssonb7cda922023-03-03 15:38:28 +0000103 baseline_file: ":non-updatable-system-lint-baseline.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100104 },
105 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000106 dists: [
107 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000108 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000109 dir: "apistubs/android/system/api",
110 dest: "android-non-updatable.txt",
111 tag: ".api.txt",
112 },
113 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000114 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000115 dir: "apistubs/android/system/api",
116 dest: "android-non-updatable-removed.txt",
117 tag: ".removed-api.txt",
118 },
119 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000120 api_surface: "system",
Anton Hansson76d3db42020-04-09 14:16:37 +0100121}
122
123droidstubs {
Anton Hansson022aac52020-11-05 10:45:13 +0000124 name: "test-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +0000125 defaults: [
126 "android-non-updatable-stubs-defaults",
127 "module-classpath-stubs-defaults",
128 ],
Anton Hansson2feb3f12020-11-13 11:44:32 +0000129 args: metalava_framework_docs_args + test + priv_apps_in_stubs,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900130 check_api: {
131 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +0000132 api_file: ":non-updatable-test-current.txt",
133 removed_api_file: ":non-updatable-test-removed.txt",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900134 },
135 api_lint: {
136 enabled: true,
Anton Hanssonb7cda922023-03-03 15:38:28 +0000137 baseline_file: ":non-updatable-test-lint-baseline.txt",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900138 },
139 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000140 dists: [
141 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000142 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000143 dir: "apistubs/android/test/api",
144 dest: "android.txt",
145 tag: ".api.txt",
146 },
147 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000148 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000149 dir: "apistubs/android/test/api",
150 dest: "removed.txt",
151 tag: ".removed-api.txt",
152 },
153 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000154 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000155 dir: "apistubs/android/test/api",
156 dest: "android-non-updatable.txt",
157 tag: ".api.txt",
158 },
159 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000160 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000161 dir: "apistubs/android/test/api",
162 dest: "android-non-updatable-removed.txt",
163 tag: ".removed-api.txt",
164 },
165 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000166 api_surface: "test",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900167}
168
Jiyong Parke3095162019-12-20 15:30:28 +0900169droidstubs {
Anton Hansson76d3db42020-04-09 14:16:37 +0100170 name: "module-lib-api-stubs-docs-non-updatable",
Anton Hansson9dce8322022-01-24 14:14:33 +0000171 defaults: [
172 "android-non-updatable-stubs-defaults",
173 "module-classpath-stubs-defaults",
174 ],
Anton Hansson2feb3f12020-11-13 11:44:32 +0000175 args: metalava_framework_docs_args + priv_apps_in_stubs + module_libs,
Anton Hansson76d3db42020-04-09 14:16:37 +0100176 check_api: {
177 current: {
Anton Hanssonb7cda922023-03-03 15:38:28 +0000178 api_file: ":non-updatable-module-lib-current.txt",
179 removed_api_file: ":non-updatable-module-lib-removed.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100180 },
Anton Hanssonc3ef1f562020-10-07 14:55:36 +0100181 last_released: {
182 api_file: ":android-non-updatable.api.module-lib.latest",
183 removed_api_file: ":android-non-updatable-removed.api.module-lib.latest",
Junyu Lai2dbb1772022-01-12 17:38:02 +0000184 baseline_file: ":android-non-updatable-incompatibilities.api.module-lib.latest",
Anton Hanssonc3ef1f562020-10-07 14:55:36 +0100185 },
Anton Hansson76d3db42020-04-09 14:16:37 +0100186 api_lint: {
187 enabled: true,
Anton Hansson4f90aa52021-06-04 22:23:59 +0100188 new_since: ":android.api.module-lib.latest",
Anton Hanssonb7cda922023-03-03 15:38:28 +0000189 baseline_file: ":non-updatable-module-lib-lint-baseline.txt",
Anton Hansson76d3db42020-04-09 14:16:37 +0100190 },
191 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000192 dists: [
193 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000194 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000195 dir: "apistubs/android/module-lib/api",
196 dest: "android-non-updatable.txt",
197 tag: ".api.txt",
198 },
199 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000200 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000201 dir: "apistubs/android/module-lib/api",
202 dest: "android-non-updatable-removed.txt",
203 tag: ".removed-api.txt",
204 },
205 ],
Jihoon Kang866b9b7a2023-09-20 22:28:05 +0000206 api_surface: "module-lib",
Anton Hansson76d3db42020-04-09 14:16:37 +0100207}
Anton Hansson81969c22020-02-03 20:45:56 +0000208
Jiyong Parke3095162019-12-20 15:30:28 +0900209/////////////////////////////////////////////////////////////////////
Jiyong Park7fb4b182019-12-20 14:35:43 +0900210// android_*_stubs_current modules are the stubs libraries compiled
Anton Hansson2feb3f12020-11-13 11:44:32 +0000211// from stub sources
Jiyong Park7fb4b182019-12-20 14:35:43 +0900212/////////////////////////////////////////////////////////////////////
213
214java_defaults {
Anton Hanssonc43a66b2022-03-03 15:14:04 +0000215 name: "android.jar_defaults",
216 sdk_version: "none",
217 system_modules: "none",
218 java_version: "1.8",
219 compile_dex: true,
Anton Hanssonc43a66b2022-03-03 15:14:04 +0000220 visibility: ["//visibility:public"],
221}
222
223java_defaults {
Jihoon Kang491c7082023-06-15 18:37:01 +0000224 name: "android-non-updatable_defaults",
Anton Hanssonfbd32f32020-04-09 14:16:37 +0100225 sdk_version: "none",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900226 system_modules: "none",
227 java_version: "1.8",
228 compile_dex: true,
Jihoon Kang491c7082023-06-15 18:37:01 +0000229}
230
231java_defaults {
232 name: "android-non-updatable_from_source_defaults",
233 libs: ["stub-annotations"],
234 static_libs: ["framework-res-package-jar"], // Export package of framework-res
Anton Hanssona4108912021-04-09 13:40:11 +0100235 dist: {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000236 targets: ["sdk"],
Anton Hanssona4108912021-04-09 13:40:11 +0100237 tag: ".jar",
238 dest: "android-non-updatable.jar",
Anton Hansson240ee482021-04-14 12:52:00 +0100239 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900240}
241
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100242java_library {
Anton Hanssona4748cd2021-04-09 10:16:19 +0100243 name: "android-non-updatable.stubs",
Jihoon Kang491c7082023-06-15 18:37:01 +0000244 defaults: ["android-non-updatable_defaults"],
245 static_libs: [
246 "android-non-updatable.stubs.from-source",
247 ],
248 product_variables: {
249 build_from_text_stub: {
250 static_libs: [
251 "android-non-updatable.stubs.from-text",
252 ],
253 exclude_static_libs: [
254 "android-non-updatable.stubs.from-source",
255 ],
256 },
257 },
258}
259
260java_library {
261 name: "android-non-updatable.stubs.system",
262 defaults: ["android-non-updatable_defaults"],
263 static_libs: [
264 "android-non-updatable.stubs.system.from-source",
265 ],
266 product_variables: {
267 build_from_text_stub: {
268 static_libs: [
269 "android-non-updatable.stubs.system.from-text",
270 ],
271 exclude_static_libs: [
272 "android-non-updatable.stubs.system.from-source",
273 ],
274 },
275 },
276}
277
278java_library {
279 name: "android-non-updatable.stubs.module_lib",
280 defaults: ["android-non-updatable_defaults"],
281 static_libs: [
282 "android-non-updatable.stubs.module_lib.from-source",
283 ],
284 product_variables: {
285 build_from_text_stub: {
286 static_libs: [
287 "android-non-updatable.stubs.module_lib.from-text",
288 ],
289 exclude_static_libs: [
290 "android-non-updatable.stubs.module_lib.from-source",
291 ],
292 },
293 },
294}
295
296java_library {
297 name: "android-non-updatable.stubs.test",
298 defaults: ["android-non-updatable_defaults"],
299 static_libs: [
300 "android-non-updatable.stubs.test.from-source",
301 ],
302 product_variables: {
303 build_from_text_stub: {
304 static_libs: [
305 "android-non-updatable.stubs.test.from-text",
306 ],
307 exclude_static_libs: [
308 "android-non-updatable.stubs.test.from-source",
309 ],
310 },
311 },
312}
313
314java_library {
315 name: "android-non-updatable.stubs.from-source",
316 defaults: [
317 "android-non-updatable_defaults",
318 "android-non-updatable_from_source_defaults",
319 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100320 srcs: [":api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000321 libs: ["all-modules-public-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100322 dist: {
323 dir: "apistubs/android/public",
324 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100325}
326
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100327java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000328 name: "android-non-updatable.stubs.system.from-source",
329 defaults: [
330 "android-non-updatable_defaults",
331 "android-non-updatable_from_source_defaults",
332 ],
Anton Hansson240ee482021-04-14 12:52:00 +0100333 srcs: [":system-api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000334 libs: ["all-modules-system-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100335 dist: {
336 dir: "apistubs/android/system",
337 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100338}
339
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100340java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000341 name: "android-non-updatable.stubs.module_lib.from-source",
342 defaults: [
343 "android-non-updatable_defaults",
344 "android-non-updatable_from_source_defaults",
345 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100346 srcs: [":module-lib-api-stubs-docs-non-updatable"],
347 libs: [
markchiencd813a32021-11-11 00:42:55 +0800348 "sdk_module-lib_current_framework-tethering",
paulhu2a8c2c32022-02-08 21:23:06 +0800349 "sdk_module-lib_current_framework-connectivity-t",
Roopa Sattiraju86058b62022-01-20 10:05:19 -0800350 "sdk_public_current_framework-bluetooth",
351 // NOTE: The below can be removed once the prebuilt stub contains bluetooth.
Anton Hanssona4748cd2021-04-09 10:16:19 +0100352 "sdk_system_current_android",
353 // NOTE: The below can be removed once the prebuilt stub contains IKE.
354 "sdk_system_current_android.net.ipsec.ike",
355 ],
Anton Hanssona4108912021-04-09 13:40:11 +0100356 dist: {
357 dir: "apistubs/android/module-lib",
358 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100359}
360
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100361java_library {
Jihoon Kang491c7082023-06-15 18:37:01 +0000362 name: "android-non-updatable.stubs.test.from-source",
363 defaults: [
364 "android-non-updatable_defaults",
365 "android-non-updatable_from_source_defaults",
366 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100367 srcs: [":test-api-stubs-docs-non-updatable"],
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000368 libs: ["all-modules-system-stubs"],
Anton Hanssona4108912021-04-09 13:40:11 +0100369 dist: {
370 dir: "apistubs/android/test",
371 },
Anton Hanssona4748cd2021-04-09 10:16:19 +0100372}
373
374java_defaults {
Jihoon Kang491c7082023-06-15 18:37:01 +0000375 name: "android-non-updatable_from_text_defaults",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000376 static_libs: ["framework-res-package-jar"],
377 libs: ["stub-annotations"],
378}
379
380java_api_library {
381 name: "android-non-updatable.stubs.from-text",
382 api_surface: "public",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000383 api_contributions: [
384 "api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000385 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000386 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000387 full_api_surface_stub: "android_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000388}
389
390java_api_library {
391 name: "android-non-updatable.stubs.system.from-text",
392 api_surface: "system",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000393 api_contributions: [
394 "api-stubs-docs-non-updatable.api.contribution",
395 "system-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000396 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000397 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000398 full_api_surface_stub: "android_system_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000399}
400
401java_api_library {
402 name: "android-non-updatable.stubs.test.from-text",
403 api_surface: "test",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000404 api_contributions: [
405 "api-stubs-docs-non-updatable.api.contribution",
406 "system-api-stubs-docs-non-updatable.api.contribution",
407 "test-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000408 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000409 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000410 full_api_surface_stub: "android_test_stubs_current.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000411}
412
413java_api_library {
414 name: "android-non-updatable.stubs.module_lib.from-text",
415 api_surface: "module_lib",
Jihoon Kang25b6ced2023-09-20 21:48:09 +0000416 api_contributions: [
417 "api-stubs-docs-non-updatable.api.contribution",
418 "system-api-stubs-docs-non-updatable.api.contribution",
419 "module-lib-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000420 ],
Jihoon Kang491c7082023-06-15 18:37:01 +0000421 defaults: ["android-non-updatable_from_text_defaults"],
Jihoon Kang12cddb32023-06-29 21:35:24 +0000422 full_api_surface_stub: "android_module_lib_stubs_current_full.from-text",
Jihoon Kang0c101db2023-03-14 07:03:46 +0000423}
424
425java_defaults {
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000426 name: "android_stubs_dists_default",
427 dist: {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000428 targets: ["sdk"],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000429 tag: ".jar",
430 dest: "android.jar",
431 },
Anton Hansson86925682021-04-14 14:54:43 +0100432 defaults_visibility: ["//frameworks/base/services"],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000433}
434
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100435java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000436 name: "android_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000437 static_libs: [
438 "all-modules-public-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100439 "android-non-updatable.stubs",
Anton Hanssonbf63f942020-05-20 12:06:23 +0100440 "private-stub-annotations-jar",
Anton Hansson76d3db42020-04-09 14:16:37 +0100441 ],
Anton Hansson65057af2021-04-14 18:52:08 +0100442 defaults: ["android.jar_defaults"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900443}
444
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100445java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000446 name: "android_system_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000447 static_libs: [
448 "all-modules-system-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100449 "android-non-updatable.stubs.system",
Anton Hanssonbf63f942020-05-20 12:06:23 +0100450 "private-stub-annotations-jar",
Anton Hansson76d3db42020-04-09 14:16:37 +0100451 ],
Anton Hanssonc3002e52020-11-18 18:23:55 +0000452 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100453 "android.jar_defaults",
Anton Hanssonc3002e52020-11-18 18:23:55 +0000454 "android_stubs_dists_default",
455 ],
456 dist: {
457 dir: "apistubs/android/system",
458 },
459 dists: [
460 {
461 // Legacy dist path
Anton Hanssondd8ef672022-01-04 08:53:19 +0000462 targets: ["sdk"],
Anton Hanssonc3002e52020-11-18 18:23:55 +0000463 tag: ".jar",
464 dest: "android_system.jar",
465 },
466 ],
Anton Hansson76d3db42020-04-09 14:16:37 +0100467}
468
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100469java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000470 name: "android_test_stubs_current.from-source",
Anton Hanssonc6e9d2f2022-01-25 15:53:43 +0000471 static_libs: [
Nikita Ioffe5593fbb2022-12-01 14:52:34 +0000472 // Updatable modules do not have test APIs, but we want to include their SystemApis, like we
473 // include the SystemApi of framework-non-updatable-sources.
474 "all-updatable-modules-system-stubs",
475 // Non-updatable modules on the other hand can have test APIs, so include their test-stubs.
476 "all-non-updatable-modules-test-stubs",
Anton Hanssona4748cd2021-04-09 10:16:19 +0100477 "android-non-updatable.stubs.test",
Anton Hansson7ce31c12020-10-15 18:38:49 +0100478 "private-stub-annotations-jar",
479 ],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000480 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100481 "android.jar_defaults",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000482 "android_stubs_dists_default",
483 ],
484 dist: {
485 dir: "apistubs/android/test",
486 },
Jiyong Parke3095162019-12-20 15:30:28 +0900487}
488
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100489java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000490 name: "android_module_lib_stubs_current.from-source",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000491 defaults: [
Anton Hansson65057af2021-04-14 18:52:08 +0100492 "android.jar_defaults",
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000493 "android_stubs_dists_default",
494 ],
Anton Hanssona4748cd2021-04-09 10:16:19 +0100495 static_libs: [
496 "android-non-updatable.stubs.module_lib",
Victor Chang6b107a92021-06-17 23:49:42 +0100497 "art.module.public.api.stubs.module_lib",
Giulio Fiscella68a04112021-11-30 16:32:44 +0000498 "i18n.module.public.api.stubs",
Anton Hanssonb7d532e2021-02-05 11:40:25 +0000499 ],
Anton Hansson53cf0ba2020-08-18 12:35:31 +0000500 dist: {
501 dir: "apistubs/android/module-lib",
502 },
Jiyong Park7fb4b182019-12-20 14:35:43 +0900503}
504
Andrei Oneafaa271a2021-03-17 13:32:51 +0000505java_library {
Jihoon Kang1453baa2023-05-27 05:32:30 +0000506 name: "android_system_server_stubs_current.from-source",
Anton Hansson21fb1082023-03-03 16:22:42 +0000507 defaults: [
508 "android.jar_defaults",
509 "android_stubs_dists_default",
510 ],
Andrei Oneafaa271a2021-03-17 13:32:51 +0000511 srcs: [":services-non-updatable-stubs"],
512 installable: false,
513 static_libs: [
Jihoon Kang1453baa2023-05-27 05:32:30 +0000514 "android_module_lib_stubs_current.from-source",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000515 ],
Andrei Oneafaa271a2021-03-17 13:32:51 +0000516 dist: {
517 dir: "apistubs/android/system-server",
518 },
519}
520
Colin Crosscf87a572022-10-20 14:06:53 -0700521java_library {
522 name: "android_stubs_private_jar",
523 defaults: ["android.jar_defaults"],
524 visibility: [
525 "//visibility:override",
526 "//visibility:private",
527 ],
528 static_libs: [
529 "stable.core.platform.api.stubs",
530 "core-lambda-stubs-for-system-modules",
531 "core-generated-annotation-stubs",
532 "framework",
533 "ext",
534 "framework-res-package-jar",
535 // The order of this matters, it has to be last to provide a
536 // package-private androidx.annotation.RecentlyNonNull without
537 // overriding the public android.annotation.Nullable in framework.jar
538 // with its own package-private android.annotation.Nullable.
539 "private-stub-annotations-jar",
540 ],
541}
542
543java_genrule {
544 name: "android_stubs_private_hjar",
Colin Crosscf87a572022-10-20 14:06:53 -0700545 srcs: [":android_stubs_private_jar{.hjar}"],
546 out: ["android_stubs_private.jar"],
547 cmd: "cp $(in) $(out)",
548}
549
550java_library {
551 name: "android_stubs_private",
552 defaults: ["android_stubs_dists_default"],
Colin Crosscf87a572022-10-20 14:06:53 -0700553 sdk_version: "none",
554 system_modules: "none",
555 static_libs: ["android_stubs_private_hjar"],
556 dist: {
557 dir: "apistubs/android/private",
558 },
559}
560
561java_genrule {
562 name: "android_stubs_private_framework_aidl",
Colin Crosscf87a572022-10-20 14:06:53 -0700563 tools: ["sdkparcelables"],
564 srcs: [":android_stubs_private"],
565 out: ["framework.aidl"],
566 cmd: "rm -f $(genDir)/framework.aidl.merged && " +
567 "for i in $(in); do " +
568 " rm -f $(genDir)/framework.aidl.tmp && " +
569 " $(location sdkparcelables) $$i $(genDir)/framework.aidl.tmp && " +
570 " cat $(genDir)/framework.aidl.tmp >> $(genDir)/framework.aidl.merged; " +
571 "done && " +
572 "sort -u $(genDir)/framework.aidl.merged > $(out)",
573 dist: {
574 targets: ["sdk"],
575 dir: "apistubs/android/private",
576 },
577}
578
Jihoon Kang21f8b0e2023-08-17 18:14:35 +0000579//
580// Java API defaults and libraries for single tree build
581//
582
583java_defaults {
584 name: "stub-annotation-defaults",
585 libs: [
586 "stub-annotations",
587 ],
588 static_libs: [
589 // stub annotations do not contribute to the API surfaces but are statically
590 // linked in the stubs for API surfaces (see frameworks/base/StubLibraries.bp).
591 // This is because annotation processors insist on loading the classes for any
592 // annotations found, thus should exist inside android.jar.
593 "private-stub-annotations-jar",
594 ],
595}
596
597// Listing of API domains contribution and dependencies per API surfaces
598java_defaults {
599 name: "android_test_stubs_current_contributions",
600 api_surface: "test",
601 api_contributions: [
Jihoon Kang21f8b0e2023-08-17 18:14:35 +0000602 "framework-virtualization.stubs.source.test.api.contribution",
603 ],
604}
605
606java_defaults {
607 name: "android_module_lib_stubs_current_contributions",
608 api_surface: "module-lib",
609 api_contributions: [
610 "api-stubs-docs-non-updatable.api.contribution",
611 "system-api-stubs-docs-non-updatable.api.contribution",
612 "module-lib-api-stubs-docs-non-updatable.api.contribution",
613 "art.module.public.api.stubs.source.api.contribution",
614 "art.module.public.api.stubs.source.system.api.contribution",
615 "art.module.public.api.stubs.source.module_lib.api.contribution",
616 "i18n.module.public.api.stubs.source.api.contribution",
617 "i18n.module.public.api.stubs.source.system.api.contribution",
618 "i18n.module.public.api.stubs.source.module_lib.api.contribution",
619 ],
620}
621
622// Java API library definitions per API surface
623java_api_library {
624 name: "android_stubs_current.from-text",
625 api_surface: "public",
626 defaults: [
627 // This module is dynamically created at frameworks/base/api/api.go
628 // instead of being written out, in order to minimize edits in the codebase
629 // when there is a change in the list of modules.
630 // that contributes to an api surface.
631 "android_stubs_current_contributions",
632 "stub-annotation-defaults",
633 ],
634 api_contributions: [
635 "api-stubs-docs-non-updatable.api.contribution",
636 ],
637 visibility: ["//visibility:public"],
638}
639
640java_api_library {
641 name: "android_system_stubs_current.from-text",
642 api_surface: "system",
643 defaults: [
644 "android_stubs_current_contributions",
645 "android_system_stubs_current_contributions",
646 "stub-annotation-defaults",
647 ],
648 api_contributions: [
649 "api-stubs-docs-non-updatable.api.contribution",
650 "system-api-stubs-docs-non-updatable.api.contribution",
651 ],
652 visibility: ["//visibility:public"],
653}
654
655java_api_library {
656 name: "android_test_stubs_current.from-text",
657 api_surface: "test",
658 defaults: [
659 "android_stubs_current_contributions",
660 "android_system_stubs_current_contributions",
661 "android_test_stubs_current_contributions",
662 "stub-annotation-defaults",
663 ],
664 api_contributions: [
665 "api-stubs-docs-non-updatable.api.contribution",
666 "system-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang1c5022b2023-09-20 22:02:29 +0000667 "test-api-stubs-docs-non-updatable.api.contribution",
Jihoon Kang21f8b0e2023-08-17 18:14:35 +0000668 ],
669 visibility: ["//visibility:public"],
670}
671
672java_api_library {
673 name: "android_module_lib_stubs_current_full.from-text",
674 api_surface: "module-lib",
675 defaults: [
676 "android_stubs_current_contributions",
677 "android_system_stubs_current_contributions",
678 "android_module_lib_stubs_current_contributions_full",
679 ],
680 libs: [
681 "stub-annotations",
682 ],
683 api_contributions: [
684 "api-stubs-docs-non-updatable.api.contribution",
685 "system-api-stubs-docs-non-updatable.api.contribution",
686 "module-lib-api-stubs-docs-non-updatable.api.contribution",
687 ],
688 visibility: ["//visibility:public"],
689}
690
691java_api_library {
692 name: "android_module_lib_stubs_current.from-text",
693 api_surface: "module-lib",
694 defaults: [
695 "android_module_lib_stubs_current_contributions",
696 ],
697 libs: [
698 "android_module_lib_stubs_current_full.from-text",
699 "stub-annotations",
700 ],
701 visibility: ["//visibility:public"],
702}
703
704java_api_library {
705 name: "android_system_server_stubs_current.from-text",
706 api_surface: "system-server",
707 api_contributions: [
708 "services-non-updatable-stubs.api.contribution",
709 ],
710 libs: [
711 "android_module_lib_stubs_current.from-text",
712 "stub-annotations",
713 ],
714 static_libs: [
715 "android_module_lib_stubs_current.from-text",
716 ],
717 visibility: ["//visibility:public"],
718}
719
Anton Hansson36bc27c2021-09-14 15:45:13 +0100720////////////////////////////////////////////////////////////////////////
721// api-versions.xml generation, for public and system. This API database
722// also contains the android.test.* APIs.
723////////////////////////////////////////////////////////////////////////
724
725java_library {
726 name: "android_stubs_current_with_test_libs",
727 static_libs: [
728 "android_stubs_current",
729 "android.test.base.stubs",
730 "android.test.mock.stubs",
731 "android.test.runner.stubs",
732 ],
733 defaults: ["android.jar_defaults"],
734 visibility: [
735 "//visibility:override",
736 "//visibility:private",
737 ],
738}
739
740java_library {
741 name: "android_system_stubs_current_with_test_libs",
742 static_libs: [
743 "android_system_stubs_current",
744 "android.test.base.stubs.system",
745 "android.test.mock.stubs.system",
746 "android.test.runner.stubs.system",
747 ],
748 defaults: ["android.jar_defaults"],
749 visibility: [
750 "//visibility:override",
751 "//visibility:private",
752 ],
753}
754
Cole Faustdcda3702022-10-04 14:46:35 -0700755java_library {
756 name: "android_module_stubs_current_with_test_libs",
757 static_libs: [
758 "android_module_lib_stubs_current",
759 "android.test.base.stubs",
760 "android.test.mock.stubs",
761 "android.test.runner.stubs",
762 ],
763 defaults: ["android.jar_defaults"],
764 visibility: [
765 "//visibility:override",
766 "//visibility:private",
767 ],
768}
769
770java_library {
771 name: "android_system_server_stubs_current_with_test_libs",
772 static_libs: [
773 "android_system_server_stubs_current",
774 "android.test.base.stubs.system",
775 "android.test.mock.stubs.system",
776 "android.test.runner.stubs.system",
777 ],
778 defaults: ["android.jar_defaults"],
779 visibility: [
780 "//visibility:override",
781 "//visibility:private",
782 ],
783}
784
Anton Hansson36bc27c2021-09-14 15:45:13 +0100785droidstubs {
786 name: "api_versions_public",
787 srcs: [":android_stubs_current_with_test_libs{.jar}"],
788 generate_stubs: false,
789 api_levels_annotations_enabled: true,
790 api_levels_annotations_dirs: [
791 "sdk-dir",
792 "api-versions-jars-dir",
793 ],
Cole Faustdcda3702022-10-04 14:46:35 -0700794 api_levels_sdk_type: "public",
Mårten Kongstad54845332022-09-06 15:50:37 +0200795 extensions_info_file: ":sdk-extensions-info",
Anton Hanssonca6e67a2023-03-03 17:55:09 +0000796 visibility: ["//frameworks/base"],
Anton Hansson36bc27c2021-09-14 15:45:13 +0100797}
798
799droidstubs {
800 name: "api_versions_system",
801 srcs: [":android_system_stubs_current_with_test_libs{.jar}"],
802 generate_stubs: false,
803 api_levels_annotations_enabled: true,
804 api_levels_annotations_dirs: [
805 "sdk-dir",
806 "api-versions-jars-dir",
807 ],
808 api_levels_sdk_type: "system",
Mårten Kongstad54845332022-09-06 15:50:37 +0200809 extensions_info_file: ":sdk-extensions-info",
Anton Hansson36bc27c2021-09-14 15:45:13 +0100810}
811
Cole Faustbf4ce752023-02-08 12:46:06 -0800812// This module can be built with:
813// m out/soong/.intermediates/frameworks/base/api_versions_module_lib/android_common/metalava/api-versions.xml
Cole Faustdcda3702022-10-04 14:46:35 -0700814droidstubs {
815 name: "api_versions_module_lib",
816 srcs: [":android_module_stubs_current_with_test_libs{.jar}"],
817 generate_stubs: false,
818 api_levels_annotations_enabled: true,
Cole Faustbf4ce752023-02-08 12:46:06 -0800819 // this only has the non-updatable portions of the module lib sdk,
820 // which can reference classes from updatable apexes, so remove references to them
821 // from this api_versions file.
822 flags: ["--remove-missing-class-references-in-api-levels"],
Cole Faustdcda3702022-10-04 14:46:35 -0700823 api_levels_annotations_dirs: [
824 "sdk-dir",
825 "api-versions-jars-dir",
826 ],
827 api_levels_sdk_type: "module-lib",
Cole Faust1deced12023-02-15 13:24:18 -0800828 // extensions_info_file is purposefully omitted, because this module should just be
829 // the non-updatable portions of the sdk, and extension sdks are updatable.
Cole Faustdcda3702022-10-04 14:46:35 -0700830}
831
832droidstubs {
833 name: "api_versions_system_server",
834 srcs: [":android_system_server_stubs_current_with_test_libs{.jar}"],
835 generate_stubs: false,
836 api_levels_annotations_enabled: true,
Cole Faustbf4ce752023-02-08 12:46:06 -0800837 // this only has the non-updatable portions of the system server sdk,
838 // which can reference classes from updatable apexes, so remove references to them
839 // from this api_versions file.
840 flags: ["--remove-missing-class-references-in-api-levels"],
Cole Faustdcda3702022-10-04 14:46:35 -0700841 api_levels_annotations_dirs: [
842 "sdk-dir",
843 "api-versions-jars-dir",
844 ],
845 api_levels_sdk_type: "system-server",
Cole Faust1deced12023-02-15 13:24:18 -0800846 // extensions_info_file is purposefully omitted, because this module should just be
847 // the non-updatable portions of the sdk, and extension sdks are updatable.
Cole Faustdcda3702022-10-04 14:46:35 -0700848}
849
Jiyong Park7fb4b182019-12-20 14:35:43 +0900850/////////////////////////////////////////////////////////////////////
851// hwbinder.stubs provides APIs required for building HIDL Java
852// libraries.
853/////////////////////////////////////////////////////////////////////
854
855droidstubs {
856 name: "hwbinder-stubs-docs",
Anton Hansson23f319f2023-03-03 16:04:02 +0000857 srcs: [":hwbinder-stubs-srcs"],
Colin Cross037d7fb2021-03-25 17:01:55 -0700858 libs: ["framework-annotations-lib"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900859 installable: false,
860 sdk_version: "core_platform",
861 annotations_enabled: true,
Anton Hansson48ee95e2020-05-02 17:49:26 +0100862 previous_api: ":android.api.public.latest",
Jiyong Park7fb4b182019-12-20 14:35:43 +0900863 merge_annotations_dirs: [
864 "metalava-manual",
865 ],
Anton Hansson81969c22020-02-03 20:45:56 +0000866 args: priv_apps,
Jiyong Park7fb4b182019-12-20 14:35:43 +0900867}
868
Anton Hanssonbbdd64b2021-04-26 18:47:39 +0100869java_library {
Jiyong Park7fb4b182019-12-20 14:35:43 +0900870 name: "hwbinder.stubs",
871 sdk_version: "core_current",
Colin Cross037d7fb2021-03-25 17:01:55 -0700872 libs: ["framework-annotations-lib"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900873 srcs: [
874 ":hwbinder-stubs-docs",
875 ],
Anton Hansson86925682021-04-14 14:54:43 +0100876 visibility: ["//visibility:public"],
Jiyong Park7fb4b182019-12-20 14:35:43 +0900877}