blob: 89993e751cf0890aa7d688b130471990b4f87a43 [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",
Anton Hansson47ff71a2022-01-13 09:45:12 +000035 "soong-java",
Anton Hansson0860aaf2021-10-08 16:48:03 +010036 ],
37 srcs: ["api.go"],
38 pluginFor: ["soong_build"],
39}
40
Anton Hanssone6737842021-09-27 12:18:20 +010041python_defaults {
42 name: "python3_version_defaults",
Pedro Loureirob91f45d2021-05-26 15:50:07 +000043 version: {
44 py2: {
45 enabled: false,
46 },
47 py3: {
48 enabled: true,
49 embedded_launcher: false,
50 },
51 },
52}
53
Anton Hanssone6737842021-09-27 12:18:20 +010054python_binary_host {
55 name: "api_versions_trimmer",
56 srcs: ["api_versions_trimmer.py"],
57 defaults: ["python3_version_defaults"],
58}
59
Pedro Loureirob91f45d2021-05-26 15:50:07 +000060python_test_host {
61 name: "api_versions_trimmer_unittests",
62 main: "api_versions_trimmer_unittests.py",
63 srcs: [
64 "api_versions_trimmer_unittests.py",
65 "api_versions_trimmer.py",
66 ],
Anton Hanssone6737842021-09-27 12:18:20 +010067 defaults: ["python3_version_defaults"],
Pedro Loureirob91f45d2021-05-26 15:50:07 +000068 test_options: {
69 unit_test: true,
70 },
Anton Hanssone6737842021-09-27 12:18:20 +010071}
72
73python_binary_host {
74 name: "merge_annotation_zips",
75 srcs: ["merge_annotation_zips.py"],
76 defaults: ["python3_version_defaults"],
77}
78
79python_test_host {
80 name: "merge_annotation_zips_test",
81 main: "merge_annotation_zips_test.py",
82 srcs: [
83 "merge_annotation_zips.py",
84 "merge_annotation_zips_test.py",
85 ],
86 defaults: ["python3_version_defaults"],
87 test_options: {
88 unit_test: true,
Pedro Loureirob91f45d2021-05-26 15:50:07 +000089 },
90}
91
Anton Hanssonaa26cc12021-02-15 10:52:33 +000092metalava_cmd = "$(location metalava)"
93// Silence reflection warnings. See b/168689341
94metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED "
Anton Hanssonb8ce0812021-08-24 12:08:39 +010095metalava_cmd += " --quiet --no-banner --format=v2 "
Anton Hanssonaa26cc12021-02-15 10:52:33 +000096
Sasha Smundak02cbff442019-08-15 08:27:51 -070097genrule {
98 name: "current-api-xml",
99 tools: ["metalava"],
Anton Hansson00febe22020-11-05 10:30:59 +0000100 srcs: [":frameworks-base-api-current.txt"],
Sasha Smundak02cbff442019-08-15 08:27:51 -0700101 out: ["current.api"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000102 cmd: metalava_cmd + "-convert2xmlnostrip $(in) $(out)",
Anton Hanssonfcb91d42020-09-21 16:32:14 +0100103 visibility: ["//visibility:public"],
Sasha Smundak02cbff442019-08-15 08:27:51 -0700104}
Anton Hansson85359f62020-09-21 17:02:25 +0100105
Anton Hansson648e6092022-01-11 16:37:05 +0000106combined_apis {
107 name: "frameworks-base-api",
108 bootclasspath: [
109 "android.net.ipsec.ike",
110 "art.module.public.api",
111 "conscrypt.module.public.api",
Neha Pattanfa46dd22022-02-18 19:46:09 +0000112 "framework-adservices",
Anton Hansson648e6092022-01-11 16:37:05 +0000113 "framework-appsearch",
Roopa Sattiraju8e305772022-01-20 10:05:19 -0800114 "framework-bluetooth",
Anton Hansson648e6092022-01-11 16:37:05 +0000115 "framework-connectivity",
paulhue074dd22022-02-08 21:23:06 +0800116 "framework-connectivity-t",
Anton Hansson648e6092022-01-11 16:37:05 +0000117 "framework-graphics",
118 "framework-media",
119 "framework-mediaprovider",
Frank Wange97ff9e2022-02-13 07:06:31 +0000120 "framework-ondevicepersonalization",
Anton Hansson648e6092022-01-11 16:37:05 +0000121 "framework-permission",
122 "framework-permission-s",
123 "framework-scheduling",
124 "framework-sdkextensions",
125 "framework-statsd",
Nikita Ioffe59029ad2022-02-24 01:56:44 +0000126 "framework-sdksandbox",
Anton Hansson648e6092022-01-11 16:37:05 +0000127 "framework-tethering",
128 "framework-uwb",
129 "framework-wifi",
130 "i18n.module.public.api",
Anton Hansson85359f62020-09-21 17:02:25 +0100131 ],
Anton Hansson648e6092022-01-11 16:37:05 +0000132 system_server_classpath: [
133 "service-media-s",
134 "service-permission",
Nikita Ioffe59029ad2022-02-24 01:56:44 +0000135 "service-sdksandbox",
Anton Hanssona9ced802020-10-20 19:26:18 +0100136 ],
Anton Hansson85359f62020-09-21 17:02:25 +0100137}
138
139genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000140 name: "frameworks-base-api-current-compat",
141 srcs: [
142 ":android.api.public.latest",
143 ":android-incompatibilities.api.public.latest",
144 ":frameworks-base-api-current.txt",
145 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100146 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000147 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000148 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000149 "--check-compatibility:api:released $(location :android.api.public.latest) " +
150 "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100151 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
152 "$(location :frameworks-base-api-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000153}
154
155genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000156 name: "frameworks-base-api-system-current-compat",
157 srcs: [
158 ":android.api.system.latest",
159 ":android-incompatibilities.api.system.latest",
160 ":frameworks-base-api-current.txt",
161 ":frameworks-base-api-system-current.txt",
162 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100163 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000164 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000165 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000166 "--check-compatibility:api:released $(location :android.api.system.latest) " +
167 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
168 "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100169 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
170 "$(location :frameworks-base-api-system-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000171}
172
173genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000174 name: "frameworks-base-api-module-lib-current-compat",
175 srcs: [
176 ":android.api.module-lib.latest",
177 ":android-incompatibilities.api.module-lib.latest",
178 ":frameworks-base-api-current.txt",
179 ":frameworks-base-api-module-lib-current.txt",
180 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100181 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000182 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000183 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000184 "--check-compatibility:api:released $(location :android.api.module-lib.latest) " +
185 // Note: having "public" be the base of module-lib is not perfect -- it should
Anton Hansson9d34e312022-02-23 11:24:00 +0000186 // ideally be a merged public+system (which metalava is not currently able to generate).
187 // This "base" will help when migrating from MODULE_LIBS -> public, but not when
188 // migrating from MODULE_LIBS -> system (where it needs to instead be listed as
189 // an incompatibility).
Anton Hansson0d6eae62021-02-12 16:47:18 +0000190 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
191 "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100192 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
193 "$(location :frameworks-base-api-module-lib-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000194}
195
196genrule {
Anton Hanssona15427a2020-10-02 18:21:14 +0100197 name: "combined-removed-dex",
Paul Duffin81af1f52021-04-08 19:22:50 +0100198 visibility: [
199 "//frameworks/base/boot",
200 ],
Anton Hanssona15427a2020-10-02 18:21:14 +0100201 srcs: [
Anton Hansson1c4fab42020-11-02 11:57:33 +0000202 ":frameworks-base-api-removed.txt",
203 ":frameworks-base-api-system-removed.txt",
Anton Hanssona15427a2020-10-02 18:21:14 +0100204 ":android.car-stubs-docs{.removed-api.txt}",
205 ":android.car-system-stubs-docs{.removed-api.txt}",
206 ],
207 tool_files: ["gen_combined_removed_dex.sh"],
208 tools: ["metalava"],
209 out: ["combined-removed-dex.txt"],
210 cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)",
211}