blob: 2ea180ebf598201c2138ef24865fa74f13989963 [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
Pedro Loureirob91f45d2021-05-26 15:50:07 +000027python_binary_host {
28 name: "api_versions_trimmer",
29 srcs: ["api_versions_trimmer.py"],
30 version: {
31 py2: {
32 enabled: false,
33 },
34 py3: {
35 enabled: true,
36 embedded_launcher: false,
37 },
38 },
39}
40
41python_test_host {
42 name: "api_versions_trimmer_unittests",
43 main: "api_versions_trimmer_unittests.py",
44 srcs: [
45 "api_versions_trimmer_unittests.py",
46 "api_versions_trimmer.py",
47 ],
48 test_options: {
49 unit_test: true,
50 },
51 version: {
52 py2: {
53 enabled: false,
54 },
55 py3: {
56 enabled: true,
57 embedded_launcher: false,
58 },
59 },
60}
61
Anton Hanssonaa26cc12021-02-15 10:52:33 +000062metalava_cmd = "$(location metalava)"
63// Silence reflection warnings. See b/168689341
64metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED "
65metalava_cmd += " --no-banner --format=v2 "
66
Sasha Smundak02cbff442019-08-15 08:27:51 -070067genrule {
68 name: "current-api-xml",
69 tools: ["metalava"],
Anton Hansson00febe22020-11-05 10:30:59 +000070 srcs: [":frameworks-base-api-current.txt"],
Sasha Smundak02cbff442019-08-15 08:27:51 -070071 out: ["current.api"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +000072 cmd: metalava_cmd + "-convert2xmlnostrip $(in) $(out)",
Anton Hanssonfcb91d42020-09-21 16:32:14 +010073 visibility: ["//visibility:public"],
Sasha Smundak02cbff442019-08-15 08:27:51 -070074}
Anton Hansson85359f62020-09-21 17:02:25 +010075
76genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +000077 name: "frameworks-base-api-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +010078 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -080079 ":android.net.ipsec.ike{.public.api.txt}",
Anton Hanssonfc948d862020-12-17 16:57:35 +000080 ":art.module.public.api{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +010081 ":conscrypt.module.public.api{.public.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +010082 ":framework-appsearch{.public.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +090083 ":framework-connectivity{.public.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +010084 ":framework-graphics{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +010085 ":framework-media{.public.api.txt}",
86 ":framework-mediaprovider{.public.api.txt}",
87 ":framework-permission{.public.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -080088 ":framework-permission-s{.public.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +000089 ":framework-scheduling{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +010090 ":framework-sdkextensions{.public.api.txt}",
91 ":framework-statsd{.public.api.txt}",
92 ":framework-tethering{.public.api.txt}",
93 ":framework-wifi{.public.api.txt}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +000094 ":i18n.module.public.api{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +010095 ":non-updatable-current.txt",
96 ],
97 out: ["current.txt"],
98 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +000099 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100100 dists: [
101 {
102 targets: ["droidcore"],
103 dir: "api",
104 dest: "current.txt",
105 },
106 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000107 targets: [
108 "sdk",
109 "win_sdk",
110 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100111 dir: "apistubs/android/public/api",
112 dest: "android.txt",
113 },
114 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000115 visibility: ["//visibility:public"],
Anton Hansson85359f62020-09-21 17:02:25 +0100116}
117
118genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000119 name: "frameworks-base-api-current-compat",
120 srcs: [
121 ":android.api.public.latest",
122 ":android-incompatibilities.api.public.latest",
123 ":frameworks-base-api-current.txt",
124 ],
125 out: ["stdout.txt"],
126 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000127 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000128 "--check-compatibility:api:released $(location :android.api.public.latest) " +
129 "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " +
130 "$(location :frameworks-base-api-current.txt) " +
131 "> $(genDir)/stdout.txt",
132}
133
134genrule {
Anton Hansson89c74dc2020-11-05 20:21:08 +0000135 name: "frameworks-base-api-current.srcjar",
136 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800137 ":android.net.ipsec.ike{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000138 ":api-stubs-docs-non-updatable",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000139 ":art.module.public.api{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000140 ":conscrypt.module.public.api{.public.stubs.source}",
141 ":framework-appsearch{.public.stubs.source}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900142 ":framework-connectivity{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000143 ":framework-graphics{.public.stubs.source}",
144 ":framework-media{.public.stubs.source}",
145 ":framework-mediaprovider{.public.stubs.source}",
146 ":framework-permission{.public.stubs.source}",
Hai Zhang591e1212021-01-21 12:48:43 -0800147 ":framework-permission-s{.public.stubs.source}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000148 ":framework-scheduling{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000149 ":framework-sdkextensions{.public.stubs.source}",
150 ":framework-statsd{.public.stubs.source}",
151 ":framework-tethering{.public.stubs.source}",
152 ":framework-wifi{.public.stubs.source}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000153 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000154 ],
155 out: ["current.srcjar"],
156 tools: ["merge_zips"],
157 cmd: "$(location merge_zips) $(out) $(in)",
158 visibility: ["//visibility:private"], // Used by make module in //development, mind.
159}
160
161genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000162 name: "frameworks-base-api-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100163 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800164 ":android.net.ipsec.ike{.public.removed-api.txt}",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000165 ":art.module.public.api{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100166 ":conscrypt.module.public.api{.public.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100167 ":framework-appsearch{.public.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900168 ":framework-connectivity{.public.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100169 ":framework-graphics{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100170 ":framework-media{.public.removed-api.txt}",
171 ":framework-mediaprovider{.public.removed-api.txt}",
172 ":framework-permission{.public.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800173 ":framework-permission-s{.public.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000174 ":framework-scheduling{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100175 ":framework-sdkextensions{.public.removed-api.txt}",
176 ":framework-statsd{.public.removed-api.txt}",
177 ":framework-tethering{.public.removed-api.txt}",
178 ":framework-wifi{.public.removed-api.txt}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000179 ":i18n.module.public.api{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100180 ":non-updatable-removed.txt",
181 ],
182 out: ["removed.txt"],
183 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000184 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100185 dists: [
186 {
187 targets: ["droidcore"],
188 dir: "api",
189 dest: "removed.txt",
190 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000191 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000192 targets: [
193 "sdk",
194 "win_sdk",
195 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000196 dir: "apistubs/android/public/api",
197 dest: "removed.txt",
198 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100199 ],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100200}
201
202genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000203 name: "frameworks-base-api-system-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100204 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100205 ":art.module.public.api{.system.api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800206 ":android.net.ipsec.ike{.system.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100207 ":framework-appsearch{.system.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900208 ":framework-connectivity{.system.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100209 ":framework-graphics{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100210 ":framework-media{.system.api.txt}",
211 ":framework-mediaprovider{.system.api.txt}",
212 ":framework-permission{.system.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800213 ":framework-permission-s{.system.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000214 ":framework-scheduling{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100215 ":framework-sdkextensions{.system.api.txt}",
216 ":framework-statsd{.system.api.txt}",
217 ":framework-tethering{.system.api.txt}",
218 ":framework-wifi{.system.api.txt}",
219 ":non-updatable-system-current.txt",
220 ],
221 out: ["system-current.txt"],
222 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000223 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100224 dists: [
225 {
226 targets: ["droidcore"],
227 dir: "api",
228 dest: "system-current.txt",
229 },
230 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000231 targets: [
232 "sdk",
233 "win_sdk",
234 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100235 dir: "apistubs/android/system/api",
236 dest: "android.txt",
237 },
238 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000239 visibility: ["//visibility:public"],
Anton Hansson85359f62020-09-21 17:02:25 +0100240}
241
242genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000243 name: "frameworks-base-api-system-current-compat",
244 srcs: [
245 ":android.api.system.latest",
246 ":android-incompatibilities.api.system.latest",
247 ":frameworks-base-api-current.txt",
248 ":frameworks-base-api-system-current.txt",
249 ],
250 out: ["stdout.txt"],
251 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000252 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000253 "--check-compatibility:api:released $(location :android.api.system.latest) " +
254 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
255 "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " +
256 "$(location :frameworks-base-api-system-current.txt) " +
257 "> $(genDir)/stdout.txt",
258}
259
260genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000261 name: "frameworks-base-api-system-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100262 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100263 ":art.module.public.api{.system.removed-api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800264 ":android.net.ipsec.ike{.system.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100265 ":framework-appsearch{.system.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900266 ":framework-connectivity{.system.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100267 ":framework-graphics{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100268 ":framework-media{.system.removed-api.txt}",
269 ":framework-mediaprovider{.system.removed-api.txt}",
270 ":framework-permission{.system.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800271 ":framework-permission-s{.system.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000272 ":framework-scheduling{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100273 ":framework-sdkextensions{.system.removed-api.txt}",
274 ":framework-statsd{.system.removed-api.txt}",
275 ":framework-tethering{.system.removed-api.txt}",
276 ":framework-wifi{.system.removed-api.txt}",
277 ":non-updatable-system-removed.txt",
278 ],
279 out: ["system-removed.txt"],
280 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000281 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100282 dists: [
283 {
284 targets: ["droidcore"],
285 dir: "api",
286 dest: "system-removed.txt",
287 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000288 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000289 targets: [
290 "sdk",
291 "win_sdk",
292 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000293 dir: "apistubs/android/system/api",
294 dest: "removed.txt",
295 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100296 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000297 visibility: ["//visibility:public"],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100298}
299
300genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000301 name: "frameworks-base-api-module-lib-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100302 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100303 ":art.module.public.api{.module-lib.api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800304 ":android.net.ipsec.ike{.module-lib.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100305 ":framework-appsearch{.module-lib.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900306 ":framework-connectivity{.module-lib.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100307 ":framework-graphics{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100308 ":framework-media{.module-lib.api.txt}",
309 ":framework-mediaprovider{.module-lib.api.txt}",
310 ":framework-permission{.module-lib.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800311 ":framework-permission-s{.module-lib.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000312 ":framework-scheduling{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100313 ":framework-sdkextensions{.module-lib.api.txt}",
314 ":framework-statsd{.module-lib.api.txt}",
315 ":framework-tethering{.module-lib.api.txt}",
316 ":framework-wifi{.module-lib.api.txt}",
317 ":non-updatable-module-lib-current.txt",
318 ],
319 out: ["module-lib-current.txt"],
320 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000321 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100322 dists: [
323 {
324 targets: ["droidcore"],
325 dir: "api",
326 dest: "module-lib-current.txt",
327 },
328 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000329 targets: [
330 "sdk",
331 "win_sdk",
332 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100333 dir: "apistubs/android/module-lib/api",
334 dest: "android.txt",
335 },
336 ],
Anton Hansson85359f62020-09-21 17:02:25 +0100337}
Anton Hansson3c1aa112020-09-25 09:13:47 +0100338
339genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000340 name: "frameworks-base-api-module-lib-current-compat",
341 srcs: [
342 ":android.api.module-lib.latest",
343 ":android-incompatibilities.api.module-lib.latest",
344 ":frameworks-base-api-current.txt",
345 ":frameworks-base-api-module-lib-current.txt",
346 ],
347 out: ["stdout.txt"],
348 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000349 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000350 "--check-compatibility:api:released $(location :android.api.module-lib.latest) " +
351 // Note: having "public" be the base of module-lib is not perfect -- it should
352 // ideally be a merged public+system), but this will help when migrating from
353 // MODULE_LIBS -> public.
354 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
355 "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " +
356 "$(location :frameworks-base-api-module-lib-current.txt) " +
357 "> $(genDir)/stdout.txt",
358}
359
360genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000361 name: "frameworks-base-api-module-lib-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100362 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100363 ":art.module.public.api{.module-lib.removed-api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800364 ":android.net.ipsec.ike{.module-lib.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100365 ":framework-appsearch{.module-lib.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900366 ":framework-connectivity{.module-lib.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100367 ":framework-graphics{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100368 ":framework-media{.module-lib.removed-api.txt}",
369 ":framework-mediaprovider{.module-lib.removed-api.txt}",
370 ":framework-permission{.module-lib.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800371 ":framework-permission-s{.module-lib.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000372 ":framework-scheduling{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100373 ":framework-sdkextensions{.module-lib.removed-api.txt}",
374 ":framework-statsd{.module-lib.removed-api.txt}",
375 ":framework-tethering{.module-lib.removed-api.txt}",
376 ":framework-wifi{.module-lib.removed-api.txt}",
377 ":non-updatable-module-lib-removed.txt",
378 ],
379 out: ["module-lib-removed.txt"],
380 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000381 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100382 dists: [
383 {
384 targets: ["droidcore"],
385 dir: "api",
386 dest: "module-lib-removed.txt",
387 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000388 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000389 targets: [
390 "sdk",
391 "win_sdk",
392 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000393 dir: "apistubs/android/module-lib/api",
394 dest: "removed.txt",
395 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100396 ],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100397}
Anton Hanssona15427a2020-10-02 18:21:14 +0100398
399genrule {
400 name: "combined-removed-dex",
Paul Duffin81af1f52021-04-08 19:22:50 +0100401 visibility: [
402 "//frameworks/base/boot",
403 ],
Anton Hanssona15427a2020-10-02 18:21:14 +0100404 srcs: [
Anton Hansson1c4fab42020-11-02 11:57:33 +0000405 ":frameworks-base-api-removed.txt",
406 ":frameworks-base-api-system-removed.txt",
Anton Hanssona15427a2020-10-02 18:21:14 +0100407 ":android.car-stubs-docs{.removed-api.txt}",
408 ":android.car-system-stubs-docs{.removed-api.txt}",
409 ],
410 tool_files: ["gen_combined_removed_dex.sh"],
411 tools: ["metalava"],
412 out: ["combined-removed-dex.txt"],
413 cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)",
414}
Andrei Oneadcb54462021-02-19 16:28:30 +0000415
416genrule {
417 name: "services-system-server-current.txt",
418 srcs: [
Andrei Onea7e609d42021-03-12 17:02:49 +0000419 ":service-media-s{.system-server.api.txt}",
Andrei Oneadcb54462021-02-19 16:28:30 +0000420 ":service-permission{.system-server.api.txt}",
421 ":non-updatable-system-server-current.txt",
422 ],
423 out: ["system-server-current.txt"],
424 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000425 cmd: metalava_cmd + "$(in) --api $(out)",
Andrei Oneadcb54462021-02-19 16:28:30 +0000426 dists: [
427 {
428 targets: ["droidcore"],
429 dir: "api",
430 dest: "system-server-current.txt",
431 },
432 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000433 targets: [
434 "sdk",
435 "win_sdk",
436 ],
Andrei Oneadcb54462021-02-19 16:28:30 +0000437 dir: "apistubs/android/system-server/api",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000438 dest: "android.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000439 },
440 ],
441}
442
443genrule {
444 name: "services-system-server-removed.txt",
445 srcs: [
Andrei Onea7e609d42021-03-12 17:02:49 +0000446 ":service-media-s{.system-server.removed-api.txt}",
Andrei Oneadcb54462021-02-19 16:28:30 +0000447 ":service-permission{.system-server.removed-api.txt}",
448 ":non-updatable-system-server-removed.txt",
449 ],
450 out: ["system-server-removed.txt"],
451 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000452 cmd: metalava_cmd + "$(in) --api $(out)",
Andrei Oneadcb54462021-02-19 16:28:30 +0000453 dists: [
454 {
455 targets: ["droidcore"],
456 dir: "api",
457 dest: "system-server-removed.txt",
458 },
459 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000460 targets: [
461 "sdk",
462 "win_sdk",
463 ],
Andrei Oneadcb54462021-02-19 16:28:30 +0000464 dir: "apistubs/android/system-server/api",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000465 dest: "removed.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000466 },
467 ],
468}
Pedro Loureirob91f45d2021-05-26 15:50:07 +0000469
470// This rule will filter classes present in the jar files of mainline modules
471// from the lint database in api-versions.xml.
472// This is done to reduce the number of false positive NewApi findings in
473// java libraries that compile against the module SDK
474genrule {
475 name: "api-versions-xml-public-filtered",
476 srcs: [
477 // Note: order matters: first parameter is the full api-versions.xml
478 // after that the stubs files in any order
479 // stubs files are all modules that export API surfaces EXCEPT ART
480 ":framework-doc-stubs{.api_versions.xml}",
481 ":android.net.ipsec.ike.stubs{.jar}",
482 ":conscrypt.module.public.api.stubs{.jar}",
483 ":framework-appsearch.stubs{.jar}",
484 ":framework-connectivity.stubs{.jar}",
485 ":framework-graphics.stubs{.jar}",
486 ":framework-media.stubs{.jar}",
487 ":framework-mediaprovider.stubs{.jar}",
488 ":framework-permission.stubs{.jar}",
489 ":framework-permission-s.stubs{.jar}",
490 ":framework-scheduling.stubs{.jar}",
491 ":framework-sdkextensions.stubs{.jar}",
492 ":framework-statsd.stubs{.jar}",
493 ":framework-tethering.stubs{.jar}",
494 ":framework-wifi.stubs{.jar}",
495 ":i18n.module.public.api.stubs{.jar}",
496 ],
497 out: ["api-versions-public-filtered.xml"],
498 tools: ["api_versions_trimmer"],
499 cmd: "$(location api_versions_trimmer) $(out) $(in)",
500 dist: {
501 targets: [
502 "sdk",
503 "win_sdk",
504 ],
505 },
506}