Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 1 | // Copyright (C) 2021 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 | // |
| 16 | // Definitions for building the Android core libraries, i.e. ART, I18n and |
| 17 | // Conscrypt. |
| 18 | // |
| 19 | // These are here as the definitions are used by the build itself and include |
| 20 | // parts from all three of those modules. |
| 21 | // |
| 22 | |
| 23 | // A stubs target containing the parts of the public SDK API provided by the |
| 24 | // core libraries. |
| 25 | // |
| 26 | // Don't use this directly, use "sdk_version: core_current". |
Bob Badour | 36dc7c6 | 2021-08-27 13:30:35 -0700 | [diff] [blame] | 27 | package { |
| 28 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 29 | } |
| 30 | |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 31 | dist_targets = [ |
| 32 | "sdk", |
| 33 | "win_sdk", |
| 34 | ] |
| 35 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 36 | java_defaults { |
| 37 | name: "core.current.stubs.defaults", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 38 | visibility: ["//visibility:public"], |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 39 | sdk_version: "none", |
| 40 | system_modules: "none", |
Jihoon Kang | 85bc193 | 2024-07-01 17:04:46 +0000 | [diff] [blame] | 41 | is_stubs_module: true, |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 42 | } |
| 43 | |
Jihoon Kang | a043a1b | 2024-03-21 20:54:49 +0000 | [diff] [blame] | 44 | soong_config_module_type { |
| 45 | name: "core_current_stubs_soong_config_defaults", |
| 46 | module_type: "java_defaults", |
| 47 | config_namespace: "ANDROID", |
| 48 | bool_variables: [ |
| 49 | "release_hidden_api_exportable_stubs", |
| 50 | ], |
| 51 | properties: [ |
| 52 | "dist.targets", |
| 53 | "dist.dest", |
| 54 | ], |
| 55 | } |
| 56 | |
| 57 | core_current_stubs_soong_config_defaults { |
| 58 | name: "core_current_stubs_everything_soong_config_defaults", |
| 59 | soong_config_variables: { |
| 60 | release_hidden_api_exportable_stubs: { |
| 61 | conditions_default: { |
| 62 | dist: { |
| 63 | targets: dist_targets, |
| 64 | dest: "core.current.stubs.jar", |
| 65 | }, |
| 66 | }, |
| 67 | }, |
| 68 | }, |
| 69 | } |
| 70 | |
| 71 | core_current_stubs_soong_config_defaults { |
| 72 | name: "core_current_stubs_exportable_soong_config_defaults", |
| 73 | soong_config_variables: { |
| 74 | release_hidden_api_exportable_stubs: { |
| 75 | dist: { |
| 76 | targets: dist_targets, |
| 77 | dest: "core.current.stubs.jar", |
| 78 | }, |
| 79 | }, |
| 80 | }, |
| 81 | } |
| 82 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 83 | java_library { |
Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 84 | name: "core.current.stubs", |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 85 | defaults: [ |
| 86 | "core.current.stubs.defaults", |
Jihoon Kang | a043a1b | 2024-03-21 20:54:49 +0000 | [diff] [blame] | 87 | "core_current_stubs_everything_soong_config_defaults", |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 88 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 89 | static_libs: [ |
| 90 | "art.module.public.api.stubs", |
| 91 | "conscrypt.module.public.api.stubs", |
| 92 | "i18n.module.public.api.stubs", |
| 93 | ], |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 94 | } |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 95 | |
Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 96 | // Used for bootstrapping ART system modules |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 97 | java_api_library { |
| 98 | name: "core.current.stubs.from-text", |
Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 99 | defaults: [ |
| 100 | "core.current.stubs.defaults", |
| 101 | ], |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 102 | api_surface: "core", |
| 103 | api_contributions: [ |
| 104 | "art.module.public.api.stubs.source.api.contribution", |
| 105 | "conscrypt.module.public.api.stubs.source.api.contribution", |
| 106 | "i18n.module.public.api.stubs.source.api.contribution", |
| 107 | ], |
| 108 | libs: [ |
| 109 | "stub-annotations", |
| 110 | ], |
Jihoon Kang | 063ec00 | 2023-06-28 01:16:23 +0000 | [diff] [blame] | 111 | enable_validation: false, |
Jihoon Kang | 5d70127 | 2024-02-15 21:53:49 +0000 | [diff] [blame] | 112 | stubs_type: "everything", |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 113 | } |
| 114 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 115 | java_library { |
Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 116 | name: "core.current.stubs.exportable", |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 117 | defaults: [ |
| 118 | "core.current.stubs.defaults", |
Jihoon Kang | a043a1b | 2024-03-21 20:54:49 +0000 | [diff] [blame] | 119 | "core_current_stubs_exportable_soong_config_defaults", |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 120 | ], |
| 121 | static_libs: [ |
| 122 | "art.module.public.api.stubs.exportable", |
| 123 | "conscrypt.module.public.api.stubs.exportable", |
| 124 | "i18n.module.public.api.stubs.exportable", |
| 125 | ], |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 126 | } |
| 127 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 128 | // Distributed with the SDK for turning into system modules to compile apps |
| 129 | // against. |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 130 | // |
| 131 | // Also, produces dist files that are used by the |
| 132 | // prebuilts/sdk/update_prebuilts.py script to update the prebuilts/sdk |
| 133 | // directory. |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 134 | java_library { |
| 135 | name: "core-current-stubs-for-system-modules", |
| 136 | visibility: ["//development/sdk"], |
| 137 | static_libs: [ |
| 138 | "core.current.stubs", |
| 139 | // This one is not on device but it's needed when javac compiles code |
| 140 | // containing lambdas. |
| 141 | "core-lambda-stubs-for-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 142 | ], |
| 143 | sdk_version: "none", |
| 144 | system_modules: "none", |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 145 | dists: [ |
| 146 | { |
| 147 | // Legacy dist location for the public file. |
| 148 | dest: "core-for-system-modules.jar", |
| 149 | targets: dist_targets, |
| 150 | }, |
| 151 | { |
| 152 | dest: "system-modules/public/core-for-system-modules.jar", |
| 153 | targets: dist_targets, |
| 154 | }, |
| 155 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 156 | } |
| 157 | |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 158 | // Defaults module to strip out android annotations |
| 159 | java_defaults { |
| 160 | name: "system-modules-no-annotations", |
| 161 | sdk_version: "none", |
| 162 | system_modules: "none", |
| 163 | jarjar_rules: "jarjar-strip-annotations-rules.txt", |
| 164 | } |
| 165 | |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 166 | // Same as core-current-stubs-for-system-modules, but android annotations are |
| 167 | // stripped. |
| 168 | java_library { |
| 169 | name: "core-current-stubs-for-system-modules-no-annotations", |
| 170 | visibility: ["//development/sdk"], |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 171 | defaults: [ |
| 172 | "system-modules-no-annotations", |
| 173 | ], |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 174 | static_libs: [ |
| 175 | "core-current-stubs-for-system-modules", |
| 176 | ], |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 177 | dists: [ |
| 178 | { |
| 179 | // Legacy dist location for the public file. |
| 180 | dest: "core-for-system-modules-no-annotations.jar", |
| 181 | targets: dist_targets, |
| 182 | }, |
| 183 | { |
| 184 | dest: "system-modules/public/core-for-system-modules-no-annotations.jar", |
| 185 | targets: dist_targets, |
| 186 | }, |
| 187 | ], |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 188 | } |
| 189 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 190 | // Used when compiling higher-level code against core.current.stubs. |
| 191 | java_system_modules { |
Paul Duffin | 10fb76f | 2021-11-03 16:53:31 +0000 | [diff] [blame] | 192 | name: "core-public-stubs-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 193 | visibility: ["//visibility:public"], |
| 194 | libs: [ |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 195 | "core-current-stubs-for-system-modules-no-annotations", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 196 | ], |
| 197 | } |
| 198 | |
Romain Jobredeaux | 9d54fda | 2023-07-28 10:32:50 -0400 | [diff] [blame] | 199 | java_defaults { |
| 200 | name: "core.module_lib.stubs.defaults", |
| 201 | visibility: ["//visibility:private"], |
| 202 | sdk_version: "none", |
| 203 | system_modules: "none", |
| 204 | } |
| 205 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 206 | // A stubs target containing the parts of the public SDK & @SystemApi(MODULE_LIBRARIES) API |
| 207 | // provided by the core libraries. |
| 208 | // |
| 209 | // Don't use this directly, use "sdk_version: module_current". |
| 210 | java_library { |
| 211 | name: "core.module_lib.stubs", |
Romain Jobredeaux | 9d54fda | 2023-07-28 10:32:50 -0400 | [diff] [blame] | 212 | defaults: [ |
| 213 | "core.module_lib.stubs.defaults", |
| 214 | ], |
| 215 | static_libs: [ |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 216 | "art.module.public.api.stubs.module_lib", |
| 217 | |
| 218 | // Replace the following with the module-lib correspondence when Conscrypt or i18N module |
| 219 | // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides |
| 220 | // @SystemApi(MODULE_LIBRARIES). |
| 221 | "conscrypt.module.public.api.stubs", |
| 222 | "i18n.module.public.api.stubs", |
| 223 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 224 | } |
| 225 | |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 226 | // Produces a dist file that is used by the |
| 227 | // prebuilts/sdk/update_prebuilts.py script to update the prebuilts/sdk |
| 228 | // directory. |
| 229 | java_library { |
| 230 | name: "core-module-lib-stubs-for-system-modules", |
| 231 | visibility: ["//visibility:private"], |
| 232 | static_libs: [ |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 233 | "core.module_lib.stubs", |
| 234 | // This one is not on device but it's needed when javac compiles code |
| 235 | // containing lambdas. |
| 236 | "core-lambda-stubs-for-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 237 | ], |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 238 | sdk_version: "none", |
| 239 | system_modules: "none", |
| 240 | dist: { |
| 241 | dest: "system-modules/module-lib/core-for-system-modules.jar", |
| 242 | targets: dist_targets, |
| 243 | }, |
| 244 | } |
| 245 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 246 | // Same as core-module-lib-stubs-for-system-modules, but android annotations are |
| 247 | // stripped. This is used by the Java toolchain, while the annotated stub is to |
| 248 | // be used by Kotlin one. |
| 249 | java_library { |
| 250 | name: "core-module-lib-stubs-for-system-modules-no-annotations", |
| 251 | visibility: ["//visibility:private"], |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 252 | defaults: [ |
| 253 | "system-modules-no-annotations", |
| 254 | ], |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 255 | static_libs: [ |
| 256 | "core-module-lib-stubs-for-system-modules", |
| 257 | ], |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 258 | dist: { |
| 259 | dest: "system-modules/module-lib/core-for-system-modules-no-annotations.jar", |
| 260 | targets: dist_targets, |
| 261 | }, |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 262 | } |
| 263 | |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 264 | // Used when compiling higher-level code with sdk_version "module_current" |
| 265 | java_system_modules { |
| 266 | name: "core-module-lib-stubs-system-modules", |
| 267 | libs: [ |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 268 | "core-module-lib-stubs-for-system-modules-no-annotations", |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 269 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 270 | visibility: ["//visibility:public"], |
| 271 | } |
| 272 | |
| 273 | // Ideally this should be a restricted allowlist but there are hundreds of modules that depend on |
| 274 | // this. |
| 275 | // TODO(http://b/134561230) - limit the number of dependents on this. |
| 276 | core_platform_visibility = ["//visibility:public"] |
| 277 | |
| 278 | // Libraries containing the core platform API stubs for the core libraries. |
| 279 | // |
| 280 | // Although this stubs library is primarily used by the Java compiler / build to indicate |
| 281 | // the core platform API surface area, compile_dex: true is used so that the Core Platform |
| 282 | // API annotations are available to the dex tools that enable enforcement of runtime |
| 283 | // accessibility. b/119068555 |
| 284 | java_library { |
Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 285 | name: "legacy.core.platform.api.stubs", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 286 | visibility: core_platform_visibility, |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 287 | defaults: [ |
| 288 | "core.platform.api.stubs.defaults", |
| 289 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 290 | static_libs: [ |
| 291 | "art.module.public.api.stubs.module_lib", |
| 292 | "conscrypt.module.platform.api.stubs", |
| 293 | "legacy.i18n.module.platform.api.stubs", |
| 294 | ], |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 295 | } |
| 296 | |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 297 | java_library { |
Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 298 | name: "legacy.core.platform.api.stubs.exportable", |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 299 | visibility: core_platform_visibility, |
| 300 | defaults: [ |
| 301 | "core.platform.api.stubs.defaults", |
| 302 | ], |
| 303 | static_libs: [ |
| 304 | "art.module.public.api.stubs.exportable.module_lib", |
| 305 | "conscrypt.module.platform.api.stubs.exportable", |
| 306 | "legacy.i18n.module.platform.api.stubs.exportable", |
| 307 | ], |
| 308 | } |
| 309 | |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 310 | java_defaults { |
| 311 | name: "android_core_platform_stubs_current_contributions", |
| 312 | api_surface: "core_platform", |
| 313 | api_contributions: [ |
| 314 | "art.module.public.api.stubs.source.api.contribution", |
| 315 | "art.module.public.api.stubs.source.system.api.contribution", |
| 316 | "art.module.public.api.stubs.source.module_lib.api.contribution", |
| 317 | "conscrypt.module.platform.api.stubs.source.api.contribution", |
| 318 | "i18n.module.public.api.stubs.source.api.contribution", |
| 319 | ], |
| 320 | } |
| 321 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 322 | java_defaults { |
| 323 | name: "core.platform.api.stubs.defaults", |
| 324 | hostdex: true, |
| 325 | compile_dex: true, |
| 326 | |
| 327 | sdk_version: "none", |
| 328 | system_modules: "none", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 329 | patch_module: "java.base", |
Jihoon Kang | 85bc193 | 2024-07-01 17:04:46 +0000 | [diff] [blame] | 330 | is_stubs_module: true, |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 331 | } |
| 332 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 333 | // Same as legacy.core.platform.api.stubs, but android annotations are |
| 334 | // stripped. This is used by the Java toolchain, while the annotated stub is to |
| 335 | // be used by Kotlin one. |
| 336 | java_library { |
| 337 | name: "legacy.core.platform.api.no.annotations.stubs", |
| 338 | visibility: core_platform_visibility, |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 339 | defaults: [ |
| 340 | "system-modules-no-annotations", |
| 341 | ], |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 342 | hostdex: true, |
| 343 | compile_dex: true, |
| 344 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 345 | static_libs: [ |
| 346 | "legacy.core.platform.api.stubs", |
| 347 | ], |
| 348 | patch_module: "java.base", |
Jihoon Kang | 85bc193 | 2024-07-01 17:04:46 +0000 | [diff] [blame] | 349 | is_stubs_module: true, |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 350 | } |
| 351 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 352 | java_library { |
Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 353 | name: "stable.core.platform.api.stubs", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 354 | visibility: core_platform_visibility, |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 355 | defaults: [ |
| 356 | "core.platform.api.stubs.defaults", |
| 357 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 358 | static_libs: [ |
| 359 | "art.module.public.api.stubs.module_lib", |
| 360 | // conscrypt only has a stable version, so it is okay to depend on it here: |
| 361 | "conscrypt.module.platform.api.stubs", |
| 362 | "stable.i18n.module.platform.api.stubs", |
| 363 | ], |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 364 | } |
| 365 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 366 | // Same as stable.core.platform.api.stubs, but android annotations are |
| 367 | // stripped. This is used by the Java toolchain, while the annotated stub is to |
| 368 | // be used by Kotlin one. |
| 369 | java_library { |
| 370 | name: "stable.core.platform.api.no.annotations.stubs", |
| 371 | visibility: core_platform_visibility, |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 372 | defaults: [ |
| 373 | "system-modules-no-annotations", |
| 374 | ], |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 375 | hostdex: true, |
| 376 | compile_dex: true, |
| 377 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 378 | static_libs: [ |
| 379 | "stable.core.platform.api.stubs", |
| 380 | ], |
| 381 | patch_module: "java.base", |
Jihoon Kang | 85bc193 | 2024-07-01 17:04:46 +0000 | [diff] [blame] | 382 | is_stubs_module: true, |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 383 | } |
| 384 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 385 | // Used when compiling higher-level code against *.core.platform.api.stubs. |
| 386 | java_system_modules { |
| 387 | name: "legacy-core-platform-api-stubs-system-modules", |
| 388 | visibility: core_platform_visibility, |
| 389 | libs: [ |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 390 | "legacy.core.platform.api.no.annotations.stubs", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 391 | // This one is not on device but it's needed when javac compiles code |
| 392 | // containing lambdas. |
| 393 | "core-lambda-stubs-for-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 394 | ], |
| 395 | } |
| 396 | |
| 397 | java_system_modules { |
| 398 | name: "stable-core-platform-api-stubs-system-modules", |
| 399 | visibility: core_platform_visibility, |
| 400 | libs: [ |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 401 | "stable.core.platform.api.no.annotations.stubs", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 402 | // This one is not on device but it's needed when javac compiles code |
| 403 | // containing lambdas. |
| 404 | "core-lambda-stubs-for-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 405 | ], |
| 406 | } |
Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 407 | |
| 408 | // Used when compiling higher-level code against art.module.public.api.stubs. |
| 409 | // This abstraction should come from the inner tree linking against the stubs |
| 410 | // and not from an "sdk", since parts of this abstraction do not belong to an |
| 411 | // official API (e.g. stub-annotations). |
| 412 | // |
| 413 | // This is only intended for use within core libraries and must not be used |
| 414 | // from outside. |
| 415 | java_system_modules { |
| 416 | name: "art-module-public-api-stubs-system-modules", |
| 417 | visibility: [ |
| 418 | "//art/build/sdk", |
| 419 | "//external/conscrypt", |
| 420 | "//external/icu/android_icu4j", |
| 421 | "//external/wycheproof", |
| 422 | ], |
| 423 | libs: [ |
| 424 | "art.module.public.api.stubs", |
| 425 | // This one is not on device but it's needed when javac compiles code |
| 426 | // containing lambdas. |
| 427 | "core-lambda-stubs-for-system-modules", |
Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 428 | |
| 429 | // Ensure that core libraries that depend on the public API can access |
| 430 | // the UnsupportedAppUsage, CorePlatformApi and IntraCoreApi |
| 431 | // annotations. |
| 432 | "art.module.api.annotations.for.system.modules", |
Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 433 | ], |
| 434 | } |
| 435 | |
| 436 | // Used when compiling higher-level code against art.module.public.api.stubs.module_lib. |
| 437 | // |
| 438 | // This is only intended for use within core libraries and must not be used |
| 439 | // from outside. |
| 440 | java_system_modules { |
| 441 | name: "art-module-lib-api-stubs-system-modules", |
| 442 | visibility: [ |
| 443 | "//art/build/sdk", |
| 444 | "//external/conscrypt", |
| 445 | "//external/icu/android_icu4j", |
| 446 | ], |
| 447 | libs: [ |
| 448 | "art.module.public.api.stubs.module_lib", |
| 449 | ], |
| 450 | } |
| 451 | |
| 452 | // Used when compiling against art.module.intra.core.api.stubs. |
| 453 | java_system_modules { |
| 454 | name: "art-module-intra-core-api-stubs-system-modules", |
| 455 | visibility: [ |
| 456 | "//art/build/sdk", |
| 457 | "//external/bouncycastle", |
| 458 | "//external/conscrypt", |
| 459 | "//external/icu/android_icu4j", |
| 460 | ], |
| 461 | libs: [ |
| 462 | // The intra core API stubs library. |
| 463 | "art.module.intra.core.api.stubs", |
| 464 | |
| 465 | // Additional classes needed by javac but which are not present in the stubs. |
| 466 | "art-module-intra-core-api-stubs-system-modules-lib", |
| 467 | ], |
| 468 | } |