Anton Hansson | fcb91d4 | 2020-09-21 16:32:14 +0100 | [diff] [blame] | 1 | // 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 | |
| 15 | package { |
| 16 | default_visibility: ["//visibility:private"], |
Bob Badour | 8a6a2bc | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 17 | // 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 Hansson | fcb91d4 | 2020-09-21 16:32:14 +0100 | [diff] [blame] | 25 | } |
| 26 | |
Anton Hansson | 0860aaf | 2021-10-08 16:48:03 +0100 | [diff] [blame^] | 27 | bootstrap_go_package { |
| 28 | name: "soong-api", |
| 29 | pkgPath: "android/soong/api", |
| 30 | deps: [ |
| 31 | "blueprint", |
| 32 | "soong", |
| 33 | "soong-android", |
| 34 | "soong-genrule", |
| 35 | ], |
| 36 | srcs: ["api.go"], |
| 37 | pluginFor: ["soong_build"], |
| 38 | } |
| 39 | |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 40 | python_defaults { |
| 41 | name: "python3_version_defaults", |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 42 | version: { |
| 43 | py2: { |
| 44 | enabled: false, |
| 45 | }, |
| 46 | py3: { |
| 47 | enabled: true, |
| 48 | embedded_launcher: false, |
| 49 | }, |
| 50 | }, |
| 51 | } |
| 52 | |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 53 | python_binary_host { |
| 54 | name: "api_versions_trimmer", |
| 55 | srcs: ["api_versions_trimmer.py"], |
| 56 | defaults: ["python3_version_defaults"], |
| 57 | } |
| 58 | |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 59 | python_test_host { |
| 60 | name: "api_versions_trimmer_unittests", |
| 61 | main: "api_versions_trimmer_unittests.py", |
| 62 | srcs: [ |
| 63 | "api_versions_trimmer_unittests.py", |
| 64 | "api_versions_trimmer.py", |
| 65 | ], |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 66 | defaults: ["python3_version_defaults"], |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 67 | test_options: { |
| 68 | unit_test: true, |
| 69 | }, |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 70 | } |
| 71 | |
| 72 | python_binary_host { |
| 73 | name: "merge_annotation_zips", |
| 74 | srcs: ["merge_annotation_zips.py"], |
| 75 | defaults: ["python3_version_defaults"], |
| 76 | } |
| 77 | |
| 78 | python_test_host { |
| 79 | name: "merge_annotation_zips_test", |
| 80 | main: "merge_annotation_zips_test.py", |
| 81 | srcs: [ |
| 82 | "merge_annotation_zips.py", |
| 83 | "merge_annotation_zips_test.py", |
| 84 | ], |
| 85 | defaults: ["python3_version_defaults"], |
| 86 | test_options: { |
| 87 | unit_test: true, |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 88 | }, |
| 89 | } |
| 90 | |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 91 | metalava_cmd = "$(location metalava)" |
| 92 | // Silence reflection warnings. See b/168689341 |
| 93 | metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED " |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 94 | metalava_cmd += " --quiet --no-banner --format=v2 " |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 95 | |
Sasha Smundak | 02cbff44 | 2019-08-15 08:27:51 -0700 | [diff] [blame] | 96 | genrule { |
| 97 | name: "current-api-xml", |
| 98 | tools: ["metalava"], |
Anton Hansson | 00febe2 | 2020-11-05 10:30:59 +0000 | [diff] [blame] | 99 | srcs: [":frameworks-base-api-current.txt"], |
Sasha Smundak | 02cbff44 | 2019-08-15 08:27:51 -0700 | [diff] [blame] | 100 | out: ["current.api"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 101 | cmd: metalava_cmd + "-convert2xmlnostrip $(in) $(out)", |
Anton Hansson | fcb91d4 | 2020-09-21 16:32:14 +0100 | [diff] [blame] | 102 | visibility: ["//visibility:public"], |
Sasha Smundak | 02cbff44 | 2019-08-15 08:27:51 -0700 | [diff] [blame] | 103 | } |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 104 | |
| 105 | genrule { |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 106 | name: "frameworks-base-api-current.txt", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 107 | srcs: [ |
Yan Yan | 1357a42 | 2021-02-03 16:07:30 -0800 | [diff] [blame] | 108 | ":android.net.ipsec.ike{.public.api.txt}", |
Anton Hansson | fc948d86 | 2020-12-17 16:57:35 +0000 | [diff] [blame] | 109 | ":art.module.public.api{.public.api.txt}", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 110 | ":conscrypt.module.public.api{.public.api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 111 | ":framework-appsearch{.public.api.txt}", |
Remi NGUYEN VAN | 9f223cb | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 112 | ":framework-connectivity{.public.api.txt}", |
Anton Hansson | 0eccccb | 2020-09-24 12:09:25 +0100 | [diff] [blame] | 113 | ":framework-graphics{.public.api.txt}", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 114 | ":framework-media{.public.api.txt}", |
| 115 | ":framework-mediaprovider{.public.api.txt}", |
| 116 | ":framework-permission{.public.api.txt}", |
Hai Zhang | 591e121 | 2021-01-21 12:48:43 -0800 | [diff] [blame] | 117 | ":framework-permission-s{.public.api.txt}", |
Gavin Corkery | 338545d | 2021-02-15 20:22:58 +0000 | [diff] [blame] | 118 | ":framework-scheduling{.public.api.txt}", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 119 | ":framework-sdkextensions{.public.api.txt}", |
| 120 | ":framework-statsd{.public.api.txt}", |
| 121 | ":framework-tethering{.public.api.txt}", |
| 122 | ":framework-wifi{.public.api.txt}", |
Paul Duffin | 5a4e8f2 | 2020-11-25 15:45:43 +0000 | [diff] [blame] | 123 | ":i18n.module.public.api{.public.api.txt}", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 124 | ":non-updatable-current.txt", |
| 125 | ], |
| 126 | out: ["current.txt"], |
| 127 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 128 | cmd: metalava_cmd + "$(in) --api $(out)", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 129 | dists: [ |
| 130 | { |
| 131 | targets: ["droidcore"], |
| 132 | dir: "api", |
| 133 | dest: "current.txt", |
| 134 | }, |
| 135 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 136 | targets: ["sdk"], |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 137 | dir: "apistubs/android/public/api", |
| 138 | dest: "android.txt", |
| 139 | }, |
| 140 | ], |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 141 | visibility: ["//visibility:public"], |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 145 | name: "frameworks-base-api-current-compat", |
| 146 | srcs: [ |
| 147 | ":android.api.public.latest", |
| 148 | ":android-incompatibilities.api.public.latest", |
| 149 | ":frameworks-base-api-current.txt", |
| 150 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 151 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 152 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 153 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 154 | "--check-compatibility:api:released $(location :android.api.public.latest) " + |
| 155 | "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 156 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 157 | "$(location :frameworks-base-api-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | genrule { |
Anton Hansson | 89c74dc | 2020-11-05 20:21:08 +0000 | [diff] [blame] | 161 | name: "frameworks-base-api-current.srcjar", |
| 162 | srcs: [ |
Yan Yan | 1357a42 | 2021-02-03 16:07:30 -0800 | [diff] [blame] | 163 | ":android.net.ipsec.ike{.public.stubs.source}", |
Anton Hansson | 89c74dc | 2020-11-05 20:21:08 +0000 | [diff] [blame] | 164 | ":api-stubs-docs-non-updatable", |
Anton Hansson | fc948d86 | 2020-12-17 16:57:35 +0000 | [diff] [blame] | 165 | ":art.module.public.api{.public.stubs.source}", |
Anton Hansson | 89c74dc | 2020-11-05 20:21:08 +0000 | [diff] [blame] | 166 | ":conscrypt.module.public.api{.public.stubs.source}", |
| 167 | ":framework-appsearch{.public.stubs.source}", |
Remi NGUYEN VAN | 9f223cb | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 168 | ":framework-connectivity{.public.stubs.source}", |
Anton Hansson | 89c74dc | 2020-11-05 20:21:08 +0000 | [diff] [blame] | 169 | ":framework-graphics{.public.stubs.source}", |
| 170 | ":framework-media{.public.stubs.source}", |
| 171 | ":framework-mediaprovider{.public.stubs.source}", |
| 172 | ":framework-permission{.public.stubs.source}", |
Hai Zhang | 591e121 | 2021-01-21 12:48:43 -0800 | [diff] [blame] | 173 | ":framework-permission-s{.public.stubs.source}", |
Gavin Corkery | 338545d | 2021-02-15 20:22:58 +0000 | [diff] [blame] | 174 | ":framework-scheduling{.public.stubs.source}", |
Anton Hansson | 89c74dc | 2020-11-05 20:21:08 +0000 | [diff] [blame] | 175 | ":framework-sdkextensions{.public.stubs.source}", |
| 176 | ":framework-statsd{.public.stubs.source}", |
| 177 | ":framework-tethering{.public.stubs.source}", |
| 178 | ":framework-wifi{.public.stubs.source}", |
Paul Duffin | 5a4e8f2 | 2020-11-25 15:45:43 +0000 | [diff] [blame] | 179 | ":i18n.module.public.api{.public.stubs.source}", |
Anton Hansson | 89c74dc | 2020-11-05 20:21:08 +0000 | [diff] [blame] | 180 | ], |
| 181 | out: ["current.srcjar"], |
| 182 | tools: ["merge_zips"], |
| 183 | cmd: "$(location merge_zips) $(out) $(in)", |
| 184 | visibility: ["//visibility:private"], // Used by make module in //development, mind. |
| 185 | } |
| 186 | |
| 187 | genrule { |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 188 | name: "frameworks-base-api-removed.txt", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 189 | srcs: [ |
Yan Yan | 1357a42 | 2021-02-03 16:07:30 -0800 | [diff] [blame] | 190 | ":android.net.ipsec.ike{.public.removed-api.txt}", |
Anton Hansson | fc948d86 | 2020-12-17 16:57:35 +0000 | [diff] [blame] | 191 | ":art.module.public.api{.public.removed-api.txt}", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 192 | ":conscrypt.module.public.api{.public.removed-api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 193 | ":framework-appsearch{.public.removed-api.txt}", |
Remi NGUYEN VAN | 9f223cb | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 194 | ":framework-connectivity{.public.removed-api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 195 | ":framework-graphics{.public.removed-api.txt}", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 196 | ":framework-media{.public.removed-api.txt}", |
| 197 | ":framework-mediaprovider{.public.removed-api.txt}", |
| 198 | ":framework-permission{.public.removed-api.txt}", |
Hai Zhang | 591e121 | 2021-01-21 12:48:43 -0800 | [diff] [blame] | 199 | ":framework-permission-s{.public.removed-api.txt}", |
Gavin Corkery | 338545d | 2021-02-15 20:22:58 +0000 | [diff] [blame] | 200 | ":framework-scheduling{.public.removed-api.txt}", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 201 | ":framework-sdkextensions{.public.removed-api.txt}", |
| 202 | ":framework-statsd{.public.removed-api.txt}", |
| 203 | ":framework-tethering{.public.removed-api.txt}", |
| 204 | ":framework-wifi{.public.removed-api.txt}", |
Paul Duffin | 5a4e8f2 | 2020-11-25 15:45:43 +0000 | [diff] [blame] | 205 | ":i18n.module.public.api{.public.removed-api.txt}", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 206 | ":non-updatable-removed.txt", |
| 207 | ], |
| 208 | out: ["removed.txt"], |
| 209 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 210 | cmd: metalava_cmd + "$(in) --api $(out)", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 211 | dists: [ |
| 212 | { |
| 213 | targets: ["droidcore"], |
| 214 | dir: "api", |
| 215 | dest: "removed.txt", |
| 216 | }, |
Anton Hansson | 85785fe | 2021-01-20 20:23:34 +0000 | [diff] [blame] | 217 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 218 | targets: ["sdk"], |
Anton Hansson | 85785fe | 2021-01-20 20:23:34 +0000 | [diff] [blame] | 219 | dir: "apistubs/android/public/api", |
| 220 | dest: "removed.txt", |
| 221 | }, |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 222 | ], |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | genrule { |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 226 | name: "frameworks-base-api-system-current.txt", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 227 | srcs: [ |
Victor Chang | 9f5cdff | 2021-05-12 10:47:16 +0100 | [diff] [blame] | 228 | ":art.module.public.api{.system.api.txt}", |
Yan Yan | 1357a42 | 2021-02-03 16:07:30 -0800 | [diff] [blame] | 229 | ":android.net.ipsec.ike{.system.api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 230 | ":framework-appsearch{.system.api.txt}", |
Remi NGUYEN VAN | 9f223cb | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 231 | ":framework-connectivity{.system.api.txt}", |
Anton Hansson | 0eccccb | 2020-09-24 12:09:25 +0100 | [diff] [blame] | 232 | ":framework-graphics{.system.api.txt}", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 233 | ":framework-media{.system.api.txt}", |
| 234 | ":framework-mediaprovider{.system.api.txt}", |
| 235 | ":framework-permission{.system.api.txt}", |
Hai Zhang | 591e121 | 2021-01-21 12:48:43 -0800 | [diff] [blame] | 236 | ":framework-permission-s{.system.api.txt}", |
Gavin Corkery | 338545d | 2021-02-15 20:22:58 +0000 | [diff] [blame] | 237 | ":framework-scheduling{.system.api.txt}", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 238 | ":framework-sdkextensions{.system.api.txt}", |
| 239 | ":framework-statsd{.system.api.txt}", |
| 240 | ":framework-tethering{.system.api.txt}", |
| 241 | ":framework-wifi{.system.api.txt}", |
| 242 | ":non-updatable-system-current.txt", |
| 243 | ], |
| 244 | out: ["system-current.txt"], |
| 245 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 246 | cmd: metalava_cmd + "$(in) --api $(out)", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 247 | dists: [ |
| 248 | { |
| 249 | targets: ["droidcore"], |
| 250 | dir: "api", |
| 251 | dest: "system-current.txt", |
| 252 | }, |
| 253 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 254 | targets: ["sdk"], |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 255 | dir: "apistubs/android/system/api", |
| 256 | dest: "android.txt", |
| 257 | }, |
| 258 | ], |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 259 | visibility: ["//visibility:public"], |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 260 | } |
| 261 | |
| 262 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 263 | name: "frameworks-base-api-system-current-compat", |
| 264 | srcs: [ |
| 265 | ":android.api.system.latest", |
| 266 | ":android-incompatibilities.api.system.latest", |
| 267 | ":frameworks-base-api-current.txt", |
| 268 | ":frameworks-base-api-system-current.txt", |
| 269 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 270 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 271 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 272 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 273 | "--check-compatibility:api:released $(location :android.api.system.latest) " + |
| 274 | "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + |
| 275 | "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 276 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 277 | "$(location :frameworks-base-api-system-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | genrule { |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 281 | name: "frameworks-base-api-system-removed.txt", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 282 | srcs: [ |
Victor Chang | 9f5cdff | 2021-05-12 10:47:16 +0100 | [diff] [blame] | 283 | ":art.module.public.api{.system.removed-api.txt}", |
Yan Yan | 1357a42 | 2021-02-03 16:07:30 -0800 | [diff] [blame] | 284 | ":android.net.ipsec.ike{.system.removed-api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 285 | ":framework-appsearch{.system.removed-api.txt}", |
Remi NGUYEN VAN | 9f223cb | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 286 | ":framework-connectivity{.system.removed-api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 287 | ":framework-graphics{.system.removed-api.txt}", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 288 | ":framework-media{.system.removed-api.txt}", |
| 289 | ":framework-mediaprovider{.system.removed-api.txt}", |
| 290 | ":framework-permission{.system.removed-api.txt}", |
Hai Zhang | 591e121 | 2021-01-21 12:48:43 -0800 | [diff] [blame] | 291 | ":framework-permission-s{.system.removed-api.txt}", |
Gavin Corkery | 338545d | 2021-02-15 20:22:58 +0000 | [diff] [blame] | 292 | ":framework-scheduling{.system.removed-api.txt}", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 293 | ":framework-sdkextensions{.system.removed-api.txt}", |
| 294 | ":framework-statsd{.system.removed-api.txt}", |
| 295 | ":framework-tethering{.system.removed-api.txt}", |
| 296 | ":framework-wifi{.system.removed-api.txt}", |
| 297 | ":non-updatable-system-removed.txt", |
| 298 | ], |
| 299 | out: ["system-removed.txt"], |
| 300 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 301 | cmd: metalava_cmd + "$(in) --api $(out)", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 302 | dists: [ |
| 303 | { |
| 304 | targets: ["droidcore"], |
| 305 | dir: "api", |
| 306 | dest: "system-removed.txt", |
| 307 | }, |
Anton Hansson | 85785fe | 2021-01-20 20:23:34 +0000 | [diff] [blame] | 308 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 309 | targets: ["sdk"], |
Anton Hansson | 85785fe | 2021-01-20 20:23:34 +0000 | [diff] [blame] | 310 | dir: "apistubs/android/system/api", |
| 311 | dest: "removed.txt", |
| 312 | }, |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 313 | ], |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 314 | visibility: ["//visibility:public"], |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | genrule { |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 318 | name: "frameworks-base-api-module-lib-current.txt", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 319 | srcs: [ |
Victor Chang | 9f5cdff | 2021-05-12 10:47:16 +0100 | [diff] [blame] | 320 | ":art.module.public.api{.module-lib.api.txt}", |
Yan Yan | 1357a42 | 2021-02-03 16:07:30 -0800 | [diff] [blame] | 321 | ":android.net.ipsec.ike{.module-lib.api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 322 | ":framework-appsearch{.module-lib.api.txt}", |
Remi NGUYEN VAN | 9f223cb | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 323 | ":framework-connectivity{.module-lib.api.txt}", |
Anton Hansson | 0eccccb | 2020-09-24 12:09:25 +0100 | [diff] [blame] | 324 | ":framework-graphics{.module-lib.api.txt}", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 325 | ":framework-media{.module-lib.api.txt}", |
| 326 | ":framework-mediaprovider{.module-lib.api.txt}", |
| 327 | ":framework-permission{.module-lib.api.txt}", |
Hai Zhang | 591e121 | 2021-01-21 12:48:43 -0800 | [diff] [blame] | 328 | ":framework-permission-s{.module-lib.api.txt}", |
Gavin Corkery | 338545d | 2021-02-15 20:22:58 +0000 | [diff] [blame] | 329 | ":framework-scheduling{.module-lib.api.txt}", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 330 | ":framework-sdkextensions{.module-lib.api.txt}", |
| 331 | ":framework-statsd{.module-lib.api.txt}", |
| 332 | ":framework-tethering{.module-lib.api.txt}", |
| 333 | ":framework-wifi{.module-lib.api.txt}", |
| 334 | ":non-updatable-module-lib-current.txt", |
| 335 | ], |
| 336 | out: ["module-lib-current.txt"], |
| 337 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 338 | cmd: metalava_cmd + "$(in) --api $(out)", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 339 | dists: [ |
| 340 | { |
| 341 | targets: ["droidcore"], |
| 342 | dir: "api", |
| 343 | dest: "module-lib-current.txt", |
| 344 | }, |
| 345 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 346 | targets: ["sdk"], |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 347 | dir: "apistubs/android/module-lib/api", |
| 348 | dest: "android.txt", |
| 349 | }, |
| 350 | ], |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 351 | } |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 352 | |
| 353 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 354 | name: "frameworks-base-api-module-lib-current-compat", |
| 355 | srcs: [ |
| 356 | ":android.api.module-lib.latest", |
| 357 | ":android-incompatibilities.api.module-lib.latest", |
| 358 | ":frameworks-base-api-current.txt", |
| 359 | ":frameworks-base-api-module-lib-current.txt", |
| 360 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 361 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 362 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 363 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 364 | "--check-compatibility:api:released $(location :android.api.module-lib.latest) " + |
| 365 | // Note: having "public" be the base of module-lib is not perfect -- it should |
| 366 | // ideally be a merged public+system), but this will help when migrating from |
| 367 | // MODULE_LIBS -> public. |
| 368 | "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + |
| 369 | "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 370 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 371 | "$(location :frameworks-base-api-module-lib-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 372 | } |
| 373 | |
| 374 | genrule { |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 375 | name: "frameworks-base-api-module-lib-removed.txt", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 376 | srcs: [ |
Victor Chang | 9f5cdff | 2021-05-12 10:47:16 +0100 | [diff] [blame] | 377 | ":art.module.public.api{.module-lib.removed-api.txt}", |
Yan Yan | 1357a42 | 2021-02-03 16:07:30 -0800 | [diff] [blame] | 378 | ":android.net.ipsec.ike{.module-lib.removed-api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 379 | ":framework-appsearch{.module-lib.removed-api.txt}", |
Remi NGUYEN VAN | 9f223cb | 2021-01-28 13:37:03 +0900 | [diff] [blame] | 380 | ":framework-connectivity{.module-lib.removed-api.txt}", |
Anton Hansson | d74139e | 2020-10-08 14:59:17 +0100 | [diff] [blame] | 381 | ":framework-graphics{.module-lib.removed-api.txt}", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 382 | ":framework-media{.module-lib.removed-api.txt}", |
| 383 | ":framework-mediaprovider{.module-lib.removed-api.txt}", |
| 384 | ":framework-permission{.module-lib.removed-api.txt}", |
Hai Zhang | 591e121 | 2021-01-21 12:48:43 -0800 | [diff] [blame] | 385 | ":framework-permission-s{.module-lib.removed-api.txt}", |
Gavin Corkery | 338545d | 2021-02-15 20:22:58 +0000 | [diff] [blame] | 386 | ":framework-scheduling{.module-lib.removed-api.txt}", |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 387 | ":framework-sdkextensions{.module-lib.removed-api.txt}", |
| 388 | ":framework-statsd{.module-lib.removed-api.txt}", |
| 389 | ":framework-tethering{.module-lib.removed-api.txt}", |
| 390 | ":framework-wifi{.module-lib.removed-api.txt}", |
| 391 | ":non-updatable-module-lib-removed.txt", |
| 392 | ], |
| 393 | out: ["module-lib-removed.txt"], |
| 394 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 395 | cmd: metalava_cmd + "$(in) --api $(out)", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 396 | dists: [ |
| 397 | { |
| 398 | targets: ["droidcore"], |
| 399 | dir: "api", |
| 400 | dest: "module-lib-removed.txt", |
| 401 | }, |
Anton Hansson | 85785fe | 2021-01-20 20:23:34 +0000 | [diff] [blame] | 402 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 403 | targets: ["sdk"], |
Anton Hansson | 85785fe | 2021-01-20 20:23:34 +0000 | [diff] [blame] | 404 | dir: "apistubs/android/module-lib/api", |
| 405 | dest: "removed.txt", |
| 406 | }, |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 407 | ], |
Anton Hansson | 3c1aa11 | 2020-09-25 09:13:47 +0100 | [diff] [blame] | 408 | } |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 409 | |
| 410 | genrule { |
| 411 | name: "combined-removed-dex", |
Paul Duffin | 81af1f5 | 2021-04-08 19:22:50 +0100 | [diff] [blame] | 412 | visibility: [ |
| 413 | "//frameworks/base/boot", |
| 414 | ], |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 415 | srcs: [ |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 416 | ":frameworks-base-api-removed.txt", |
| 417 | ":frameworks-base-api-system-removed.txt", |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 418 | ":android.car-stubs-docs{.removed-api.txt}", |
| 419 | ":android.car-system-stubs-docs{.removed-api.txt}", |
| 420 | ], |
| 421 | tool_files: ["gen_combined_removed_dex.sh"], |
| 422 | tools: ["metalava"], |
| 423 | out: ["combined-removed-dex.txt"], |
| 424 | cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)", |
| 425 | } |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 426 | |
| 427 | genrule { |
Anton Hansson | abce6f0 | 2021-10-08 16:14:25 +0100 | [diff] [blame] | 428 | name: "frameworks-base-api-system-server-current.txt", |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 429 | srcs: [ |
Andrei Onea | 7e609d4 | 2021-03-12 17:02:49 +0000 | [diff] [blame] | 430 | ":service-media-s{.system-server.api.txt}", |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 431 | ":service-permission{.system-server.api.txt}", |
| 432 | ":non-updatable-system-server-current.txt", |
| 433 | ], |
| 434 | out: ["system-server-current.txt"], |
| 435 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 436 | cmd: metalava_cmd + "$(in) --api $(out)", |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 437 | dists: [ |
| 438 | { |
| 439 | targets: ["droidcore"], |
| 440 | dir: "api", |
| 441 | dest: "system-server-current.txt", |
| 442 | }, |
| 443 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 444 | targets: ["sdk"], |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 445 | dir: "apistubs/android/system-server/api", |
Andrei Onea | faa271a | 2021-03-17 13:32:51 +0000 | [diff] [blame] | 446 | dest: "android.txt", |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 447 | }, |
| 448 | ], |
| 449 | } |
| 450 | |
| 451 | genrule { |
Anton Hansson | abce6f0 | 2021-10-08 16:14:25 +0100 | [diff] [blame] | 452 | name: "frameworks-base-api-system-server-removed.txt", |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 453 | srcs: [ |
Andrei Onea | 7e609d4 | 2021-03-12 17:02:49 +0000 | [diff] [blame] | 454 | ":service-media-s{.system-server.removed-api.txt}", |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 455 | ":service-permission{.system-server.removed-api.txt}", |
| 456 | ":non-updatable-system-server-removed.txt", |
| 457 | ], |
| 458 | out: ["system-server-removed.txt"], |
| 459 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 460 | cmd: metalava_cmd + "$(in) --api $(out)", |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 461 | dists: [ |
| 462 | { |
| 463 | targets: ["droidcore"], |
| 464 | dir: "api", |
| 465 | dest: "system-server-removed.txt", |
| 466 | }, |
| 467 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 468 | targets: ["sdk"], |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 469 | dir: "apistubs/android/system-server/api", |
Andrei Onea | faa271a | 2021-03-17 13:32:51 +0000 | [diff] [blame] | 470 | dest: "removed.txt", |
Andrei Onea | dcb5446 | 2021-02-19 16:28:30 +0000 | [diff] [blame] | 471 | }, |
| 472 | ], |
| 473 | } |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 474 | |
| 475 | // This rule will filter classes present in the jar files of mainline modules |
| 476 | // from the lint database in api-versions.xml. |
| 477 | // This is done to reduce the number of false positive NewApi findings in |
| 478 | // java libraries that compile against the module SDK |
| 479 | genrule { |
| 480 | name: "api-versions-xml-public-filtered", |
| 481 | srcs: [ |
| 482 | // Note: order matters: first parameter is the full api-versions.xml |
| 483 | // after that the stubs files in any order |
| 484 | // stubs files are all modules that export API surfaces EXCEPT ART |
| 485 | ":framework-doc-stubs{.api_versions.xml}", |
| 486 | ":android.net.ipsec.ike.stubs{.jar}", |
| 487 | ":conscrypt.module.public.api.stubs{.jar}", |
| 488 | ":framework-appsearch.stubs{.jar}", |
| 489 | ":framework-connectivity.stubs{.jar}", |
| 490 | ":framework-graphics.stubs{.jar}", |
| 491 | ":framework-media.stubs{.jar}", |
| 492 | ":framework-mediaprovider.stubs{.jar}", |
| 493 | ":framework-permission.stubs{.jar}", |
| 494 | ":framework-permission-s.stubs{.jar}", |
| 495 | ":framework-scheduling.stubs{.jar}", |
| 496 | ":framework-sdkextensions.stubs{.jar}", |
| 497 | ":framework-statsd.stubs{.jar}", |
| 498 | ":framework-tethering.stubs{.jar}", |
| 499 | ":framework-wifi.stubs{.jar}", |
| 500 | ":i18n.module.public.api.stubs{.jar}", |
| 501 | ], |
| 502 | out: ["api-versions-public-filtered.xml"], |
| 503 | tools: ["api_versions_trimmer"], |
| 504 | cmd: "$(location api_versions_trimmer) $(out) $(in)", |
| 505 | dist: { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 506 | targets: ["sdk"], |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 507 | }, |
| 508 | } |