blob: ed2247b6eaa4a00c9db2f3be9b85fcdc2b99ccc3 [file] [log] [blame]
Anton Hanssonfcb91d42020-09-21 16:32:14 +01001// Copyright (C) 2020 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
15package {
16 default_visibility: ["//visibility:private"],
Bob Badour8a6a2bc2021-02-12 17:07:05 -080017 // See: http://go/android-license-faq
18 // A large-scale-change added 'default_applicable_licenses' to import
19 // all of the 'license_kinds' from "frameworks_base_license"
20 // to get the below license kinds:
21 // SPDX-license-identifier-Apache-2.0
22 // SPDX-license-identifier-MIT
23 // SPDX-license-identifier-Unicode-DFS
24 default_applicable_licenses: ["frameworks_base_license"],
Anton Hanssonfcb91d42020-09-21 16:32:14 +010025}
26
Anton Hanssone6737842021-09-27 12:18:20 +010027python_defaults {
28 name: "python3_version_defaults",
Pedro Loureirob91f45d2021-05-26 15:50:07 +000029 version: {
30 py2: {
31 enabled: false,
32 },
33 py3: {
34 enabled: true,
35 embedded_launcher: false,
36 },
37 },
38}
39
Anton Hanssone6737842021-09-27 12:18:20 +010040python_binary_host {
41 name: "api_versions_trimmer",
42 srcs: ["api_versions_trimmer.py"],
43 defaults: ["python3_version_defaults"],
44}
45
Pedro Loureirob91f45d2021-05-26 15:50:07 +000046python_test_host {
47 name: "api_versions_trimmer_unittests",
48 main: "api_versions_trimmer_unittests.py",
49 srcs: [
50 "api_versions_trimmer_unittests.py",
51 "api_versions_trimmer.py",
52 ],
Anton Hanssone6737842021-09-27 12:18:20 +010053 defaults: ["python3_version_defaults"],
Pedro Loureirob91f45d2021-05-26 15:50:07 +000054 test_options: {
55 unit_test: true,
56 },
Anton Hanssone6737842021-09-27 12:18:20 +010057}
58
59python_binary_host {
60 name: "merge_annotation_zips",
61 srcs: ["merge_annotation_zips.py"],
62 defaults: ["python3_version_defaults"],
63}
64
65python_test_host {
66 name: "merge_annotation_zips_test",
67 main: "merge_annotation_zips_test.py",
68 srcs: [
69 "merge_annotation_zips.py",
70 "merge_annotation_zips_test.py",
71 ],
72 defaults: ["python3_version_defaults"],
73 test_options: {
74 unit_test: true,
Pedro Loureirob91f45d2021-05-26 15:50:07 +000075 },
76}
77
Anton Hanssonaa26cc12021-02-15 10:52:33 +000078metalava_cmd = "$(location metalava)"
79// Silence reflection warnings. See b/168689341
80metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED "
Anton Hanssonb8ce0812021-08-24 12:08:39 +010081metalava_cmd += " --quiet --no-banner --format=v2 "
Anton Hanssonaa26cc12021-02-15 10:52:33 +000082
Sasha Smundak02cbff442019-08-15 08:27:51 -070083genrule {
84 name: "current-api-xml",
85 tools: ["metalava"],
Anton Hansson00febe22020-11-05 10:30:59 +000086 srcs: [":frameworks-base-api-current.txt"],
Sasha Smundak02cbff442019-08-15 08:27:51 -070087 out: ["current.api"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +000088 cmd: metalava_cmd + "-convert2xmlnostrip $(in) $(out)",
Anton Hanssonfcb91d42020-09-21 16:32:14 +010089 visibility: ["//visibility:public"],
Sasha Smundak02cbff442019-08-15 08:27:51 -070090}
Anton Hansson85359f62020-09-21 17:02:25 +010091
92genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +000093 name: "frameworks-base-api-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +010094 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -080095 ":android.net.ipsec.ike{.public.api.txt}",
Anton Hanssonfc948d862020-12-17 16:57:35 +000096 ":art.module.public.api{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +010097 ":conscrypt.module.public.api{.public.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +010098 ":framework-appsearch{.public.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +090099 ":framework-connectivity{.public.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100100 ":framework-graphics{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100101 ":framework-media{.public.api.txt}",
102 ":framework-mediaprovider{.public.api.txt}",
103 ":framework-permission{.public.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800104 ":framework-permission-s{.public.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000105 ":framework-scheduling{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100106 ":framework-sdkextensions{.public.api.txt}",
107 ":framework-statsd{.public.api.txt}",
108 ":framework-tethering{.public.api.txt}",
109 ":framework-wifi{.public.api.txt}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000110 ":i18n.module.public.api{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100111 ":non-updatable-current.txt",
112 ],
113 out: ["current.txt"],
114 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000115 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100116 dists: [
117 {
118 targets: ["droidcore"],
119 dir: "api",
120 dest: "current.txt",
121 },
122 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000123 targets: [
124 "sdk",
125 "win_sdk",
126 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100127 dir: "apistubs/android/public/api",
128 dest: "android.txt",
129 },
130 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000131 visibility: ["//visibility:public"],
Anton Hansson85359f62020-09-21 17:02:25 +0100132}
133
134genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000135 name: "frameworks-base-api-current-compat",
136 srcs: [
137 ":android.api.public.latest",
138 ":android-incompatibilities.api.public.latest",
139 ":frameworks-base-api-current.txt",
140 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100141 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000142 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000143 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000144 "--check-compatibility:api:released $(location :android.api.public.latest) " +
145 "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100146 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
147 "$(location :frameworks-base-api-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000148}
149
150genrule {
Anton Hansson89c74dc2020-11-05 20:21:08 +0000151 name: "frameworks-base-api-current.srcjar",
152 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800153 ":android.net.ipsec.ike{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000154 ":api-stubs-docs-non-updatable",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000155 ":art.module.public.api{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000156 ":conscrypt.module.public.api{.public.stubs.source}",
157 ":framework-appsearch{.public.stubs.source}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900158 ":framework-connectivity{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000159 ":framework-graphics{.public.stubs.source}",
160 ":framework-media{.public.stubs.source}",
161 ":framework-mediaprovider{.public.stubs.source}",
162 ":framework-permission{.public.stubs.source}",
Hai Zhang591e1212021-01-21 12:48:43 -0800163 ":framework-permission-s{.public.stubs.source}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000164 ":framework-scheduling{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000165 ":framework-sdkextensions{.public.stubs.source}",
166 ":framework-statsd{.public.stubs.source}",
167 ":framework-tethering{.public.stubs.source}",
168 ":framework-wifi{.public.stubs.source}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000169 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000170 ],
171 out: ["current.srcjar"],
172 tools: ["merge_zips"],
173 cmd: "$(location merge_zips) $(out) $(in)",
174 visibility: ["//visibility:private"], // Used by make module in //development, mind.
175}
176
177genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000178 name: "frameworks-base-api-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100179 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800180 ":android.net.ipsec.ike{.public.removed-api.txt}",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000181 ":art.module.public.api{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100182 ":conscrypt.module.public.api{.public.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100183 ":framework-appsearch{.public.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900184 ":framework-connectivity{.public.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100185 ":framework-graphics{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100186 ":framework-media{.public.removed-api.txt}",
187 ":framework-mediaprovider{.public.removed-api.txt}",
188 ":framework-permission{.public.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800189 ":framework-permission-s{.public.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000190 ":framework-scheduling{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100191 ":framework-sdkextensions{.public.removed-api.txt}",
192 ":framework-statsd{.public.removed-api.txt}",
193 ":framework-tethering{.public.removed-api.txt}",
194 ":framework-wifi{.public.removed-api.txt}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000195 ":i18n.module.public.api{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100196 ":non-updatable-removed.txt",
197 ],
198 out: ["removed.txt"],
199 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000200 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100201 dists: [
202 {
203 targets: ["droidcore"],
204 dir: "api",
205 dest: "removed.txt",
206 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000207 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000208 targets: [
209 "sdk",
210 "win_sdk",
211 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000212 dir: "apistubs/android/public/api",
213 dest: "removed.txt",
214 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100215 ],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100216}
217
218genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000219 name: "frameworks-base-api-system-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100220 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100221 ":art.module.public.api{.system.api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800222 ":android.net.ipsec.ike{.system.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100223 ":framework-appsearch{.system.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900224 ":framework-connectivity{.system.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100225 ":framework-graphics{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100226 ":framework-media{.system.api.txt}",
227 ":framework-mediaprovider{.system.api.txt}",
228 ":framework-permission{.system.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800229 ":framework-permission-s{.system.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000230 ":framework-scheduling{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100231 ":framework-sdkextensions{.system.api.txt}",
232 ":framework-statsd{.system.api.txt}",
233 ":framework-tethering{.system.api.txt}",
234 ":framework-wifi{.system.api.txt}",
235 ":non-updatable-system-current.txt",
236 ],
237 out: ["system-current.txt"],
238 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000239 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100240 dists: [
241 {
242 targets: ["droidcore"],
243 dir: "api",
244 dest: "system-current.txt",
245 },
246 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000247 targets: [
248 "sdk",
249 "win_sdk",
250 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100251 dir: "apistubs/android/system/api",
252 dest: "android.txt",
253 },
254 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000255 visibility: ["//visibility:public"],
Anton Hansson85359f62020-09-21 17:02:25 +0100256}
257
258genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000259 name: "frameworks-base-api-system-current-compat",
260 srcs: [
261 ":android.api.system.latest",
262 ":android-incompatibilities.api.system.latest",
263 ":frameworks-base-api-current.txt",
264 ":frameworks-base-api-system-current.txt",
265 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100266 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000267 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000268 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000269 "--check-compatibility:api:released $(location :android.api.system.latest) " +
270 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
271 "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100272 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
273 "$(location :frameworks-base-api-system-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000274}
275
276genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000277 name: "frameworks-base-api-system-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100278 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100279 ":art.module.public.api{.system.removed-api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800280 ":android.net.ipsec.ike{.system.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100281 ":framework-appsearch{.system.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900282 ":framework-connectivity{.system.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100283 ":framework-graphics{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100284 ":framework-media{.system.removed-api.txt}",
285 ":framework-mediaprovider{.system.removed-api.txt}",
286 ":framework-permission{.system.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800287 ":framework-permission-s{.system.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000288 ":framework-scheduling{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100289 ":framework-sdkextensions{.system.removed-api.txt}",
290 ":framework-statsd{.system.removed-api.txt}",
291 ":framework-tethering{.system.removed-api.txt}",
292 ":framework-wifi{.system.removed-api.txt}",
293 ":non-updatable-system-removed.txt",
294 ],
295 out: ["system-removed.txt"],
296 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000297 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100298 dists: [
299 {
300 targets: ["droidcore"],
301 dir: "api",
302 dest: "system-removed.txt",
303 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000304 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000305 targets: [
306 "sdk",
307 "win_sdk",
308 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000309 dir: "apistubs/android/system/api",
310 dest: "removed.txt",
311 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100312 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000313 visibility: ["//visibility:public"],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100314}
315
316genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000317 name: "frameworks-base-api-module-lib-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100318 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100319 ":art.module.public.api{.module-lib.api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800320 ":android.net.ipsec.ike{.module-lib.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100321 ":framework-appsearch{.module-lib.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900322 ":framework-connectivity{.module-lib.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100323 ":framework-graphics{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100324 ":framework-media{.module-lib.api.txt}",
325 ":framework-mediaprovider{.module-lib.api.txt}",
326 ":framework-permission{.module-lib.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800327 ":framework-permission-s{.module-lib.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000328 ":framework-scheduling{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100329 ":framework-sdkextensions{.module-lib.api.txt}",
330 ":framework-statsd{.module-lib.api.txt}",
331 ":framework-tethering{.module-lib.api.txt}",
332 ":framework-wifi{.module-lib.api.txt}",
333 ":non-updatable-module-lib-current.txt",
334 ],
335 out: ["module-lib-current.txt"],
336 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000337 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100338 dists: [
339 {
340 targets: ["droidcore"],
341 dir: "api",
342 dest: "module-lib-current.txt",
343 },
344 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000345 targets: [
346 "sdk",
347 "win_sdk",
348 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100349 dir: "apistubs/android/module-lib/api",
350 dest: "android.txt",
351 },
352 ],
Anton Hansson85359f62020-09-21 17:02:25 +0100353}
Anton Hansson3c1aa112020-09-25 09:13:47 +0100354
355genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000356 name: "frameworks-base-api-module-lib-current-compat",
357 srcs: [
358 ":android.api.module-lib.latest",
359 ":android-incompatibilities.api.module-lib.latest",
360 ":frameworks-base-api-current.txt",
361 ":frameworks-base-api-module-lib-current.txt",
362 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100363 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000364 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000365 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000366 "--check-compatibility:api:released $(location :android.api.module-lib.latest) " +
367 // Note: having "public" be the base of module-lib is not perfect -- it should
368 // ideally be a merged public+system), but this will help when migrating from
369 // MODULE_LIBS -> public.
370 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
371 "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100372 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
373 "$(location :frameworks-base-api-module-lib-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000374}
375
376genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000377 name: "frameworks-base-api-module-lib-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100378 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100379 ":art.module.public.api{.module-lib.removed-api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800380 ":android.net.ipsec.ike{.module-lib.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100381 ":framework-appsearch{.module-lib.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900382 ":framework-connectivity{.module-lib.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100383 ":framework-graphics{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100384 ":framework-media{.module-lib.removed-api.txt}",
385 ":framework-mediaprovider{.module-lib.removed-api.txt}",
386 ":framework-permission{.module-lib.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800387 ":framework-permission-s{.module-lib.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000388 ":framework-scheduling{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100389 ":framework-sdkextensions{.module-lib.removed-api.txt}",
390 ":framework-statsd{.module-lib.removed-api.txt}",
391 ":framework-tethering{.module-lib.removed-api.txt}",
392 ":framework-wifi{.module-lib.removed-api.txt}",
393 ":non-updatable-module-lib-removed.txt",
394 ],
395 out: ["module-lib-removed.txt"],
396 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000397 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100398 dists: [
399 {
400 targets: ["droidcore"],
401 dir: "api",
402 dest: "module-lib-removed.txt",
403 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000404 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000405 targets: [
406 "sdk",
407 "win_sdk",
408 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000409 dir: "apistubs/android/module-lib/api",
410 dest: "removed.txt",
411 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100412 ],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100413}
Anton Hanssona15427a2020-10-02 18:21:14 +0100414
415genrule {
416 name: "combined-removed-dex",
Paul Duffin81af1f52021-04-08 19:22:50 +0100417 visibility: [
418 "//frameworks/base/boot",
419 ],
Anton Hanssona15427a2020-10-02 18:21:14 +0100420 srcs: [
Anton Hansson1c4fab42020-11-02 11:57:33 +0000421 ":frameworks-base-api-removed.txt",
422 ":frameworks-base-api-system-removed.txt",
Anton Hanssona15427a2020-10-02 18:21:14 +0100423 ":android.car-stubs-docs{.removed-api.txt}",
424 ":android.car-system-stubs-docs{.removed-api.txt}",
425 ],
426 tool_files: ["gen_combined_removed_dex.sh"],
427 tools: ["metalava"],
428 out: ["combined-removed-dex.txt"],
429 cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)",
430}
Andrei Oneadcb54462021-02-19 16:28:30 +0000431
432genrule {
Anton Hanssonabce6f02021-10-08 16:14:25 +0100433 name: "frameworks-base-api-system-server-current.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000434 srcs: [
Andrei Onea7e609d42021-03-12 17:02:49 +0000435 ":service-media-s{.system-server.api.txt}",
Andrei Oneadcb54462021-02-19 16:28:30 +0000436 ":service-permission{.system-server.api.txt}",
437 ":non-updatable-system-server-current.txt",
438 ],
439 out: ["system-server-current.txt"],
440 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000441 cmd: metalava_cmd + "$(in) --api $(out)",
Andrei Oneadcb54462021-02-19 16:28:30 +0000442 dists: [
443 {
444 targets: ["droidcore"],
445 dir: "api",
446 dest: "system-server-current.txt",
447 },
448 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000449 targets: [
450 "sdk",
451 "win_sdk",
452 ],
Andrei Oneadcb54462021-02-19 16:28:30 +0000453 dir: "apistubs/android/system-server/api",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000454 dest: "android.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000455 },
456 ],
457}
458
459genrule {
Anton Hanssonabce6f02021-10-08 16:14:25 +0100460 name: "frameworks-base-api-system-server-removed.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000461 srcs: [
Andrei Onea7e609d42021-03-12 17:02:49 +0000462 ":service-media-s{.system-server.removed-api.txt}",
Andrei Oneadcb54462021-02-19 16:28:30 +0000463 ":service-permission{.system-server.removed-api.txt}",
464 ":non-updatable-system-server-removed.txt",
465 ],
466 out: ["system-server-removed.txt"],
467 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000468 cmd: metalava_cmd + "$(in) --api $(out)",
Andrei Oneadcb54462021-02-19 16:28:30 +0000469 dists: [
470 {
471 targets: ["droidcore"],
472 dir: "api",
473 dest: "system-server-removed.txt",
474 },
475 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000476 targets: [
477 "sdk",
478 "win_sdk",
479 ],
Andrei Oneadcb54462021-02-19 16:28:30 +0000480 dir: "apistubs/android/system-server/api",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000481 dest: "removed.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000482 },
483 ],
484}
Pedro Loureirob91f45d2021-05-26 15:50:07 +0000485
486// This rule will filter classes present in the jar files of mainline modules
487// from the lint database in api-versions.xml.
488// This is done to reduce the number of false positive NewApi findings in
489// java libraries that compile against the module SDK
490genrule {
491 name: "api-versions-xml-public-filtered",
492 srcs: [
493 // Note: order matters: first parameter is the full api-versions.xml
494 // after that the stubs files in any order
495 // stubs files are all modules that export API surfaces EXCEPT ART
496 ":framework-doc-stubs{.api_versions.xml}",
497 ":android.net.ipsec.ike.stubs{.jar}",
498 ":conscrypt.module.public.api.stubs{.jar}",
499 ":framework-appsearch.stubs{.jar}",
500 ":framework-connectivity.stubs{.jar}",
501 ":framework-graphics.stubs{.jar}",
502 ":framework-media.stubs{.jar}",
503 ":framework-mediaprovider.stubs{.jar}",
504 ":framework-permission.stubs{.jar}",
505 ":framework-permission-s.stubs{.jar}",
506 ":framework-scheduling.stubs{.jar}",
507 ":framework-sdkextensions.stubs{.jar}",
508 ":framework-statsd.stubs{.jar}",
509 ":framework-tethering.stubs{.jar}",
510 ":framework-wifi.stubs{.jar}",
511 ":i18n.module.public.api.stubs{.jar}",
512 ],
513 out: ["api-versions-public-filtered.xml"],
514 tools: ["api_versions_trimmer"],
515 cmd: "$(location api_versions_trimmer) $(out) $(in)",
516 dist: {
517 targets: [
518 "sdk",
519 "win_sdk",
520 ],
521 },
522}