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", |
| 126 | "framework-supplementalprocess", |
| 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 | a8e3488 | 2022-01-12 17:28:39 +0000 | [diff] [blame] | 132 | conditional_bootclasspath: [ |
Frank Wang | 07861f7 | 2022-01-25 18:41:45 +0000 | [diff] [blame] | 133 | "framework-auxiliary", |
Anton Hansson | a8e3488 | 2022-01-12 17:28:39 +0000 | [diff] [blame] | 134 | "framework-supplementalapi", |
| 135 | ], |
Anton Hansson | 648e609 | 2022-01-11 16:37:05 +0000 | [diff] [blame] | 136 | system_server_classpath: [ |
| 137 | "service-media-s", |
| 138 | "service-permission", |
Nikita Ioffe | e48d201 | 2022-01-17 20:38:40 +0000 | [diff] [blame] | 139 | "service-supplementalprocess", |
Anton Hansson | a9ced80 | 2020-10-20 19:26:18 +0100 | [diff] [blame] | 140 | ], |
Anton Hansson | 85359f6 | 2020-09-21 17:02:25 +0100 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 144 | name: "frameworks-base-api-current-compat", |
| 145 | srcs: [ |
| 146 | ":android.api.public.latest", |
| 147 | ":android-incompatibilities.api.public.latest", |
| 148 | ":frameworks-base-api-current.txt", |
| 149 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 150 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 151 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 152 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 153 | "--check-compatibility:api:released $(location :android.api.public.latest) " + |
| 154 | "--baseline:compatibility:released $(location :android-incompatibilities.api.public.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 155 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 156 | "$(location :frameworks-base-api-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 160 | name: "frameworks-base-api-system-current-compat", |
| 161 | srcs: [ |
| 162 | ":android.api.system.latest", |
| 163 | ":android-incompatibilities.api.system.latest", |
| 164 | ":frameworks-base-api-current.txt", |
| 165 | ":frameworks-base-api-system-current.txt", |
| 166 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 167 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 168 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 169 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 170 | "--check-compatibility:api:released $(location :android.api.system.latest) " + |
| 171 | "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + |
| 172 | "--baseline:compatibility:released $(location :android-incompatibilities.api.system.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 173 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 174 | "$(location :frameworks-base-api-system-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | genrule { |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 178 | name: "frameworks-base-api-module-lib-current-compat", |
| 179 | srcs: [ |
| 180 | ":android.api.module-lib.latest", |
| 181 | ":android-incompatibilities.api.module-lib.latest", |
| 182 | ":frameworks-base-api-current.txt", |
| 183 | ":frameworks-base-api-module-lib-current.txt", |
| 184 | ], |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 185 | out: ["updated-baseline.txt"], |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 186 | tools: ["metalava"], |
Anton Hansson | aa26cc1 | 2021-02-15 10:52:33 +0000 | [diff] [blame] | 187 | cmd: metalava_cmd + |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 188 | "--check-compatibility:api:released $(location :android.api.module-lib.latest) " + |
| 189 | // Note: having "public" be the base of module-lib is not perfect -- it should |
| 190 | // ideally be a merged public+system), but this will help when migrating from |
| 191 | // MODULE_LIBS -> public. |
| 192 | "--check-compatibility:base $(location :frameworks-base-api-current.txt) " + |
| 193 | "--baseline:compatibility:released $(location :android-incompatibilities.api.module-lib.latest) " + |
Anton Hansson | b8ce081 | 2021-08-24 12:08:39 +0100 | [diff] [blame] | 194 | "--update-baseline:compatibility:released $(genDir)/updated-baseline.txt " + |
| 195 | "$(location :frameworks-base-api-module-lib-current.txt)", |
Anton Hansson | 0d6eae6 | 2021-02-12 16:47:18 +0000 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | genrule { |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 199 | name: "combined-removed-dex", |
Paul Duffin | 81af1f5 | 2021-04-08 19:22:50 +0100 | [diff] [blame] | 200 | visibility: [ |
| 201 | "//frameworks/base/boot", |
| 202 | ], |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 203 | srcs: [ |
Anton Hansson | 1c4fab4 | 2020-11-02 11:57:33 +0000 | [diff] [blame] | 204 | ":frameworks-base-api-removed.txt", |
| 205 | ":frameworks-base-api-system-removed.txt", |
Anton Hansson | a15427a | 2020-10-02 18:21:14 +0100 | [diff] [blame] | 206 | ":android.car-stubs-docs{.removed-api.txt}", |
| 207 | ":android.car-system-stubs-docs{.removed-api.txt}", |
| 208 | ], |
| 209 | tool_files: ["gen_combined_removed_dex.sh"], |
| 210 | tools: ["metalava"], |
| 211 | out: ["combined-removed-dex.txt"], |
| 212 | cmd: "$(location gen_combined_removed_dex.sh) $(location metalava) $(genDir) $(in) > $(out)", |
| 213 | } |