blob: 779fa85b813951bf8c4429d03c62434a9c656c5d [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",
126 "framework-supplementalprocess",
127 "framework-tethering",
128 "framework-uwb",
129 "framework-wifi",
130 "i18n.module.public.api",
Anton Hansson85359f62020-09-21 17:02:25 +0100131 ],
Anton Hanssona8e34882022-01-12 17:28:39 +0000132 conditional_bootclasspath: [
Frank Wang07861f72022-01-25 18:41:45 +0000133 "framework-auxiliary",
Anton Hanssona8e34882022-01-12 17:28:39 +0000134 "framework-supplementalapi",
135 ],
Anton Hansson648e6092022-01-11 16:37:05 +0000136 system_server_classpath: [
137 "service-media-s",
138 "service-permission",
Nikita Ioffee48d2012022-01-17 20:38:40 +0000139 "service-supplementalprocess",
Anton Hanssona9ced802020-10-20 19:26:18 +0100140 ],
Anton Hansson85359f62020-09-21 17:02:25 +0100141}
142
143genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000144 name: "frameworks-base-api-current-compat",
145 srcs: [
146 ":android.api.public.latest",
147 ":android-incompatibilities.api.public.latest",
148 ":frameworks-base-api-current.txt",
149 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100150 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000151 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000152 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000153 "--check-compatibility:api:released $(location :android.api.public.latest) " +
154 "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100155 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
156 "$(location :frameworks-base-api-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000157}
158
159genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000160 name: "frameworks-base-api-system-current-compat",
161 srcs: [
162 ":android.api.system.latest",
163 ":android-incompatibilities.api.system.latest",
164 ":frameworks-base-api-current.txt",
165 ":frameworks-base-api-system-current.txt",
166 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100167 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000168 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000169 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000170 "--check-compatibility:api:released $(location :android.api.system.latest) " +
171 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
172 "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100173 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
174 "$(location :frameworks-base-api-system-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000175}
176
177genrule {
Anton Hansson0d6eae62021-02-12 16:47:18 +0000178 name: "frameworks-base-api-module-lib-current-compat",
179 srcs: [
180 ":android.api.module-lib.latest",
181 ":android-incompatibilities.api.module-lib.latest",
182 ":frameworks-base-api-current.txt",
183 ":frameworks-base-api-module-lib-current.txt",
184 ],
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100185 out: ["updated-baseline.txt"],
Anton Hansson0d6eae62021-02-12 16:47:18 +0000186 tools: ["metalava"],
Anton Hanssonaa26cc12021-02-15 10:52:33 +0000187 cmd: metalava_cmd +
Anton Hansson0d6eae62021-02-12 16:47:18 +0000188 "--check-compatibility:api:released $(location :android.api.module-lib.latest) " +
189 // Note: having "public" be the base of module-lib is not perfect -- it should
190 // ideally be a merged public+system), but this will help when migrating from
191 // MODULE_LIBS -> public.
192 "--check-compatibility:base $(location :frameworks-base-api-current.txt) " +
193 "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " +
Anton Hanssonb8ce0812021-08-24 12:08:39 +0100194 "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " +
195 "$(location :frameworks-base-api-module-lib-current.txt)",
Anton Hansson0d6eae62021-02-12 16:47:18 +0000196}
197
198genrule {
Anton Hanssona15427a2020-10-02 18:21:14 +0100199 name: "combined-removed-dex",
Paul Duffin81af1f52021-04-08 19:22:50 +0100200 visibility: [
201 "//frameworks/base/boot",
202 ],
Anton Hanssona15427a2020-10-02 18:21:14 +0100203 srcs: [
Anton Hansson1c4fab42020-11-02 11:57:33 +0000204 ":frameworks-base-api-removed.txt",
205 ":frameworks-base-api-system-removed.txt",
Anton Hanssona15427a2020-10-02 18:21:14 +0100206 ":android.car-stubs-docs{.removed-api.txt}",
207 ":android.car-system-stubs-docs{.removed-api.txt}",
208 ],
209 tool_files: ["gen_combined_removed_dex.sh"],
210 tools: ["metalava"],
211 out: ["combined-removed-dex.txt"],
212 cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)",
213}