blob: f89c55705adafbed48b5409b80124e43e932bf30 [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 Hansson0860aaf2021-10-08 16:48:03 +010027bootstrap_go_package {
28 name: "soong-api",
29 pkgPath: "android/soong/api",
30 deps: [
31 "blueprint",
32 "soong",
33 "soong-android",
34 "soong-genrule",
35 ],
36 srcs: ["api.go"],
37 pluginFor: ["soong_build"],
38}
39
Anton Hanssone6737842021-09-27 12:18:20 +010040python_defaults {
41 name: "python3_version_defaults",
Pedro Loureirob91f45d2021-05-26 15:50:07 +000042 version: {
43 py2: {
44 enabled: false,
45 },
46 py3: {
47 enabled: true,
48 embedded_launcher: false,
49 },
50 },
51}
52
Anton Hanssone6737842021-09-27 12:18:20 +010053python_binary_host {
54 name: "api_versions_trimmer",
55 srcs: ["api_versions_trimmer.py"],
56 defaults: ["python3_version_defaults"],
57}
58
Pedro Loureirob91f45d2021-05-26 15:50:07 +000059python_test_host {
60 name: "api_versions_trimmer_unittests",
61 main: "api_versions_trimmer_unittests.py",
62 srcs: [
63 "api_versions_trimmer_unittests.py",
64 "api_versions_trimmer.py",
65 ],
Anton Hanssone6737842021-09-27 12:18:20 +010066 defaults: ["python3_version_defaults"],
Pedro Loureirob91f45d2021-05-26 15:50:07 +000067 test_options: {
68 unit_test: true,
69 },
Anton Hanssone6737842021-09-27 12:18:20 +010070}
71
72python_binary_host {
73 name: "merge_annotation_zips",
74 srcs: ["merge_annotation_zips.py"],
75 defaults: ["python3_version_defaults"],
76}
77
78python_test_host {
79 name: "merge_annotation_zips_test",
80 main: "merge_annotation_zips_test.py",
81 srcs: [
82 "merge_annotation_zips.py",
83 "merge_annotation_zips_test.py",
84 ],
85 defaults: ["python3_version_defaults"],
86 test_options: {
87 unit_test: true,
Pedro Loureirob91f45d2021-05-26 15:50:07 +000088 },
89}
90
Anton Hanssonaa26cc12021-02-15 10:52:33 +000091metalava_cmd = "$(location metalava)"
92// Silence reflection warnings. See b/168689341
93metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED "
Anton Hanssonb8ce0812021-08-24 12:08:39 +010094metalava_cmd += " --quiet --no-banner --format=v2 "
Anton Hanssonaa26cc12021-02-15 10:52:33 +000095
Sasha Smundak02cbff442019-08-15 08:27:51 -070096genrule {
97 name: "current-api-xml",
98 tools: ["metalava"],
Anton Hansson00febe22020-11-05 10:30:59 +000099 srcs: [":frameworks-base-api-current.txt"],
Sasha Smundak02cbff442019-08-15 08:27:51 -0700100 out: ["current.api"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000101 cmd: metalava_cmd + "-convert2xmlnostrip $(in) $(out)",
Anton Hanssonfcb91d42020-09-21 16:32:14 +0100102 visibility: ["//visibility:public"],
Sasha Smundak02cbff442019-08-15 08:27:51 -0700103}
Anton Hansson85359f62020-09-21 17:02:25 +0100104
105genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000106 name: "frameworks-base-api-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100107 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800108 ":android.net.ipsec.ike{.public.api.txt}",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000109 ":art.module.public.api{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100110 ":conscrypt.module.public.api{.public.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100111 ":framework-appsearch{.public.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900112 ":framework-connectivity{.public.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100113 ":framework-graphics{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100114 ":framework-media{.public.api.txt}",
115 ":framework-mediaprovider{.public.api.txt}",
116 ":framework-permission{.public.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800117 ":framework-permission-s{.public.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000118 ":framework-scheduling{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100119 ":framework-sdkextensions{.public.api.txt}",
120 ":framework-statsd{.public.api.txt}",
121 ":framework-tethering{.public.api.txt}",
122 ":framework-wifi{.public.api.txt}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000123 ":i18n.module.public.api{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100124 ":non-updatable-current.txt",
125 ],
126 out: ["current.txt"],
127 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000128 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100129 dists: [
130 {
131 targets: ["droidcore"],
132 dir: "api",
133 dest: "current.txt",
134 },
135 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000136 targets: ["sdk"],
Anton Hanssona9ced802020-10-20 19:26:18 +0100137 dir: "apistubs/android/public/api",
138 dest: "android.txt",
139 },
140 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000141 visibility: ["//visibility:public"],
Anton Hansson85359f62020-09-21 17:02:25 +0100142}
143
144genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000145 name: "frameworks-base-api-current-compat",
146 srcs: [
147 ":android.api.public.latest",
148 ":android-incompatibilities.api.public.latest",
149 ":frameworks-base-api-current.txt",
150 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100151 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000152 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000153 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000154 "--check-compatibility:api:released $(location :android.api.public.latest) " +
155 "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100156 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
157 "$(location :frameworks-base-api-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000158}
159
160genrule {
Anton Hansson89c74dc2020-11-05 20:21:08 +0000161 name: "frameworks-base-api-current.srcjar",
162 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800163 ":android.net.ipsec.ike{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000164 ":api-stubs-docs-non-updatable",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000165 ":art.module.public.api{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000166 ":conscrypt.module.public.api{.public.stubs.source}",
167 ":framework-appsearch{.public.stubs.source}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900168 ":framework-connectivity{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000169 ":framework-graphics{.public.stubs.source}",
170 ":framework-media{.public.stubs.source}",
171 ":framework-mediaprovider{.public.stubs.source}",
172 ":framework-permission{.public.stubs.source}",
Hai Zhang591e1212021-01-21 12:48:43 -0800173 ":framework-permission-s{.public.stubs.source}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000174 ":framework-scheduling{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000175 ":framework-sdkextensions{.public.stubs.source}",
176 ":framework-statsd{.public.stubs.source}",
177 ":framework-tethering{.public.stubs.source}",
178 ":framework-wifi{.public.stubs.source}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000179 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000180 ],
181 out: ["current.srcjar"],
182 tools: ["merge_zips"],
183 cmd: "$(location merge_zips) $(out) $(in)",
184 visibility: ["//visibility:private"], // Used by make module in //development, mind.
185}
186
187genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000188 name: "frameworks-base-api-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100189 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800190 ":android.net.ipsec.ike{.public.removed-api.txt}",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000191 ":art.module.public.api{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100192 ":conscrypt.module.public.api{.public.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100193 ":framework-appsearch{.public.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900194 ":framework-connectivity{.public.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100195 ":framework-graphics{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100196 ":framework-media{.public.removed-api.txt}",
197 ":framework-mediaprovider{.public.removed-api.txt}",
198 ":framework-permission{.public.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800199 ":framework-permission-s{.public.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000200 ":framework-scheduling{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100201 ":framework-sdkextensions{.public.removed-api.txt}",
202 ":framework-statsd{.public.removed-api.txt}",
203 ":framework-tethering{.public.removed-api.txt}",
204 ":framework-wifi{.public.removed-api.txt}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000205 ":i18n.module.public.api{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100206 ":non-updatable-removed.txt",
207 ],
208 out: ["removed.txt"],
209 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000210 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100211 dists: [
212 {
213 targets: ["droidcore"],
214 dir: "api",
215 dest: "removed.txt",
216 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000217 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000218 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000219 dir: "apistubs/android/public/api",
220 dest: "removed.txt",
221 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100222 ],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100223}
224
225genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000226 name: "frameworks-base-api-system-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100227 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100228 ":art.module.public.api{.system.api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800229 ":android.net.ipsec.ike{.system.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100230 ":framework-appsearch{.system.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900231 ":framework-connectivity{.system.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100232 ":framework-graphics{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100233 ":framework-media{.system.api.txt}",
234 ":framework-mediaprovider{.system.api.txt}",
235 ":framework-permission{.system.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800236 ":framework-permission-s{.system.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000237 ":framework-scheduling{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100238 ":framework-sdkextensions{.system.api.txt}",
239 ":framework-statsd{.system.api.txt}",
240 ":framework-tethering{.system.api.txt}",
241 ":framework-wifi{.system.api.txt}",
242 ":non-updatable-system-current.txt",
243 ],
244 out: ["system-current.txt"],
245 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000246 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100247 dists: [
248 {
249 targets: ["droidcore"],
250 dir: "api",
251 dest: "system-current.txt",
252 },
253 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000254 targets: ["sdk"],
Anton Hanssona9ced802020-10-20 19:26:18 +0100255 dir: "apistubs/android/system/api",
256 dest: "android.txt",
257 },
258 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000259 visibility: ["//visibility:public"],
Anton Hansson85359f62020-09-21 17:02:25 +0100260}
261
262genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000263 name: "frameworks-base-api-system-current-compat",
264 srcs: [
265 ":android.api.system.latest",
266 ":android-incompatibilities.api.system.latest",
267 ":frameworks-base-api-current.txt",
268 ":frameworks-base-api-system-current.txt",
269 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100270 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000271 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000272 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000273 "--check-compatibility:api:released $(location :android.api.system.latest) " +
274 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
275 "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100276 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
277 "$(location :frameworks-base-api-system-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000278}
279
280genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000281 name: "frameworks-base-api-system-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100282 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100283 ":art.module.public.api{.system.removed-api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800284 ":android.net.ipsec.ike{.system.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100285 ":framework-appsearch{.system.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900286 ":framework-connectivity{.system.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100287 ":framework-graphics{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100288 ":framework-media{.system.removed-api.txt}",
289 ":framework-mediaprovider{.system.removed-api.txt}",
290 ":framework-permission{.system.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800291 ":framework-permission-s{.system.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000292 ":framework-scheduling{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100293 ":framework-sdkextensions{.system.removed-api.txt}",
294 ":framework-statsd{.system.removed-api.txt}",
295 ":framework-tethering{.system.removed-api.txt}",
296 ":framework-wifi{.system.removed-api.txt}",
297 ":non-updatable-system-removed.txt",
298 ],
299 out: ["system-removed.txt"],
300 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000301 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100302 dists: [
303 {
304 targets: ["droidcore"],
305 dir: "api",
306 dest: "system-removed.txt",
307 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000308 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000309 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000310 dir: "apistubs/android/system/api",
311 dest: "removed.txt",
312 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100313 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000314 visibility: ["//visibility:public"],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100315}
316
317genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000318 name: "frameworks-base-api-module-lib-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100319 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100320 ":art.module.public.api{.module-lib.api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800321 ":android.net.ipsec.ike{.module-lib.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100322 ":framework-appsearch{.module-lib.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900323 ":framework-connectivity{.module-lib.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100324 ":framework-graphics{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100325 ":framework-media{.module-lib.api.txt}",
326 ":framework-mediaprovider{.module-lib.api.txt}",
327 ":framework-permission{.module-lib.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800328 ":framework-permission-s{.module-lib.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000329 ":framework-scheduling{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100330 ":framework-sdkextensions{.module-lib.api.txt}",
331 ":framework-statsd{.module-lib.api.txt}",
332 ":framework-tethering{.module-lib.api.txt}",
333 ":framework-wifi{.module-lib.api.txt}",
334 ":non-updatable-module-lib-current.txt",
335 ],
336 out: ["module-lib-current.txt"],
337 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000338 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100339 dists: [
340 {
341 targets: ["droidcore"],
342 dir: "api",
343 dest: "module-lib-current.txt",
344 },
345 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000346 targets: ["sdk"],
Anton Hanssona9ced802020-10-20 19:26:18 +0100347 dir: "apistubs/android/module-lib/api",
348 dest: "android.txt",
349 },
350 ],
Anton Hansson85359f62020-09-21 17:02:25 +0100351}
Anton Hansson3c1aa112020-09-25 09:13:47 +0100352
353genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000354 name: "frameworks-base-api-module-lib-current-compat",
355 srcs: [
356 ":android.api.module-lib.latest",
357 ":android-incompatibilities.api.module-lib.latest",
358 ":frameworks-base-api-current.txt",
359 ":frameworks-base-api-module-lib-current.txt",
360 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100361 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000362 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000363 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000364 "--check-compatibility:api:released $(location :android.api.module-lib.latest) " +
365 // Note: having "public" be the base of module-lib is not perfect -- it should
366 // ideally be a merged public+system), but this will help when migrating from
367 // MODULE_LIBS -> public.
368 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
369 "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100370 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
371 "$(location :frameworks-base-api-module-lib-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000372}
373
374genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000375 name: "frameworks-base-api-module-lib-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100376 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100377 ":art.module.public.api{.module-lib.removed-api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800378 ":android.net.ipsec.ike{.module-lib.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100379 ":framework-appsearch{.module-lib.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900380 ":framework-connectivity{.module-lib.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100381 ":framework-graphics{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100382 ":framework-media{.module-lib.removed-api.txt}",
383 ":framework-mediaprovider{.module-lib.removed-api.txt}",
384 ":framework-permission{.module-lib.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800385 ":framework-permission-s{.module-lib.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000386 ":framework-scheduling{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100387 ":framework-sdkextensions{.module-lib.removed-api.txt}",
388 ":framework-statsd{.module-lib.removed-api.txt}",
389 ":framework-tethering{.module-lib.removed-api.txt}",
390 ":framework-wifi{.module-lib.removed-api.txt}",
391 ":non-updatable-module-lib-removed.txt",
392 ],
393 out: ["module-lib-removed.txt"],
394 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000395 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100396 dists: [
397 {
398 targets: ["droidcore"],
399 dir: "api",
400 dest: "module-lib-removed.txt",
401 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000402 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000403 targets: ["sdk"],
Anton Hansson85785fe2021-01-20 20:23:34 +0000404 dir: "apistubs/android/module-lib/api",
405 dest: "removed.txt",
406 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100407 ],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100408}
Anton Hanssona15427a2020-10-02 18:21:14 +0100409
410genrule {
411 name: "combined-removed-dex",
Paul Duffin81af1f52021-04-08 19:22:50 +0100412 visibility: [
413 "//frameworks/base/boot",
414 ],
Anton Hanssona15427a2020-10-02 18:21:14 +0100415 srcs: [
Anton Hansson1c4fab42020-11-02 11:57:33 +0000416 ":frameworks-base-api-removed.txt",
417 ":frameworks-base-api-system-removed.txt",
Anton Hanssona15427a2020-10-02 18:21:14 +0100418 ":android.car-stubs-docs{.removed-api.txt}",
419 ":android.car-system-stubs-docs{.removed-api.txt}",
420 ],
421 tool_files: ["gen_combined_removed_dex.sh"],
422 tools: ["metalava"],
423 out: ["combined-removed-dex.txt"],
424 cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)",
425}
Andrei Oneadcb54462021-02-19 16:28:30 +0000426
427genrule {
Anton Hanssonabce6f02021-10-08 16:14:25 +0100428 name: "frameworks-base-api-system-server-current.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000429 srcs: [
Andrei Onea7e609d42021-03-12 17:02:49 +0000430 ":service-media-s{.system-server.api.txt}",
Andrei Oneadcb54462021-02-19 16:28:30 +0000431 ":service-permission{.system-server.api.txt}",
432 ":non-updatable-system-server-current.txt",
433 ],
434 out: ["system-server-current.txt"],
435 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000436 cmd: metalava_cmd + "$(in) --api $(out)",
Andrei Oneadcb54462021-02-19 16:28:30 +0000437 dists: [
438 {
439 targets: ["droidcore"],
440 dir: "api",
441 dest: "system-server-current.txt",
442 },
443 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000444 targets: ["sdk"],
Andrei Oneadcb54462021-02-19 16:28:30 +0000445 dir: "apistubs/android/system-server/api",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000446 dest: "android.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000447 },
448 ],
449}
450
451genrule {
Anton Hanssonabce6f02021-10-08 16:14:25 +0100452 name: "frameworks-base-api-system-server-removed.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000453 srcs: [
Andrei Onea7e609d42021-03-12 17:02:49 +0000454 ":service-media-s{.system-server.removed-api.txt}",
Andrei Oneadcb54462021-02-19 16:28:30 +0000455 ":service-permission{.system-server.removed-api.txt}",
456 ":non-updatable-system-server-removed.txt",
457 ],
458 out: ["system-server-removed.txt"],
459 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000460 cmd: metalava_cmd + "$(in) --api $(out)",
Andrei Oneadcb54462021-02-19 16:28:30 +0000461 dists: [
462 {
463 targets: ["droidcore"],
464 dir: "api",
465 dest: "system-server-removed.txt",
466 },
467 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000468 targets: ["sdk"],
Andrei Oneadcb54462021-02-19 16:28:30 +0000469 dir: "apistubs/android/system-server/api",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000470 dest: "removed.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000471 },
472 ],
473}
Pedro Loureirob91f45d2021-05-26 15:50:07 +0000474
475// This rule will filter classes present in the jar files of mainline modules
476// from the lint database in api-versions.xml.
477// This is done to reduce the number of false positive NewApi findings in
478// java libraries that compile against the module SDK
479genrule {
480 name: "api-versions-xml-public-filtered",
481 srcs: [
482 // Note: order matters: first parameter is the full api-versions.xml
483 // after that the stubs files in any order
484 // stubs files are all modules that export API surfaces EXCEPT ART
485 ":framework-doc-stubs{.api_versions.xml}",
486 ":android.net.ipsec.ike.stubs{.jar}",
487 ":conscrypt.module.public.api.stubs{.jar}",
488 ":framework-appsearch.stubs{.jar}",
489 ":framework-connectivity.stubs{.jar}",
490 ":framework-graphics.stubs{.jar}",
491 ":framework-media.stubs{.jar}",
492 ":framework-mediaprovider.stubs{.jar}",
493 ":framework-permission.stubs{.jar}",
494 ":framework-permission-s.stubs{.jar}",
495 ":framework-scheduling.stubs{.jar}",
496 ":framework-sdkextensions.stubs{.jar}",
497 ":framework-statsd.stubs{.jar}",
498 ":framework-tethering.stubs{.jar}",
499 ":framework-wifi.stubs{.jar}",
500 ":i18n.module.public.api.stubs{.jar}",
501 ],
502 out: ["api-versions-public-filtered.xml"],
503 tools: ["api_versions_trimmer"],
504 cmd: "$(location api_versions_trimmer) $(out) $(in)",
505 dist: {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000506 targets: ["sdk"],
Pedro Loureirob91f45d2021-05-26 15:50:07 +0000507 },
508}