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