blob: 1bc50bd409a2917c488cefda547a6e6a20b21dbe [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}",
Chun Zhanga615ce52021-10-29 14:57:55 -0700103 ":framework-nearby{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100104 ":framework-permission{.public.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800105 ":framework-permission-s{.public.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000106 ":framework-scheduling{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100107 ":framework-sdkextensions{.public.api.txt}",
108 ":framework-statsd{.public.api.txt}",
109 ":framework-tethering{.public.api.txt}",
Roshan Pius6c580dd2021-07-29 21:31:23 -0700110 ":framework-uwb{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100111 ":framework-wifi{.public.api.txt}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000112 ":i18n.module.public.api{.public.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100113 ":non-updatable-current.txt",
114 ],
115 out: ["current.txt"],
116 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000117 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100118 dists: [
119 {
120 targets: ["droidcore"],
121 dir: "api",
122 dest: "current.txt",
123 },
124 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000125 targets: [
126 "sdk",
127 "win_sdk",
128 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100129 dir: "apistubs/android/public/api",
130 dest: "android.txt",
131 },
132 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000133 visibility: ["//visibility:public"],
Anton Hansson85359f62020-09-21 17:02:25 +0100134}
135
136genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000137 name: "frameworks-base-api-current-compat",
138 srcs: [
139 ":android.api.public.latest",
140 ":android-incompatibilities.api.public.latest",
141 ":frameworks-base-api-current.txt",
142 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100143 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000144 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000145 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000146 "--check-compatibility:api:released $(location :android.api.public.latest) " +
147 "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100148 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
149 "$(location :frameworks-base-api-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000150}
151
152genrule {
Anton Hansson89c74dc2020-11-05 20:21:08 +0000153 name: "frameworks-base-api-current.srcjar",
154 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800155 ":android.net.ipsec.ike{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000156 ":api-stubs-docs-non-updatable",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000157 ":art.module.public.api{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000158 ":conscrypt.module.public.api{.public.stubs.source}",
159 ":framework-appsearch{.public.stubs.source}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900160 ":framework-connectivity{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000161 ":framework-graphics{.public.stubs.source}",
162 ":framework-media{.public.stubs.source}",
163 ":framework-mediaprovider{.public.stubs.source}",
Chun Zhanga615ce52021-10-29 14:57:55 -0700164 ":framework-nearby{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000165 ":framework-permission{.public.stubs.source}",
Hai Zhang591e1212021-01-21 12:48:43 -0800166 ":framework-permission-s{.public.stubs.source}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000167 ":framework-scheduling{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000168 ":framework-sdkextensions{.public.stubs.source}",
169 ":framework-statsd{.public.stubs.source}",
170 ":framework-tethering{.public.stubs.source}",
Roshan Pius6c580dd2021-07-29 21:31:23 -0700171 ":framework-uwb{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000172 ":framework-wifi{.public.stubs.source}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000173 ":i18n.module.public.api{.public.stubs.source}",
Anton Hansson89c74dc2020-11-05 20:21:08 +0000174 ],
175 out: ["current.srcjar"],
176 tools: ["merge_zips"],
177 cmd: "$(location merge_zips) $(out) $(in)",
178 visibility: ["//visibility:private"], // Used by make module in //development, mind.
179}
180
181genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000182 name: "frameworks-base-api-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100183 srcs: [
Yan Yan1357a422021-02-03 16:07:30 -0800184 ":android.net.ipsec.ike{.public.removed-api.txt}",
Anton Hanssonfc948d862020-12-17 16:57:35 +0000185 ":art.module.public.api{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100186 ":conscrypt.module.public.api{.public.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100187 ":framework-appsearch{.public.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900188 ":framework-connectivity{.public.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100189 ":framework-graphics{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100190 ":framework-media{.public.removed-api.txt}",
191 ":framework-mediaprovider{.public.removed-api.txt}",
Chun Zhanga615ce52021-10-29 14:57:55 -0700192 ":framework-nearby{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100193 ":framework-permission{.public.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800194 ":framework-permission-s{.public.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000195 ":framework-scheduling{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100196 ":framework-sdkextensions{.public.removed-api.txt}",
197 ":framework-statsd{.public.removed-api.txt}",
198 ":framework-tethering{.public.removed-api.txt}",
Roshan Pius6c580dd2021-07-29 21:31:23 -0700199 ":framework-uwb{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100200 ":framework-wifi{.public.removed-api.txt}",
Paul Duffin5a4e8f22020-11-25 15:45:43 +0000201 ":i18n.module.public.api{.public.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100202 ":non-updatable-removed.txt",
203 ],
204 out: ["removed.txt"],
205 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000206 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100207 dists: [
208 {
209 targets: ["droidcore"],
210 dir: "api",
211 dest: "removed.txt",
212 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000213 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000214 targets: [
215 "sdk",
216 "win_sdk",
217 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000218 dir: "apistubs/android/public/api",
219 dest: "removed.txt",
220 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100221 ],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100222}
223
224genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000225 name: "frameworks-base-api-system-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100226 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100227 ":art.module.public.api{.system.api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800228 ":android.net.ipsec.ike{.system.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100229 ":framework-appsearch{.system.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900230 ":framework-connectivity{.system.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100231 ":framework-graphics{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100232 ":framework-media{.system.api.txt}",
233 ":framework-mediaprovider{.system.api.txt}",
Chun Zhanga615ce52021-10-29 14:57:55 -0700234 ":framework-nearby{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100235 ":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}",
Roshan Pius6c580dd2021-07-29 21:31:23 -0700241 ":framework-uwb{.system.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100242 ":framework-wifi{.system.api.txt}",
243 ":non-updatable-system-current.txt",
244 ],
245 out: ["system-current.txt"],
246 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000247 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100248 dists: [
249 {
250 targets: ["droidcore"],
251 dir: "api",
252 dest: "system-current.txt",
253 },
254 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000255 targets: [
256 "sdk",
257 "win_sdk",
258 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100259 dir: "apistubs/android/system/api",
260 dest: "android.txt",
261 },
262 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000263 visibility: ["//visibility:public"],
Anton Hansson85359f62020-09-21 17:02:25 +0100264}
265
266genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000267 name: "frameworks-base-api-system-current-compat",
268 srcs: [
269 ":android.api.system.latest",
270 ":android-incompatibilities.api.system.latest",
271 ":frameworks-base-api-current.txt",
272 ":frameworks-base-api-system-current.txt",
273 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100274 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000275 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000276 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000277 "--check-compatibility:api:released $(location :android.api.system.latest) " +
278 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
279 "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100280 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
281 "$(location :frameworks-base-api-system-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000282}
283
284genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000285 name: "frameworks-base-api-system-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100286 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100287 ":art.module.public.api{.system.removed-api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800288 ":android.net.ipsec.ike{.system.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100289 ":framework-appsearch{.system.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900290 ":framework-connectivity{.system.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100291 ":framework-graphics{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100292 ":framework-media{.system.removed-api.txt}",
293 ":framework-mediaprovider{.system.removed-api.txt}",
Chun Zhanga615ce52021-10-29 14:57:55 -0700294 ":framework-nearby{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100295 ":framework-permission{.system.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800296 ":framework-permission-s{.system.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000297 ":framework-scheduling{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100298 ":framework-sdkextensions{.system.removed-api.txt}",
299 ":framework-statsd{.system.removed-api.txt}",
300 ":framework-tethering{.system.removed-api.txt}",
Roshan Pius6c580dd2021-07-29 21:31:23 -0700301 ":framework-uwb{.system.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100302 ":framework-wifi{.system.removed-api.txt}",
303 ":non-updatable-system-removed.txt",
304 ],
305 out: ["system-removed.txt"],
306 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000307 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100308 dists: [
309 {
310 targets: ["droidcore"],
311 dir: "api",
312 dest: "system-removed.txt",
313 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000314 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000315 targets: [
316 "sdk",
317 "win_sdk",
318 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000319 dir: "apistubs/android/system/api",
320 dest: "removed.txt",
321 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100322 ],
Anton Hansson1c4fab42020-11-02 11:57:33 +0000323 visibility: ["//visibility:public"],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100324}
325
326genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000327 name: "frameworks-base-api-module-lib-current.txt",
Anton Hansson85359f62020-09-21 17:02:25 +0100328 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100329 ":art.module.public.api{.module-lib.api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800330 ":android.net.ipsec.ike{.module-lib.api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100331 ":framework-appsearch{.module-lib.api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900332 ":framework-connectivity{.module-lib.api.txt}",
Anton Hansson0eccccb2020-09-24 12:09:25 +0100333 ":framework-graphics{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100334 ":framework-media{.module-lib.api.txt}",
335 ":framework-mediaprovider{.module-lib.api.txt}",
Chun Zhanga615ce52021-10-29 14:57:55 -0700336 ":framework-nearby{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100337 ":framework-permission{.module-lib.api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800338 ":framework-permission-s{.module-lib.api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000339 ":framework-scheduling{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100340 ":framework-sdkextensions{.module-lib.api.txt}",
341 ":framework-statsd{.module-lib.api.txt}",
342 ":framework-tethering{.module-lib.api.txt}",
Roshan Pius6c580dd2021-07-29 21:31:23 -0700343 ":framework-uwb{.module-lib.api.txt}",
Anton Hansson85359f62020-09-21 17:02:25 +0100344 ":framework-wifi{.module-lib.api.txt}",
345 ":non-updatable-module-lib-current.txt",
346 ],
347 out: ["module-lib-current.txt"],
348 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000349 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100350 dists: [
351 {
352 targets: ["droidcore"],
353 dir: "api",
354 dest: "module-lib-current.txt",
355 },
356 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000357 targets: [
358 "sdk",
359 "win_sdk",
360 ],
Anton Hanssona9ced802020-10-20 19:26:18 +0100361 dir: "apistubs/android/module-lib/api",
362 dest: "android.txt",
363 },
364 ],
Anton Hansson85359f62020-09-21 17:02:25 +0100365}
Anton Hansson3c1aa112020-09-25 09:13:47 +0100366
367genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000368 name: "frameworks-base-api-module-lib-current-compat",
369 srcs: [
370 ":android.api.module-lib.latest",
371 ":android-incompatibilities.api.module-lib.latest",
372 ":frameworks-base-api-current.txt",
373 ":frameworks-base-api-module-lib-current.txt",
374 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100375 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000376 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000377 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000378 "--check-compatibility:api:released $(location :android.api.module-lib.latest) " +
379 // Note: having "public" be the base of module-lib is not perfect -- it should
380 // ideally be a merged public+system), but this will help when migrating from
381 // MODULE_LIBS -> public.
382 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
383 "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100384 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
385 "$(location :frameworks-base-api-module-lib-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000386}
387
388genrule {
Anton Hansson1c4fab42020-11-02 11:57:33 +0000389 name: "frameworks-base-api-module-lib-removed.txt",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100390 srcs: [
Victor Chang9f5cdff2021-05-12 10:47:16 +0100391 ":art.module.public.api{.module-lib.removed-api.txt}",
Yan Yan1357a422021-02-03 16:07:30 -0800392 ":android.net.ipsec.ike{.module-lib.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100393 ":framework-appsearch{.module-lib.removed-api.txt}",
Remi NGUYEN VAN9f223cb2021-01-28 13:37:03 +0900394 ":framework-connectivity{.module-lib.removed-api.txt}",
Anton Hanssond74139e2020-10-08 14:59:17 +0100395 ":framework-graphics{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100396 ":framework-media{.module-lib.removed-api.txt}",
397 ":framework-mediaprovider{.module-lib.removed-api.txt}",
Chun Zhanga615ce52021-10-29 14:57:55 -0700398 ":framework-nearby{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100399 ":framework-permission{.module-lib.removed-api.txt}",
Hai Zhang591e1212021-01-21 12:48:43 -0800400 ":framework-permission-s{.module-lib.removed-api.txt}",
Gavin Corkery338545d2021-02-15 20:22:58 +0000401 ":framework-scheduling{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100402 ":framework-sdkextensions{.module-lib.removed-api.txt}",
403 ":framework-statsd{.module-lib.removed-api.txt}",
404 ":framework-tethering{.module-lib.removed-api.txt}",
Roshan Pius6c580dd2021-07-29 21:31:23 -0700405 ":framework-uwb{.module-lib.removed-api.txt}",
Anton Hansson3c1aa112020-09-25 09:13:47 +0100406 ":framework-wifi{.module-lib.removed-api.txt}",
407 ":non-updatable-module-lib-removed.txt",
408 ],
409 out: ["module-lib-removed.txt"],
410 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000411 cmd: metalava_cmd + "$(in) --api $(out)",
Anton Hanssona9ced802020-10-20 19:26:18 +0100412 dists: [
413 {
414 targets: ["droidcore"],
415 dir: "api",
416 dest: "module-lib-removed.txt",
417 },
Anton Hansson85785fe2021-01-20 20:23:34 +0000418 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000419 targets: [
420 "sdk",
421 "win_sdk",
422 ],
Anton Hansson85785fe2021-01-20 20:23:34 +0000423 dir: "apistubs/android/module-lib/api",
424 dest: "removed.txt",
425 },
Anton Hanssona9ced802020-10-20 19:26:18 +0100426 ],
Anton Hansson3c1aa112020-09-25 09:13:47 +0100427}
Anton Hanssona15427a2020-10-02 18:21:14 +0100428
429genrule {
430 name: "combined-removed-dex",
Paul Duffin81af1f52021-04-08 19:22:50 +0100431 visibility: [
432 "//frameworks/base/boot",
433 ],
Anton Hanssona15427a2020-10-02 18:21:14 +0100434 srcs: [
Anton Hansson1c4fab42020-11-02 11:57:33 +0000435 ":frameworks-base-api-removed.txt",
436 ":frameworks-base-api-system-removed.txt",
Anton Hanssona15427a2020-10-02 18:21:14 +0100437 ":android.car-stubs-docs{.removed-api.txt}",
438 ":android.car-system-stubs-docs{.removed-api.txt}",
439 ],
440 tool_files: ["gen_combined_removed_dex.sh"],
441 tools: ["metalava"],
442 out: ["combined-removed-dex.txt"],
443 cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)",
444}
Andrei Oneadcb54462021-02-19 16:28:30 +0000445
446genrule {
Anton Hanssonabce6f02021-10-08 16:14:25 +0100447 name: "frameworks-base-api-system-server-current.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000448 srcs: [
Andrei Onea7e609d42021-03-12 17:02:49 +0000449 ":service-media-s{.system-server.api.txt}",
Andrei Oneadcb54462021-02-19 16:28:30 +0000450 ":service-permission{.system-server.api.txt}",
451 ":non-updatable-system-server-current.txt",
452 ],
453 out: ["system-server-current.txt"],
454 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000455 cmd: metalava_cmd + "$(in) --api $(out)",
Andrei Oneadcb54462021-02-19 16:28:30 +0000456 dists: [
457 {
458 targets: ["droidcore"],
459 dir: "api",
460 dest: "system-server-current.txt",
461 },
462 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000463 targets: [
464 "sdk",
465 "win_sdk",
466 ],
Andrei Oneadcb54462021-02-19 16:28:30 +0000467 dir: "apistubs/android/system-server/api",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000468 dest: "android.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000469 },
470 ],
471}
472
473genrule {
Anton Hanssonabce6f02021-10-08 16:14:25 +0100474 name: "frameworks-base-api-system-server-removed.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000475 srcs: [
Andrei Onea7e609d42021-03-12 17:02:49 +0000476 ":service-media-s{.system-server.removed-api.txt}",
Andrei Oneadcb54462021-02-19 16:28:30 +0000477 ":service-permission{.system-server.removed-api.txt}",
478 ":non-updatable-system-server-removed.txt",
479 ],
480 out: ["system-server-removed.txt"],
481 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000482 cmd: metalava_cmd + "$(in) --api $(out)",
Andrei Oneadcb54462021-02-19 16:28:30 +0000483 dists: [
484 {
485 targets: ["droidcore"],
486 dir: "api",
487 dest: "system-server-removed.txt",
488 },
489 {
Pedro Loureiro29365192021-06-09 10:59:32 +0000490 targets: [
491 "sdk",
492 "win_sdk",
493 ],
Andrei Oneadcb54462021-02-19 16:28:30 +0000494 dir: "apistubs/android/system-server/api",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000495 dest: "removed.txt",
Andrei Oneadcb54462021-02-19 16:28:30 +0000496 },
497 ],
498}
Pedro Loureirob91f45d2021-05-26 15:50:07 +0000499
500// This rule will filter classes present in the jar files of mainline modules
501// from the lint database in api-versions.xml.
502// This is done to reduce the number of false positive NewApi findings in
503// java libraries that compile against the module SDK
504genrule {
505 name: "api-versions-xml-public-filtered",
506 srcs: [
507 // Note: order matters: first parameter is the full api-versions.xml
508 // after that the stubs files in any order
509 // stubs files are all modules that export API surfaces EXCEPT ART
510 ":framework-doc-stubs{.api_versions.xml}",
511 ":android.net.ipsec.ike.stubs{.jar}",
512 ":conscrypt.module.public.api.stubs{.jar}",
513 ":framework-appsearch.stubs{.jar}",
514 ":framework-connectivity.stubs{.jar}",
515 ":framework-graphics.stubs{.jar}",
516 ":framework-media.stubs{.jar}",
517 ":framework-mediaprovider.stubs{.jar}",
Chun Zhanga615ce52021-10-29 14:57:55 -0700518 ":framework-nearby.stubs{.jar}",
Pedro Loureirob91f45d2021-05-26 15:50:07 +0000519 ":framework-permission.stubs{.jar}",
520 ":framework-permission-s.stubs{.jar}",
521 ":framework-scheduling.stubs{.jar}",
522 ":framework-sdkextensions.stubs{.jar}",
523 ":framework-statsd.stubs{.jar}",
524 ":framework-tethering.stubs{.jar}",
Roshan Pius6c580dd2021-07-29 21:31:23 -0700525 ":framework-uwb.stubs{.jar}",
Pedro Loureirob91f45d2021-05-26 15:50:07 +0000526 ":framework-wifi.stubs{.jar}",
527 ":i18n.module.public.api.stubs{.jar}",
528 ],
529 out: ["api-versions-public-filtered.xml"],
530 tools: ["api_versions_trimmer"],
531 cmd: "$(location api_versions_trimmer) $(out) $(in)",
532 dist: {
533 targets: [
534 "sdk",
535 "win_sdk",
536 ],
537 },
538}