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