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