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 | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 41 | } |
| 42 | |
Jihoon Kang | a043a1b | 2024-03-21 20:54:49 +0000 | [diff] [blame^] | 43 | soong_config_module_type { |
| 44 | name: "core_current_stubs_soong_config_defaults", |
| 45 | module_type: "java_defaults", |
| 46 | config_namespace: "ANDROID", |
| 47 | bool_variables: [ |
| 48 | "release_hidden_api_exportable_stubs", |
| 49 | ], |
| 50 | properties: [ |
| 51 | "dist.targets", |
| 52 | "dist.dest", |
| 53 | ], |
| 54 | } |
| 55 | |
| 56 | core_current_stubs_soong_config_defaults { |
| 57 | name: "core_current_stubs_everything_soong_config_defaults", |
| 58 | soong_config_variables: { |
| 59 | release_hidden_api_exportable_stubs: { |
| 60 | conditions_default: { |
| 61 | dist: { |
| 62 | targets: dist_targets, |
| 63 | dest: "core.current.stubs.jar", |
| 64 | }, |
| 65 | }, |
| 66 | }, |
| 67 | }, |
| 68 | } |
| 69 | |
| 70 | core_current_stubs_soong_config_defaults { |
| 71 | name: "core_current_stubs_exportable_soong_config_defaults", |
| 72 | soong_config_variables: { |
| 73 | release_hidden_api_exportable_stubs: { |
| 74 | dist: { |
| 75 | targets: dist_targets, |
| 76 | dest: "core.current.stubs.jar", |
| 77 | }, |
| 78 | }, |
| 79 | }, |
| 80 | } |
| 81 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 82 | java_library { |
| 83 | name: "core.current.stubs.from-source", |
| 84 | defaults: [ |
| 85 | "core.current.stubs.defaults", |
Jihoon Kang | a043a1b | 2024-03-21 20:54:49 +0000 | [diff] [blame^] | 86 | "core_current_stubs_everything_soong_config_defaults", |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 87 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 88 | static_libs: [ |
| 89 | "art.module.public.api.stubs", |
| 90 | "conscrypt.module.public.api.stubs", |
| 91 | "i18n.module.public.api.stubs", |
| 92 | ], |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 93 | } |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 94 | |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 95 | java_api_library { |
| 96 | name: "core.current.stubs.from-text", |
| 97 | api_surface: "core", |
| 98 | api_contributions: [ |
| 99 | "art.module.public.api.stubs.source.api.contribution", |
| 100 | "conscrypt.module.public.api.stubs.source.api.contribution", |
| 101 | "i18n.module.public.api.stubs.source.api.contribution", |
| 102 | ], |
| 103 | libs: [ |
| 104 | "stub-annotations", |
| 105 | ], |
Jihoon Kang | 063ec00 | 2023-06-28 01:16:23 +0000 | [diff] [blame] | 106 | enable_validation: false, |
Jihoon Kang | 5d70127 | 2024-02-15 21:53:49 +0000 | [diff] [blame] | 107 | stubs_type: "everything", |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 108 | } |
| 109 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 110 | java_library { |
| 111 | name: "core.current.stubs", |
| 112 | defaults: [ |
| 113 | "core.current.stubs.defaults", |
| 114 | ], |
| 115 | static_libs: [ |
| 116 | "core.current.stubs.from-source", |
| 117 | ], |
| 118 | product_variables: { |
| 119 | build_from_text_stub: { |
| 120 | static_libs: [ |
| 121 | "core.current.stubs.from-text", |
| 122 | ], |
| 123 | exclude_static_libs: [ |
| 124 | "core.current.stubs.from-source", |
| 125 | ], |
| 126 | }, |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 127 | }, |
| 128 | } |
| 129 | |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 130 | java_library { |
| 131 | name: "core.current.stubs.exportable.from-source", |
| 132 | defaults: [ |
| 133 | "core.current.stubs.defaults", |
Jihoon Kang | a043a1b | 2024-03-21 20:54:49 +0000 | [diff] [blame^] | 134 | "core_current_stubs_exportable_soong_config_defaults", |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 135 | ], |
| 136 | static_libs: [ |
| 137 | "art.module.public.api.stubs.exportable", |
| 138 | "conscrypt.module.public.api.stubs.exportable", |
| 139 | "i18n.module.public.api.stubs.exportable", |
| 140 | ], |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | java_library { |
| 144 | name: "core.current.stubs.exportable", |
| 145 | defaults: [ |
| 146 | "core.current.stubs.defaults", |
| 147 | ], |
| 148 | static_libs: [ |
| 149 | "core.current.stubs.exportable.from-source", |
| 150 | ], |
| 151 | } |
| 152 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 153 | // Distributed with the SDK for turning into system modules to compile apps |
| 154 | // against. |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 155 | // |
| 156 | // Also, produces dist files that are used by the |
| 157 | // prebuilts/sdk/update_prebuilts.py script to update the prebuilts/sdk |
| 158 | // directory. |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 159 | java_library { |
| 160 | name: "core-current-stubs-for-system-modules", |
| 161 | visibility: ["//development/sdk"], |
| 162 | static_libs: [ |
| 163 | "core.current.stubs", |
| 164 | // This one is not on device but it's needed when javac compiles code |
| 165 | // containing lambdas. |
| 166 | "core-lambda-stubs-for-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 167 | ], |
| 168 | sdk_version: "none", |
| 169 | system_modules: "none", |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 170 | dists: [ |
| 171 | { |
| 172 | // Legacy dist location for the public file. |
| 173 | dest: "core-for-system-modules.jar", |
| 174 | targets: dist_targets, |
| 175 | }, |
| 176 | { |
| 177 | dest: "system-modules/public/core-for-system-modules.jar", |
| 178 | targets: dist_targets, |
| 179 | }, |
| 180 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 181 | } |
| 182 | |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 183 | // Defaults module to strip out android annotations |
| 184 | java_defaults { |
| 185 | name: "system-modules-no-annotations", |
| 186 | sdk_version: "none", |
| 187 | system_modules: "none", |
| 188 | jarjar_rules: "jarjar-strip-annotations-rules.txt", |
| 189 | } |
| 190 | |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 191 | // Same as core-current-stubs-for-system-modules, but android annotations are |
| 192 | // stripped. |
| 193 | java_library { |
| 194 | name: "core-current-stubs-for-system-modules-no-annotations", |
| 195 | visibility: ["//development/sdk"], |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 196 | defaults: [ |
| 197 | "system-modules-no-annotations", |
| 198 | ], |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 199 | static_libs: [ |
| 200 | "core-current-stubs-for-system-modules", |
| 201 | ], |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 202 | dists: [ |
| 203 | { |
| 204 | // Legacy dist location for the public file. |
| 205 | dest: "core-for-system-modules-no-annotations.jar", |
| 206 | targets: dist_targets, |
| 207 | }, |
| 208 | { |
| 209 | dest: "system-modules/public/core-for-system-modules-no-annotations.jar", |
| 210 | targets: dist_targets, |
| 211 | }, |
| 212 | ], |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 213 | } |
| 214 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 215 | // Used when compiling higher-level code against core.current.stubs. |
| 216 | java_system_modules { |
Paul Duffin | 10fb76f | 2021-11-03 16:53:31 +0000 | [diff] [blame] | 217 | name: "core-public-stubs-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 218 | visibility: ["//visibility:public"], |
| 219 | libs: [ |
Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 220 | "core-current-stubs-for-system-modules-no-annotations", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 221 | ], |
| 222 | } |
| 223 | |
Romain Jobredeaux | 9d54fda | 2023-07-28 10:32:50 -0400 | [diff] [blame] | 224 | java_defaults { |
| 225 | name: "core.module_lib.stubs.defaults", |
| 226 | visibility: ["//visibility:private"], |
| 227 | sdk_version: "none", |
| 228 | system_modules: "none", |
| 229 | } |
| 230 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 231 | // A stubs target containing the parts of the public SDK & @SystemApi(MODULE_LIBRARIES) API |
| 232 | // provided by the core libraries. |
| 233 | // |
| 234 | // Don't use this directly, use "sdk_version: module_current". |
| 235 | java_library { |
| 236 | name: "core.module_lib.stubs", |
Romain Jobredeaux | 9d54fda | 2023-07-28 10:32:50 -0400 | [diff] [blame] | 237 | defaults: [ |
| 238 | "core.module_lib.stubs.defaults", |
| 239 | ], |
| 240 | static_libs: [ |
| 241 | "core.module_lib.stubs.from-source", |
| 242 | ], |
| 243 | product_variables: { |
| 244 | build_from_text_stub: { |
| 245 | static_libs: [ |
| 246 | "core.module_lib.stubs.from-text", |
| 247 | ], |
| 248 | exclude_static_libs: [ |
| 249 | "core.module_lib.stubs.from-source", |
| 250 | ], |
| 251 | }, |
| 252 | }, |
| 253 | } |
| 254 | |
| 255 | java_library { |
| 256 | name: "core.module_lib.stubs.from-source", |
| 257 | defaults: [ |
| 258 | "core.module_lib.stubs.defaults", |
| 259 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 260 | static_libs: [ |
| 261 | "art.module.public.api.stubs.module_lib", |
| 262 | |
| 263 | // Replace the following with the module-lib correspondence when Conscrypt or i18N module |
| 264 | // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides |
| 265 | // @SystemApi(MODULE_LIBRARIES). |
| 266 | "conscrypt.module.public.api.stubs", |
| 267 | "i18n.module.public.api.stubs", |
| 268 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 269 | } |
| 270 | |
Jihoon Kang | bfa2f9e | 2023-11-01 22:49:35 +0000 | [diff] [blame] | 271 | java_api_library { |
| 272 | name: "core.module_lib.stubs.from-text", |
| 273 | api_surface: "module-lib", |
| 274 | api_contributions: [ |
| 275 | "art.module.public.api.stubs.source.api.contribution", |
| 276 | "art.module.public.api.stubs.source.system.api.contribution", |
| 277 | "art.module.public.api.stubs.source.module_lib.api.contribution", |
| 278 | |
| 279 | // Add the module-lib correspondence when Conscrypt or i18N module |
| 280 | // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides |
| 281 | // @SystemApi(MODULE_LIBRARIES). |
| 282 | "conscrypt.module.public.api.stubs.source.api.contribution", |
| 283 | "i18n.module.public.api.stubs.source.api.contribution", |
| 284 | ], |
| 285 | libs: [ |
| 286 | "stub-annotations", |
| 287 | ], |
| 288 | visibility: ["//visibility:private"], |
Jihoon Kang | 5d70127 | 2024-02-15 21:53:49 +0000 | [diff] [blame] | 289 | stubs_type: "everything", |
Jihoon Kang | bfa2f9e | 2023-11-01 22:49:35 +0000 | [diff] [blame] | 290 | } |
| 291 | |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 292 | // Produces a dist file that is used by the |
| 293 | // prebuilts/sdk/update_prebuilts.py script to update the prebuilts/sdk |
| 294 | // directory. |
| 295 | java_library { |
| 296 | name: "core-module-lib-stubs-for-system-modules", |
| 297 | visibility: ["//visibility:private"], |
| 298 | static_libs: [ |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 299 | "core.module_lib.stubs", |
| 300 | // This one is not on device but it's needed when javac compiles code |
| 301 | // containing lambdas. |
| 302 | "core-lambda-stubs-for-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 303 | ], |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 304 | sdk_version: "none", |
| 305 | system_modules: "none", |
| 306 | dist: { |
| 307 | dest: "system-modules/module-lib/core-for-system-modules.jar", |
| 308 | targets: dist_targets, |
| 309 | }, |
| 310 | } |
| 311 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 312 | // Same as core-module-lib-stubs-for-system-modules, but android annotations are |
| 313 | // stripped. This is used by the Java toolchain, while the annotated stub is to |
| 314 | // be used by Kotlin one. |
| 315 | java_library { |
| 316 | name: "core-module-lib-stubs-for-system-modules-no-annotations", |
| 317 | visibility: ["//visibility:private"], |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 318 | defaults: [ |
| 319 | "system-modules-no-annotations", |
| 320 | ], |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 321 | static_libs: [ |
| 322 | "core-module-lib-stubs-for-system-modules", |
| 323 | ], |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 324 | dist: { |
| 325 | dest: "system-modules/module-lib/core-for-system-modules-no-annotations.jar", |
| 326 | targets: dist_targets, |
| 327 | }, |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 328 | } |
| 329 | |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 330 | // Used when compiling higher-level code with sdk_version "module_current" |
| 331 | java_system_modules { |
| 332 | name: "core-module-lib-stubs-system-modules", |
| 333 | libs: [ |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 334 | "core-module-lib-stubs-for-system-modules-no-annotations", |
Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 335 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 336 | visibility: ["//visibility:public"], |
| 337 | } |
| 338 | |
| 339 | // Ideally this should be a restricted allowlist but there are hundreds of modules that depend on |
| 340 | // this. |
| 341 | // TODO(http://b/134561230) - limit the number of dependents on this. |
| 342 | core_platform_visibility = ["//visibility:public"] |
| 343 | |
| 344 | // Libraries containing the core platform API stubs for the core libraries. |
| 345 | // |
| 346 | // Although this stubs library is primarily used by the Java compiler / build to indicate |
| 347 | // the core platform API surface area, compile_dex: true is used so that the Core Platform |
| 348 | // API annotations are available to the dex tools that enable enforcement of runtime |
| 349 | // accessibility. b/119068555 |
| 350 | java_library { |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 351 | name: "legacy.core.platform.api.stubs.from-source", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 352 | visibility: core_platform_visibility, |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 353 | defaults: [ |
| 354 | "core.platform.api.stubs.defaults", |
| 355 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 356 | static_libs: [ |
| 357 | "art.module.public.api.stubs.module_lib", |
| 358 | "conscrypt.module.platform.api.stubs", |
| 359 | "legacy.i18n.module.platform.api.stubs", |
| 360 | ], |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 361 | } |
| 362 | |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 363 | java_library { |
| 364 | name: "legacy.core.platform.api.stubs.exportable.from-source", |
| 365 | visibility: core_platform_visibility, |
| 366 | defaults: [ |
| 367 | "core.platform.api.stubs.defaults", |
| 368 | ], |
| 369 | static_libs: [ |
| 370 | "art.module.public.api.stubs.exportable.module_lib", |
| 371 | "conscrypt.module.platform.api.stubs.exportable", |
| 372 | "legacy.i18n.module.platform.api.stubs.exportable", |
| 373 | ], |
| 374 | } |
| 375 | |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 376 | java_defaults { |
| 377 | name: "android_core_platform_stubs_current_contributions", |
| 378 | api_surface: "core_platform", |
| 379 | api_contributions: [ |
| 380 | "art.module.public.api.stubs.source.api.contribution", |
| 381 | "art.module.public.api.stubs.source.system.api.contribution", |
| 382 | "art.module.public.api.stubs.source.module_lib.api.contribution", |
| 383 | "conscrypt.module.platform.api.stubs.source.api.contribution", |
| 384 | "i18n.module.public.api.stubs.source.api.contribution", |
| 385 | ], |
| 386 | } |
| 387 | |
| 388 | java_api_library { |
| 389 | name: "legacy.core.platform.api.stubs.from-text", |
| 390 | api_surface: "core_platform", |
| 391 | defaults: [ |
| 392 | "android_core_platform_stubs_current_contributions", |
| 393 | ], |
| 394 | api_contributions: [ |
| 395 | "legacy.i18n.module.platform.api.stubs.source.api.contribution", |
| 396 | ], |
| 397 | libs: [ |
| 398 | "stub-annotations", |
| 399 | ], |
Jihoon Kang | 5d70127 | 2024-02-15 21:53:49 +0000 | [diff] [blame] | 400 | stubs_type: "everything", |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 401 | } |
| 402 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 403 | java_library { |
| 404 | name: "legacy.core.platform.api.stubs", |
| 405 | visibility: core_platform_visibility, |
| 406 | defaults: [ |
| 407 | "core.platform.api.stubs.defaults", |
| 408 | ], |
| 409 | static_libs: [ |
| 410 | "legacy.core.platform.api.stubs.from-source", |
| 411 | ], |
| 412 | product_variables: { |
| 413 | build_from_text_stub: { |
| 414 | static_libs: [ |
Romain Jobredeaux | 9d54fda | 2023-07-28 10:32:50 -0400 | [diff] [blame] | 415 | "legacy.core.platform.api.stubs.from-text", |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 416 | ], |
| 417 | exclude_static_libs: [ |
Romain Jobredeaux | 9d54fda | 2023-07-28 10:32:50 -0400 | [diff] [blame] | 418 | "legacy.core.platform.api.stubs.from-source", |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 419 | ], |
| 420 | }, |
| 421 | }, |
| 422 | } |
| 423 | |
Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 424 | java_library { |
| 425 | name: "legacy.core.platform.api.stubs.exportable", |
| 426 | visibility: core_platform_visibility, |
| 427 | defaults: [ |
| 428 | "core.platform.api.stubs.defaults", |
| 429 | ], |
| 430 | static_libs: [ |
| 431 | "legacy.core.platform.api.stubs.exportable.from-source", |
| 432 | ], |
| 433 | } |
| 434 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 435 | java_defaults { |
| 436 | name: "core.platform.api.stubs.defaults", |
| 437 | hostdex: true, |
| 438 | compile_dex: true, |
| 439 | |
| 440 | sdk_version: "none", |
| 441 | system_modules: "none", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 442 | patch_module: "java.base", |
| 443 | } |
| 444 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 445 | // Same as legacy.core.platform.api.stubs, but android annotations are |
| 446 | // stripped. This is used by the Java toolchain, while the annotated stub is to |
| 447 | // be used by Kotlin one. |
| 448 | java_library { |
| 449 | name: "legacy.core.platform.api.no.annotations.stubs", |
| 450 | visibility: core_platform_visibility, |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 451 | defaults: [ |
| 452 | "system-modules-no-annotations", |
| 453 | ], |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 454 | hostdex: true, |
| 455 | compile_dex: true, |
| 456 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 457 | static_libs: [ |
| 458 | "legacy.core.platform.api.stubs", |
| 459 | ], |
| 460 | patch_module: "java.base", |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 461 | } |
| 462 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 463 | java_library { |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 464 | name: "stable.core.platform.api.stubs.from-source", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 465 | visibility: core_platform_visibility, |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 466 | defaults: [ |
| 467 | "core.platform.api.stubs.defaults", |
| 468 | ], |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 469 | static_libs: [ |
| 470 | "art.module.public.api.stubs.module_lib", |
| 471 | // conscrypt only has a stable version, so it is okay to depend on it here: |
| 472 | "conscrypt.module.platform.api.stubs", |
| 473 | "stable.i18n.module.platform.api.stubs", |
| 474 | ], |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 475 | } |
| 476 | |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 477 | java_api_library { |
| 478 | name: "stable.core.platform.api.stubs.from-text", |
| 479 | api_surface: "core_platform", |
| 480 | defaults: [ |
| 481 | "android_core_platform_stubs_current_contributions", |
| 482 | ], |
| 483 | api_contributions: [ |
| 484 | "stable.i18n.module.platform.api.stubs.source.api.contribution", |
| 485 | ], |
| 486 | libs: [ |
| 487 | "stub-annotations", |
| 488 | ], |
Jihoon Kang | 5d70127 | 2024-02-15 21:53:49 +0000 | [diff] [blame] | 489 | stubs_type: "everything", |
Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 490 | } |
| 491 | |
Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 492 | java_library { |
| 493 | name: "stable.core.platform.api.stubs", |
| 494 | visibility: core_platform_visibility, |
| 495 | defaults: [ |
| 496 | "core.platform.api.stubs.defaults", |
| 497 | ], |
| 498 | static_libs: [ |
| 499 | "stable.core.platform.api.stubs.from-source", |
| 500 | ], |
| 501 | product_variables: { |
| 502 | build_from_text_stub: { |
| 503 | static_libs: [ |
| 504 | "stable.core.platform.api.stubs.from-text", |
| 505 | ], |
| 506 | exclude_static_libs: [ |
| 507 | "stable.core.platform.api.stubs.from-source", |
| 508 | ], |
| 509 | }, |
| 510 | }, |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 511 | } |
| 512 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 513 | // Same as stable.core.platform.api.stubs, but android annotations are |
| 514 | // stripped. This is used by the Java toolchain, while the annotated stub is to |
| 515 | // be used by Kotlin one. |
| 516 | java_library { |
| 517 | name: "stable.core.platform.api.no.annotations.stubs", |
| 518 | visibility: core_platform_visibility, |
Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 519 | defaults: [ |
| 520 | "system-modules-no-annotations", |
| 521 | ], |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 522 | hostdex: true, |
| 523 | compile_dex: true, |
| 524 | |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 525 | static_libs: [ |
| 526 | "stable.core.platform.api.stubs", |
| 527 | ], |
| 528 | patch_module: "java.base", |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 529 | } |
| 530 | |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 531 | // Used when compiling higher-level code against *.core.platform.api.stubs. |
| 532 | java_system_modules { |
| 533 | name: "legacy-core-platform-api-stubs-system-modules", |
| 534 | visibility: core_platform_visibility, |
| 535 | libs: [ |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 536 | "legacy.core.platform.api.no.annotations.stubs", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 537 | // This one is not on device but it's needed when javac compiles code |
| 538 | // containing lambdas. |
| 539 | "core-lambda-stubs-for-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 540 | ], |
| 541 | } |
| 542 | |
| 543 | java_system_modules { |
| 544 | name: "stable-core-platform-api-stubs-system-modules", |
| 545 | visibility: core_platform_visibility, |
| 546 | libs: [ |
Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 547 | "stable.core.platform.api.no.annotations.stubs", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 548 | // This one is not on device but it's needed when javac compiles code |
| 549 | // containing lambdas. |
| 550 | "core-lambda-stubs-for-system-modules", |
Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 551 | ], |
| 552 | } |
Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 553 | |
| 554 | // Used when compiling higher-level code against art.module.public.api.stubs. |
| 555 | // This abstraction should come from the inner tree linking against the stubs |
| 556 | // and not from an "sdk", since parts of this abstraction do not belong to an |
| 557 | // official API (e.g. stub-annotations). |
| 558 | // |
| 559 | // This is only intended for use within core libraries and must not be used |
| 560 | // from outside. |
| 561 | java_system_modules { |
| 562 | name: "art-module-public-api-stubs-system-modules", |
| 563 | visibility: [ |
| 564 | "//art/build/sdk", |
| 565 | "//external/conscrypt", |
| 566 | "//external/icu/android_icu4j", |
| 567 | "//external/wycheproof", |
| 568 | ], |
| 569 | libs: [ |
| 570 | "art.module.public.api.stubs", |
| 571 | // This one is not on device but it's needed when javac compiles code |
| 572 | // containing lambdas. |
| 573 | "core-lambda-stubs-for-system-modules", |
Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 574 | |
| 575 | // Ensure that core libraries that depend on the public API can access |
| 576 | // the UnsupportedAppUsage, CorePlatformApi and IntraCoreApi |
| 577 | // annotations. |
| 578 | "art.module.api.annotations.for.system.modules", |
Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 579 | ], |
| 580 | } |
| 581 | |
| 582 | // Used when compiling higher-level code against art.module.public.api.stubs.module_lib. |
| 583 | // |
| 584 | // This is only intended for use within core libraries and must not be used |
| 585 | // from outside. |
| 586 | java_system_modules { |
| 587 | name: "art-module-lib-api-stubs-system-modules", |
| 588 | visibility: [ |
| 589 | "//art/build/sdk", |
| 590 | "//external/conscrypt", |
| 591 | "//external/icu/android_icu4j", |
| 592 | ], |
| 593 | libs: [ |
| 594 | "art.module.public.api.stubs.module_lib", |
| 595 | ], |
| 596 | } |
| 597 | |
| 598 | // Used when compiling against art.module.intra.core.api.stubs. |
| 599 | java_system_modules { |
| 600 | name: "art-module-intra-core-api-stubs-system-modules", |
| 601 | visibility: [ |
| 602 | "//art/build/sdk", |
| 603 | "//external/bouncycastle", |
| 604 | "//external/conscrypt", |
| 605 | "//external/icu/android_icu4j", |
| 606 | ], |
| 607 | libs: [ |
| 608 | // The intra core API stubs library. |
| 609 | "art.module.intra.core.api.stubs", |
| 610 | |
| 611 | // Additional classes needed by javac but which are not present in the stubs. |
| 612 | "art-module-intra-core-api-stubs-system-modules-lib", |
| 613 | ], |
| 614 | } |