| 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 { | 
| Jihoon Kang | 2391918 | 2024-11-06 20:47:11 +0000 | [diff] [blame] | 135 | name: "core-current-stubs-for-system-modules-exportable", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 136 | visibility: ["//development/sdk"], | 
|  | 137 | static_libs: [ | 
| Jihoon Kang | 2391918 | 2024-11-06 20:47:11 +0000 | [diff] [blame] | 138 | "core.current.stubs.exportable", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 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 |  | 
| Jihoon Kang | 2391918 | 2024-11-06 20:47:11 +0000 | [diff] [blame] | 158 | java_library { | 
|  | 159 | name: "core-current-stubs-for-system-modules", | 
|  | 160 | visibility: ["//development/sdk"], | 
|  | 161 | static_libs: [ | 
|  | 162 | "core.current.stubs", | 
|  | 163 | // This one is not on device but it's needed when javac compiles code | 
|  | 164 | // containing lambdas. | 
|  | 165 | "core-lambda-stubs-for-system-modules", | 
|  | 166 | ], | 
|  | 167 | sdk_version: "none", | 
|  | 168 | system_modules: "none", | 
|  | 169 | } | 
|  | 170 |  | 
| Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 171 | // Defaults module to strip out android annotations | 
|  | 172 | java_defaults { | 
|  | 173 | name: "system-modules-no-annotations", | 
|  | 174 | sdk_version: "none", | 
|  | 175 | system_modules: "none", | 
|  | 176 | jarjar_rules: "jarjar-strip-annotations-rules.txt", | 
|  | 177 | } | 
|  | 178 |  | 
| Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 179 | // Same as core-current-stubs-for-system-modules, but android annotations are | 
|  | 180 | // stripped. | 
|  | 181 | java_library { | 
|  | 182 | name: "core-current-stubs-for-system-modules-no-annotations", | 
|  | 183 | visibility: ["//development/sdk"], | 
| Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 184 | defaults: [ | 
|  | 185 | "system-modules-no-annotations", | 
|  | 186 | ], | 
| Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 187 | static_libs: [ | 
|  | 188 | "core-current-stubs-for-system-modules", | 
|  | 189 | ], | 
| Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 190 | dists: [ | 
|  | 191 | { | 
|  | 192 | // Legacy dist location for the public file. | 
|  | 193 | dest: "core-for-system-modules-no-annotations.jar", | 
|  | 194 | targets: dist_targets, | 
|  | 195 | }, | 
|  | 196 | { | 
|  | 197 | dest: "system-modules/public/core-for-system-modules-no-annotations.jar", | 
|  | 198 | targets: dist_targets, | 
|  | 199 | }, | 
|  | 200 | ], | 
| Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 201 | } | 
|  | 202 |  | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 203 | // Used when compiling higher-level code against core.current.stubs. | 
|  | 204 | java_system_modules { | 
| Paul Duffin | 10fb76f | 2021-11-03 16:53:31 +0000 | [diff] [blame] | 205 | name: "core-public-stubs-system-modules", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 206 | visibility: ["//visibility:public"], | 
|  | 207 | libs: [ | 
| Sorin Basca | bdbae60 | 2022-07-26 15:24:15 +0100 | [diff] [blame] | 208 | "core-current-stubs-for-system-modules-no-annotations", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 209 | ], | 
|  | 210 | } | 
|  | 211 |  | 
| Romain Jobredeaux | 9d54fda | 2023-07-28 10:32:50 -0400 | [diff] [blame] | 212 | java_defaults { | 
|  | 213 | name: "core.module_lib.stubs.defaults", | 
|  | 214 | visibility: ["//visibility:private"], | 
|  | 215 | sdk_version: "none", | 
|  | 216 | system_modules: "none", | 
|  | 217 | } | 
|  | 218 |  | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 219 | // A stubs target containing the parts of the public SDK & @SystemApi(MODULE_LIBRARIES) API | 
|  | 220 | // provided by the core libraries. | 
|  | 221 | // | 
|  | 222 | // Don't use this directly, use "sdk_version: module_current". | 
|  | 223 | java_library { | 
|  | 224 | name: "core.module_lib.stubs", | 
| Romain Jobredeaux | 9d54fda | 2023-07-28 10:32:50 -0400 | [diff] [blame] | 225 | defaults: [ | 
|  | 226 | "core.module_lib.stubs.defaults", | 
|  | 227 | ], | 
|  | 228 | static_libs: [ | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 229 | "art.module.public.api.stubs.module_lib", | 
|  | 230 |  | 
|  | 231 | // Replace the following with the module-lib correspondence when Conscrypt or i18N module | 
|  | 232 | // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides | 
|  | 233 | // @SystemApi(MODULE_LIBRARIES). | 
|  | 234 | "conscrypt.module.public.api.stubs", | 
|  | 235 | "i18n.module.public.api.stubs", | 
|  | 236 | ], | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 237 | } | 
|  | 238 |  | 
| Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 239 | // Produces a dist file that is used by the | 
|  | 240 | // prebuilts/sdk/update_prebuilts.py script to update the prebuilts/sdk | 
|  | 241 | // directory. | 
|  | 242 | java_library { | 
|  | 243 | name: "core-module-lib-stubs-for-system-modules", | 
|  | 244 | visibility: ["//visibility:private"], | 
|  | 245 | static_libs: [ | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 246 | "core.module_lib.stubs", | 
|  | 247 | // This one is not on device but it's needed when javac compiles code | 
|  | 248 | // containing lambdas. | 
|  | 249 | "core-lambda-stubs-for-system-modules", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 250 | ], | 
| Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 251 | sdk_version: "none", | 
|  | 252 | system_modules: "none", | 
|  | 253 | dist: { | 
|  | 254 | dest: "system-modules/module-lib/core-for-system-modules.jar", | 
|  | 255 | targets: dist_targets, | 
|  | 256 | }, | 
|  | 257 | } | 
|  | 258 |  | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 259 | // Same as core-module-lib-stubs-for-system-modules, but android annotations are | 
|  | 260 | // stripped. This is used by the Java toolchain, while the annotated stub is to | 
|  | 261 | // be used by Kotlin one. | 
|  | 262 | java_library { | 
|  | 263 | name: "core-module-lib-stubs-for-system-modules-no-annotations", | 
|  | 264 | visibility: ["//visibility:private"], | 
| Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 265 | defaults: [ | 
|  | 266 | "system-modules-no-annotations", | 
|  | 267 | ], | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 268 | static_libs: [ | 
|  | 269 | "core-module-lib-stubs-for-system-modules", | 
|  | 270 | ], | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 271 | dist: { | 
|  | 272 | dest: "system-modules/module-lib/core-for-system-modules-no-annotations.jar", | 
|  | 273 | targets: dist_targets, | 
|  | 274 | }, | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 275 | } | 
|  | 276 |  | 
| Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 277 | // Used when compiling higher-level code with sdk_version "module_current" | 
|  | 278 | java_system_modules { | 
|  | 279 | name: "core-module-lib-stubs-system-modules", | 
|  | 280 | libs: [ | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 281 | "core-module-lib-stubs-for-system-modules-no-annotations", | 
| Paul Duffin | bce9f08 | 2021-10-28 12:34:41 +0100 | [diff] [blame] | 282 | ], | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 283 | visibility: ["//visibility:public"], | 
|  | 284 | } | 
|  | 285 |  | 
|  | 286 | // Ideally this should be a restricted allowlist but there are hundreds of modules that depend on | 
|  | 287 | // this. | 
|  | 288 | // TODO(http://b/134561230) - limit the number of dependents on this. | 
|  | 289 | core_platform_visibility = ["//visibility:public"] | 
|  | 290 |  | 
|  | 291 | // Libraries containing the core platform API stubs for the core libraries. | 
|  | 292 | // | 
|  | 293 | // Although this stubs library is primarily used by the Java compiler / build to indicate | 
|  | 294 | // the core platform API surface area, compile_dex: true is used so that the Core Platform | 
|  | 295 | // API annotations are available to the dex tools that enable enforcement of runtime | 
|  | 296 | // accessibility. b/119068555 | 
|  | 297 | java_library { | 
| Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 298 | name: "legacy.core.platform.api.stubs", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 299 | visibility: core_platform_visibility, | 
| Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 300 | defaults: [ | 
|  | 301 | "core.platform.api.stubs.defaults", | 
|  | 302 | ], | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 303 | static_libs: [ | 
|  | 304 | "art.module.public.api.stubs.module_lib", | 
|  | 305 | "conscrypt.module.platform.api.stubs", | 
|  | 306 | "legacy.i18n.module.platform.api.stubs", | 
|  | 307 | ], | 
| Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 308 | } | 
|  | 309 |  | 
| Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 310 | java_library { | 
| Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 311 | name: "legacy.core.platform.api.stubs.exportable", | 
| Jihoon Kang | bd09345 | 2023-12-26 19:08:01 +0000 | [diff] [blame] | 312 | visibility: core_platform_visibility, | 
|  | 313 | defaults: [ | 
|  | 314 | "core.platform.api.stubs.defaults", | 
|  | 315 | ], | 
|  | 316 | static_libs: [ | 
|  | 317 | "art.module.public.api.stubs.exportable.module_lib", | 
|  | 318 | "conscrypt.module.platform.api.stubs.exportable", | 
|  | 319 | "legacy.i18n.module.platform.api.stubs.exportable", | 
|  | 320 | ], | 
|  | 321 | } | 
|  | 322 |  | 
| Jihoon Kang | b281ddc | 2023-08-17 18:14:35 +0000 | [diff] [blame] | 323 | java_defaults { | 
|  | 324 | name: "android_core_platform_stubs_current_contributions", | 
|  | 325 | api_surface: "core_platform", | 
|  | 326 | api_contributions: [ | 
|  | 327 | "art.module.public.api.stubs.source.api.contribution", | 
|  | 328 | "art.module.public.api.stubs.source.system.api.contribution", | 
|  | 329 | "art.module.public.api.stubs.source.module_lib.api.contribution", | 
|  | 330 | "conscrypt.module.platform.api.stubs.source.api.contribution", | 
|  | 331 | "i18n.module.public.api.stubs.source.api.contribution", | 
|  | 332 | ], | 
|  | 333 | } | 
|  | 334 |  | 
| Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 335 | java_defaults { | 
|  | 336 | name: "core.platform.api.stubs.defaults", | 
|  | 337 | hostdex: true, | 
|  | 338 | compile_dex: true, | 
|  | 339 |  | 
|  | 340 | sdk_version: "none", | 
|  | 341 | system_modules: "none", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 342 | patch_module: "java.base", | 
| Jihoon Kang | 85bc193 | 2024-07-01 17:04:46 +0000 | [diff] [blame] | 343 | is_stubs_module: true, | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 344 | } | 
|  | 345 |  | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 346 | // Same as legacy.core.platform.api.stubs, but android annotations are | 
|  | 347 | // stripped. This is used by the Java toolchain, while the annotated stub is to | 
|  | 348 | // be used by Kotlin one. | 
|  | 349 | java_library { | 
|  | 350 | name: "legacy.core.platform.api.no.annotations.stubs", | 
|  | 351 | visibility: core_platform_visibility, | 
| Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 352 | defaults: [ | 
|  | 353 | "system-modules-no-annotations", | 
|  | 354 | ], | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 355 | hostdex: true, | 
|  | 356 | compile_dex: true, | 
|  | 357 |  | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 358 | static_libs: [ | 
|  | 359 | "legacy.core.platform.api.stubs", | 
|  | 360 | ], | 
|  | 361 | patch_module: "java.base", | 
| Jihoon Kang | 85bc193 | 2024-07-01 17:04:46 +0000 | [diff] [blame] | 362 | is_stubs_module: true, | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 363 | } | 
|  | 364 |  | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 365 | java_library { | 
| Jihoon Kang | b0f4c02 | 2024-08-06 00:15:25 +0000 | [diff] [blame] | 366 | name: "stable.core.platform.api.stubs", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 367 | visibility: core_platform_visibility, | 
| Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 368 | defaults: [ | 
|  | 369 | "core.platform.api.stubs.defaults", | 
|  | 370 | ], | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 371 | static_libs: [ | 
|  | 372 | "art.module.public.api.stubs.module_lib", | 
|  | 373 | // conscrypt only has a stable version, so it is okay to depend on it here: | 
|  | 374 | "conscrypt.module.platform.api.stubs", | 
|  | 375 | "stable.i18n.module.platform.api.stubs", | 
|  | 376 | ], | 
| Jihoon Kang | 67b6443 | 2023-05-31 22:25:21 +0000 | [diff] [blame] | 377 | } | 
|  | 378 |  | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 379 | // Same as stable.core.platform.api.stubs, but android annotations are | 
|  | 380 | // stripped. This is used by the Java toolchain, while the annotated stub is to | 
|  | 381 | // be used by Kotlin one. | 
|  | 382 | java_library { | 
|  | 383 | name: "stable.core.platform.api.no.annotations.stubs", | 
|  | 384 | visibility: core_platform_visibility, | 
| Spandan Das | b0f3d42 | 2023-03-29 20:59:47 +0000 | [diff] [blame] | 385 | defaults: [ | 
|  | 386 | "system-modules-no-annotations", | 
|  | 387 | ], | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 388 | hostdex: true, | 
|  | 389 | compile_dex: true, | 
|  | 390 |  | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 391 | static_libs: [ | 
|  | 392 | "stable.core.platform.api.stubs", | 
|  | 393 | ], | 
|  | 394 | patch_module: "java.base", | 
| Jihoon Kang | 85bc193 | 2024-07-01 17:04:46 +0000 | [diff] [blame] | 395 | is_stubs_module: true, | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 396 | } | 
|  | 397 |  | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 398 | // Used when compiling higher-level code against *.core.platform.api.stubs. | 
|  | 399 | java_system_modules { | 
|  | 400 | name: "legacy-core-platform-api-stubs-system-modules", | 
|  | 401 | visibility: core_platform_visibility, | 
|  | 402 | libs: [ | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 403 | "legacy.core.platform.api.no.annotations.stubs", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 404 | // This one is not on device but it's needed when javac compiles code | 
|  | 405 | // containing lambdas. | 
|  | 406 | "core-lambda-stubs-for-system-modules", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 407 | ], | 
|  | 408 | } | 
|  | 409 |  | 
|  | 410 | java_system_modules { | 
|  | 411 | name: "stable-core-platform-api-stubs-system-modules", | 
|  | 412 | visibility: core_platform_visibility, | 
|  | 413 | libs: [ | 
| Sorin Basca | 69f4b08 | 2022-05-09 13:55:11 +0100 | [diff] [blame] | 414 | "stable.core.platform.api.no.annotations.stubs", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 415 | // This one is not on device but it's needed when javac compiles code | 
|  | 416 | // containing lambdas. | 
|  | 417 | "core-lambda-stubs-for-system-modules", | 
| Paul Duffin | bb360c3 | 2021-07-10 23:31:50 +0100 | [diff] [blame] | 418 | ], | 
|  | 419 | } | 
| Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 420 |  | 
|  | 421 | // Used when compiling higher-level code against art.module.public.api.stubs. | 
|  | 422 | // This abstraction should come from the inner tree linking against the stubs | 
|  | 423 | // and not from an "sdk", since parts of this abstraction do not belong to an | 
|  | 424 | // official API (e.g. stub-annotations). | 
|  | 425 | // | 
|  | 426 | // This is only intended for use within core libraries and must not be used | 
|  | 427 | // from outside. | 
|  | 428 | java_system_modules { | 
|  | 429 | name: "art-module-public-api-stubs-system-modules", | 
|  | 430 | visibility: [ | 
|  | 431 | "//art/build/sdk", | 
|  | 432 | "//external/conscrypt", | 
|  | 433 | "//external/icu/android_icu4j", | 
|  | 434 | "//external/wycheproof", | 
|  | 435 | ], | 
|  | 436 | libs: [ | 
|  | 437 | "art.module.public.api.stubs", | 
|  | 438 | // This one is not on device but it's needed when javac compiles code | 
|  | 439 | // containing lambdas. | 
|  | 440 | "core-lambda-stubs-for-system-modules", | 
| Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 441 |  | 
|  | 442 | // Ensure that core libraries that depend on the public API can access | 
|  | 443 | // the UnsupportedAppUsage, CorePlatformApi and IntraCoreApi | 
|  | 444 | // annotations. | 
|  | 445 | "art.module.api.annotations.for.system.modules", | 
| Spandan Das | fe85ca2 | 2022-12-08 02:42:25 +0000 | [diff] [blame] | 446 | ], | 
|  | 447 | } | 
|  | 448 |  | 
|  | 449 | // Used when compiling higher-level code against art.module.public.api.stubs.module_lib. | 
|  | 450 | // | 
|  | 451 | // This is only intended for use within core libraries and must not be used | 
|  | 452 | // from outside. | 
|  | 453 | java_system_modules { | 
|  | 454 | name: "art-module-lib-api-stubs-system-modules", | 
|  | 455 | visibility: [ | 
|  | 456 | "//art/build/sdk", | 
|  | 457 | "//external/conscrypt", | 
|  | 458 | "//external/icu/android_icu4j", | 
|  | 459 | ], | 
|  | 460 | libs: [ | 
|  | 461 | "art.module.public.api.stubs.module_lib", | 
|  | 462 | ], | 
|  | 463 | } | 
|  | 464 |  | 
|  | 465 | // Used when compiling against art.module.intra.core.api.stubs. | 
|  | 466 | java_system_modules { | 
|  | 467 | name: "art-module-intra-core-api-stubs-system-modules", | 
|  | 468 | visibility: [ | 
|  | 469 | "//art/build/sdk", | 
|  | 470 | "//external/bouncycastle", | 
|  | 471 | "//external/conscrypt", | 
|  | 472 | "//external/icu/android_icu4j", | 
|  | 473 | ], | 
|  | 474 | libs: [ | 
|  | 475 | // The intra core API stubs library. | 
|  | 476 | "art.module.intra.core.api.stubs", | 
|  | 477 |  | 
|  | 478 | // Additional classes needed by javac but which are not present in the stubs. | 
|  | 479 | "art-module-intra-core-api-stubs-system-modules-lib", | 
|  | 480 | ], | 
|  | 481 | } |