blob: 40472b7e2d690446044fcfc35f363e079ad536d3 [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",
112 "framework-appsearch",
Roopa Sattiraju8e305772022-01-20 10:05:19 -0800113 "framework-bluetooth",
Anton Hansson648e6092022-01-11 16:37:05 +0000114 "framework-connectivity",
paulhue074dd22022-02-08 21:23:06 +0800115 "framework-connectivity-t",
Anton Hansson648e6092022-01-11 16:37:05 +0000116 "framework-graphics",
117 "framework-media",
118 "framework-mediaprovider",
Frank Wange97ff9e2022-02-13 07:06:31 +0000119 "framework-ondevicepersonalization",
Anton Hansson648e6092022-01-11 16:37:05 +0000120 "framework-permission",
121 "framework-permission-s",
122 "framework-scheduling",
123 "framework-sdkextensions",
124 "framework-statsd",
125 "framework-supplementalprocess",
126 "framework-tethering",
127 "framework-uwb",
128 "framework-wifi",
129 "i18n.module.public.api",
Anton Hansson85359f62020-09-21 17:02:25 +0100130 ],
Anton Hanssona8e34882022-01-12 17:28:39 +0000131 conditional_bootclasspath: [
Frank Wang07861f72022-01-25 18:41:45 +0000132 "framework-auxiliary",
Anton Hanssona8e34882022-01-12 17:28:39 +0000133 "framework-supplementalapi",
134 ],
Anton Hansson648e6092022-01-11 16:37:05 +0000135 system_server_classpath: [
136 "service-media-s",
137 "service-permission",
Nikita Ioffee48d2012022-01-17 20:38:40 +0000138 "service-supplementalprocess",
Anton Hanssona9ced802020-10-20 19:26:18 +0100139 ],
Anton Hansson85359f62020-09-21 17:02:25 +0100140}
141
142genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000143 name: "frameworks-base-api-current-compat",
144 srcs: [
145 ":android.api.public.latest",
146 ":android-incompatibilities.api.public.latest",
147 ":frameworks-base-api-current.txt",
148 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100149 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000150 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000151 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000152 "--check-compatibility:api:released $(location :android.api.public.latest) " +
153 "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100154 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
155 "$(location :frameworks-base-api-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000156}
157
158genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000159 name: "frameworks-base-api-system-current-compat",
160 srcs: [
161 ":android.api.system.latest",
162 ":android-incompatibilities.api.system.latest",
163 ":frameworks-base-api-current.txt",
164 ":frameworks-base-api-system-current.txt",
165 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100166 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000167 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000168 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000169 "--check-compatibility:api:released $(location :android.api.system.latest) " +
170 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
171 "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100172 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
173 "$(location :frameworks-base-api-system-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000174}
175
176genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000177 name: "frameworks-base-api-module-lib-current-compat",
178 srcs: [
179 ":android.api.module-lib.latest",
180 ":android-incompatibilities.api.module-lib.latest",
181 ":frameworks-base-api-current.txt",
182 ":frameworks-base-api-module-lib-current.txt",
183 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100184 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000185 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000186 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000187 "--check-compatibility:api:released $(location :android.api.module-lib.latest) " +
188 // Note: having "public" be the base of module-lib is not perfect -- it should
189 // ideally be a merged public+system), but this will help when migrating from
190 // MODULE_LIBS -> public.
191 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
192 "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100193 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
194 "$(location :frameworks-base-api-module-lib-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000195}
196
197genrule {
Anton Hanssona15427a2020-10-02 18:21:14 +0100198 name: "combined-removed-dex",
Paul Duffin81af1f52021-04-08 19:22:50 +0100199 visibility: [
200 "//frameworks/base/boot",
201 ],
Anton Hanssona15427a2020-10-02 18:21:14 +0100202 srcs: [
Anton Hansson1c4fab42020-11-02 11:57:33 +0000203 ":frameworks-base-api-removed.txt",
204 ":frameworks-base-api-system-removed.txt",
Anton Hanssona15427a2020-10-02 18:21:14 +0100205 ":android.car-stubs-docs{.removed-api.txt}",
206 ":android.car-system-stubs-docs{.removed-api.txt}",
207 ],
208 tool_files: ["gen_combined_removed_dex.sh"],
209 tools: ["metalava"],
210 out: ["combined-removed-dex.txt"],
211 cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)",
212}