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