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