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