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", |
Anton Hansson | 47ff71a | 2022-01-13 09:45:12 +0000 | [diff] [blame] | 35 | "soong-java", |
Anton Hansson | 0860aaf | 2021-10-08 16:48:03 +0100 | [diff] [blame] | 36 | ], |
| 37 | srcs: ["api.go"], |
| 38 | pluginFor: ["soong_build"], |
| 39 | } |
| 40 | |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 41 | python_defaults { |
| 42 | name: "python3_version_defaults", |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 43 | version: { |
| 44 | py2: { |
| 45 | enabled: false, |
| 46 | }, |
| 47 | py3: { |
| 48 | enabled: true, |
| 49 | embedded_launcher: false, |
| 50 | }, |
| 51 | }, |
| 52 | } |
| 53 | |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 54 | python_binary_host { |
| 55 | name: "api_versions_trimmer", |
| 56 | srcs: ["api_versions_trimmer.py"], |
| 57 | defaults: ["python3_version_defaults"], |
| 58 | } |
| 59 | |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 60 | python_test_host { |
| 61 | name: "api_versions_trimmer_unittests", |
| 62 | main: "api_versions_trimmer_unittests.py", |
| 63 | srcs: [ |
| 64 | "api_versions_trimmer_unittests.py", |
| 65 | "api_versions_trimmer.py", |
| 66 | ], |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 67 | defaults: ["python3_version_defaults"], |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 68 | test_options: { |
| 69 | unit_test: true, |
| 70 | }, |
Anton Hansson | e673784 | 2021-09-27 12:18:20 +0100 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | python_binary_host { |
| 74 | name: "merge_annotation_zips", |
| 75 | srcs: ["merge_annotation_zips.py"], |
| 76 | defaults: ["python3_version_defaults"], |
| 77 | } |
| 78 | |
| 79 | python_test_host { |
| 80 | name: "merge_annotation_zips_test", |
| 81 | main: "merge_annotation_zips_test.py", |
| 82 | srcs: [ |
| 83 | "merge_annotation_zips.py", |
| 84 | "merge_annotation_zips_test.py", |
| 85 | ], |
| 86 | defaults: ["python3_version_defaults"], |
| 87 | test_options: { |
| 88 | unit_test: true, |
Pedro Loureiro | b91f45d | 2021-05-26 15:50:07 +0000 | [diff] [blame] | 89 | }, |
| 90 | } |
| 91 | |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 92 | metalava_cmd = "$(location metalava)" |
| 93 | // Silence reflection warnings. See b/168689341 |
| 94 | metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED " |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 95 | metalava_cmd += " --quiet --no-banner --format=v2 " |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 96 | |
Sasha Smundak | 02cbff44 | 2019-08-15 08:27:51 -0700 | [diff] [blame] | 97 | genrule { |
| 98 | name: "current-api-xml", |
| 99 | tools: ["metalava"], |
Anton Hansson | 00febe2 | 2020-11-05 10:30:59 +0000 | [diff] [blame] | 100 | srcs: [":frameworks-base-api-current.txt"], |
Sasha Smundak | 02cbff44 | 2019-08-15 08:27:51 -0700 | [diff] [blame] | 101 | out: ["current.api"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 102 | cmd: metalava_cmd + "-convert2xmlnostrip $(in) $(out)", |
Anton Hansson | fcb91d4 | 2020-09-21 16:32:14 +0100 | [diff] [blame] | 103 | visibility: ["//visibility:public"], |
Sasha Smundak | 02cbff44 | 2019-08-15 08:27:51 -0700 | [diff] [blame] | 104 | } |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 105 | |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 106 | combined_apis { |
| 107 | name: "frameworks-base-api", |
| 108 | bootclasspath: [ |
| 109 | "android.net.ipsec.ike", |
| 110 | "art.module.public.api", |
| 111 | "conscrypt.module.public.api", |
Neha Pattan | fa46dd2 | 2022-02-18 19:46:09 +0000 | [diff] [blame] | 112 | "framework-adservices", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 113 | "framework-appsearch", |
Roopa Sattiraju | 8e30577 | 2022-01-20 10:05:19 -0800 | [diff] [blame] | 114 | "framework-bluetooth", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 115 | "framework-connectivity", |
paulhu | e074dd2 | 2022-02-08 21:23:06 +0800 | [diff] [blame] | 116 | "framework-connectivity-t", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 117 | "framework-graphics", |
| 118 | "framework-media", |
| 119 | "framework-mediaprovider", |
Frank Wang | e97ff9e | 2022-02-13 07:06:31 +0000 | [diff] [blame] | 120 | "framework-ondevicepersonalization", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 121 | "framework-permission", |
| 122 | "framework-permission-s", |
| 123 | "framework-scheduling", |
| 124 | "framework-sdkextensions", |
| 125 | "framework-statsd", |
Nikita Ioffe | 59029ad | 2022-02-24 01:56:44 +0000 | [diff] [blame] | 126 | "framework-sdksandbox", |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 127 | "framework-tethering", |
| 128 | "framework-uwb", |
| 129 | "framework-wifi", |
| 130 | "i18n.module.public.api", |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 131 | ], |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 132 | system_server_classpath: [ |
| 133 | "service-media-s", |
| 134 | "service-permission", |
Nikita Ioffe | 59029ad | 2022-02-24 01:56:44 +0000 | [diff] [blame] | 135 | "service-sdksandbox", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 136 | ], |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 140 | name: "frameworks-base-api-current-compat", |
| 141 | srcs: [ |
| 142 | ":android.api.public.latest", |
| 143 | ":android-incompatibilities.api.public.latest", |
| 144 | ":frameworks-base-api-current.txt", |
| 145 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 146 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 147 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 148 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 149 | "--check-compatibility:api:released $(location :android.api.public.latest) " + |
| 150 | "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 151 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 152 | "$(location :frameworks-base-api-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 156 | name: "frameworks-base-api-system-current-compat", |
| 157 | srcs: [ |
| 158 | ":android.api.system.latest", |
| 159 | ":android-incompatibilities.api.system.latest", |
| 160 | ":frameworks-base-api-current.txt", |
| 161 | ":frameworks-base-api-system-current.txt", |
| 162 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 163 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 164 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 165 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 166 | "--check-compatibility:api:released $(location :android.api.system.latest) " + |
| 167 | "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + |
| 168 | "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 169 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 170 | "$(location :frameworks-base-api-system-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 174 | name: "frameworks-base-api-module-lib-current-compat", |
| 175 | srcs: [ |
| 176 | ":android.api.module-lib.latest", |
| 177 | ":android-incompatibilities.api.module-lib.latest", |
| 178 | ":frameworks-base-api-current.txt", |
| 179 | ":frameworks-base-api-module-lib-current.txt", |
| 180 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 181 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 182 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 183 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 184 | "--check-compatibility:api:released $(location :android.api.module-lib.latest) " + |
| 185 | // Note: having "public" be the base of module-lib is not perfect -- it should |
Anton Hansson | 9d34e31 | 2022-02-23 11:24:00 +0000 | [diff] [blame] | 186 | // ideally be a merged public+system (which metalava is not currently able to generate). |
| 187 | // This "base" will help when migrating from MODULE_LIBS -> public, but not when |
| 188 | // migrating from MODULE_LIBS -> system (where it needs to instead be listed as |
| 189 | // an incompatibility). |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 190 | "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + |
| 191 | "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 192 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 193 | "$(location :frameworks-base-api-module-lib-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | genrule { |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 197 | name: "combined-removed-dex", |
Paul Duffin | 81af1f5 | 2021-04-08 19:22:50 +0100 | [diff] [blame] | 198 | visibility: [ |
| 199 | "//frameworks/base/boot", |
| 200 | ], |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 201 | srcs: [ |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 202 | ":frameworks-base-api-removed.txt", |
| 203 | ":frameworks-base-api-system-removed.txt", |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 204 | ":android.car-stubs-docs{.removed-api.txt}", |
| 205 | ":android.car-system-stubs-docs{.removed-api.txt}", |
| 206 | ], |
| 207 | tool_files: ["gen_combined_removed_dex.sh"], |
| 208 | tools: ["metalava"], |
| 209 | out: ["combined-removed-dex.txt"], |
| 210 | cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)", |
| 211 | } |