Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 1 | // Copyright (C) 2007 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 | // |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 16 | // Definitions for building the Android core library and associated tests. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 17 | // |
| 18 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 19 | // The Android core library provides low-level APIs for use by the rest of the |
| 20 | // Android software stack. It is made up of various parts, some of which can be |
| 21 | // found in libcore/ and other parts that can be found in various external/ |
Paul Duffin | fb46f73 | 2019-09-25 16:04:21 +0100 | [diff] [blame] | 22 | // directories. |
| 23 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 24 | // libcore has some sub-directories that follow a common structure: |
| 25 | // e.g. dalvik, dom, harmony-tests, json, jsr166-tests, luni, libart, ojluni, |
| 26 | // support, xml, xmlpull. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 27 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 28 | // The structure of these is generally: |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 29 | // |
| 30 | // src/ |
| 31 | // main/ # To be shipped on every device. |
| 32 | // java/ # Java source for library code. |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 33 | // native/ # C/C++ source for library code. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 34 | // resources/ # Support files. |
| 35 | // test/ # Built only on demand, for testing. |
| 36 | // java/ # Java source for tests. |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 37 | // native/ # C/C++ source for tests (rare). |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 38 | // resources/ # Support files. |
| 39 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 40 | // All subdirectories are optional. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 41 | |
| 42 | build = [ |
| 43 | "openjdk_java_files.bp", |
| 44 | "non_openjdk_java_files.bp", |
| 45 | ] |
| 46 | |
| 47 | // The Java files and their associated resources. |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 48 | filegroup { |
| 49 | name: "core-luni-resources", |
| 50 | visibility: [ |
| 51 | "//libcore:__subpackages__", |
| 52 | ], |
| 53 | path: "luni/src/main/java/", |
| 54 | srcs: [ |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 55 | "luni/src/main/java/java/util/logging/logging.properties", |
| 56 | "luni/src/main/java/java/security/security.properties", |
| 57 | ], |
| 58 | } |
| 59 | |
| 60 | filegroup { |
| 61 | name: "core-ojluni-resources", |
| 62 | visibility: [ |
| 63 | "//libcore:__subpackages__", |
| 64 | ], |
| 65 | path: "ojluni/src/main/resources/", |
| 66 | srcs: [ |
| 67 | "ojluni/src/main/resources/**/*", |
| 68 | ], |
| 69 | } |
| 70 | |
| 71 | core_resources = [ |
| 72 | ":core-luni-resources", |
| 73 | ":core-ojluni-resources", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 74 | ] |
| 75 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 76 | // The source files that go into core-oj. |
| 77 | filegroup { |
| 78 | name: "core_oj_java_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 79 | visibility: [ |
| 80 | "//libcore:__subpackages__", |
| 81 | ], |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 82 | srcs: [":openjdk_java_files"], |
| 83 | } |
| 84 | |
Sorin Basca | 8e85625 | 2021-08-16 17:38:00 +0000 | [diff] [blame] | 85 | // http://b/129765390, http://b/188966706 |
| 86 | // Rewrite links to "platform" or "technotes" folders which are siblings |
| 87 | // (and thus outside of) {@docRoot}. |
| 88 | // |
| 89 | // We have to escape \ as \\ and $ as $$ here because they get resolved by |
| 90 | // different layers of the build tooling. The arguments are wrapped in '' so |
| 91 | // that the shell doesn't add yet another level of escaping. |
Victor Chang | cf2cf85 | 2023-05-02 11:56:52 +0100 | [diff] [blame] | 92 | rewrite_openjdk_doc_links = "sed -E 's" + |
| 93 | "!(\\{@docRoot\\}/\\.\\./|[./]+)((platform|technotes).+)\">" + |
Sorin Basca | 121a1a9 | 2022-02-02 13:43:55 +0000 | [diff] [blame] | 94 | "!https://docs.oracle.com/javase/8/docs/\\2\">!' " + |
Victor Chang | ffa789a | 2023-04-26 16:02:56 +0100 | [diff] [blame] | 95 | "$(in) " + |
Victor Chang | cf2cf85 | 2023-05-02 11:56:52 +0100 | [diff] [blame] | 96 | "| sed -E 's" + // Android doesn't have java.base in the API docs |
| 97 | "!(\\{@docRoot\\}/)(java\\.base/)(.+)\">" + |
Victor Chang | ffa789a | 2023-04-26 16:02:56 +0100 | [diff] [blame] | 98 | "!\\1reference/\\3\">!' " + |
Victor Chang | cf2cf85 | 2023-05-02 11:56:52 +0100 | [diff] [blame] | 99 | "| sed -E 's" + |
| 100 | "!(\\{@docRoot\\}/\\.\\./)(specs/.+)\">" + |
Victor Chang | ffa789a | 2023-04-26 16:02:56 +0100 | [diff] [blame] | 101 | "!https://docs.oracle.com/en/java/javase/17/docs/\\2\">!' " + |
| 102 | " > $(out) " + |
| 103 | "&& ! grep '{@docRoot}/../' $(out)" // exit with 1 if "{@docRoot}/../" still exists. |
Sorin Basca | 8e85625 | 2021-08-16 17:38:00 +0000 | [diff] [blame] | 104 | |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 105 | // OpenJDK source is not annotated with @hide so we need this separate |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 106 | // filegroup for just the parts that contribute to the API. |
Sorin Basca | 8e85625 | 2021-08-16 17:38:00 +0000 | [diff] [blame] | 107 | gensrcs { |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 108 | name: "core_oj_api_files", |
Sorin Basca | 8e85625 | 2021-08-16 17:38:00 +0000 | [diff] [blame] | 109 | cmd: rewrite_openjdk_doc_links, |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 110 | srcs: [":openjdk_javadoc_files"], |
Sorin Basca | 8e85625 | 2021-08-16 17:38:00 +0000 | [diff] [blame] | 111 | output_extension: "java", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 112 | } |
| 113 | |
Miguel | 49d4f33 | 2022-02-16 11:10:24 +0000 | [diff] [blame] | 114 | // The source files that go into core-libart.l |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 115 | filegroup { |
| 116 | name: "core_libart_java_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 117 | visibility: [ |
| 118 | "//libcore:__subpackages__", |
| 119 | ], |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 120 | srcs: [ |
| 121 | ":non_openjdk_java_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 122 | ], |
| 123 | } |
| 124 | |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 125 | // Some parts of libart are not annotated with @hide so we need this separate |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 126 | // filegroup for just the parts that contribute to the API. |
| 127 | filegroup { |
| 128 | name: "core_libart_api_files", |
| 129 | srcs: [ |
| 130 | ":non_openjdk_javadoc_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 131 | ], |
| 132 | } |
| 133 | |
Paul Duffin | a38da2d | 2019-10-01 17:49:50 +0100 | [diff] [blame] | 134 | // The set of files for the ART module that contribute to one or more API |
| 135 | // surfaces. This includes files that are in the public API as well as those |
| 136 | // that are not but which have been marked up with @hide plus one or more of |
| 137 | // the API defining annotations. |
| 138 | // |
| 139 | // Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are |
| 140 | // annotated by applying annotations to the .annotated.java stubs files in |
| 141 | // ojluni/annotated/mmodules and rather than in the original source. See the comments |
| 142 | // in openjdk_java_files.bp for more details. |
| 143 | filegroup { |
| 144 | name: "art_module_api_files", |
| 145 | visibility: [ |
| 146 | "//libcore:__subpackages__", |
| 147 | ], |
| 148 | srcs: [ |
Neil Fuller | d129bc9 | 2018-09-26 11:12:58 +0100 | [diff] [blame] | 149 | ":apache-xml_api_files", |
Neil Fuller | a77f710 | 2018-09-21 19:04:41 +0100 | [diff] [blame] | 150 | ":bouncycastle_java_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 151 | ":core_oj_api_files", |
| 152 | ":core_libart_api_files", |
Neil Fuller | 641d5f9 | 2018-09-24 15:40:39 +0100 | [diff] [blame] | 153 | ":okhttp_api_files", |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 154 | ":openjdk_mmodule_extra_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 155 | ], |
| 156 | } |
| 157 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 158 | java_defaults { |
| 159 | name: "libcore_java_defaults", |
Orion Hodson | 9e54acd | 2022-10-27 12:55:56 +0100 | [diff] [blame] | 160 | visibility: [ |
| 161 | "//libcore:__subpackages__", |
| 162 | ], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 163 | javacflags: [ |
| 164 | //"-Xlint:all", |
| 165 | //"-Xlint:-serial,-deprecation,-unchecked", |
| 166 | ], |
Orion Hodson | cac55ff | 2022-09-09 13:58:18 +0100 | [diff] [blame] | 167 | dxflags: [ |
| 168 | "--android-platform-build", |
| 169 | "--core-library", |
| 170 | ], |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 171 | errorprone: { |
| 172 | javacflags: [ |
Paul Duffin | c31f6bb | 2019-05-15 12:32:44 +0100 | [diff] [blame] | 173 | "-Xep:MissingOverride:OFF", // Ignore missing @Override. |
| 174 | "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom |
Cole Faust | 821863d | 2022-02-03 14:59:40 -0800 | [diff] [blame] | 175 | "-Xep:UnicodeInCode:WARN", // XML parser uses line feeds in whitespace |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 176 | "-Xep:ReturnValueIgnored:WARN", |
| 177 | "-Xep:HashtableContains:WARN", |
| 178 | "-Xep:ComparableType:WARN", |
| 179 | "-Xep:IdentityBinaryExpression:WARN", |
| 180 | "-Xep:BoxedPrimitiveEquality:WARN", |
| 181 | "-Xep:EmptyTopLevelDeclaration:WARN", |
| 182 | "-Xep:GetClassOnClass:WARN", |
| 183 | "-Xep:NullableOnContainingClass:WARN", |
| 184 | "-Xep:GetClassOnAnnotation:WARN", |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 185 | ], |
| 186 | }, |
Cole Faust | 38f6165 | 2022-06-28 14:23:13 -0700 | [diff] [blame] | 187 | lint: { |
Orion Hodson | 195a8b2 | 2022-08-15 20:25:00 +0100 | [diff] [blame] | 188 | warning_checks: [ |
| 189 | "SuspiciousIndentation", |
| 190 | "NewApi", |
| 191 | ], |
Cole Faust | 38f6165 | 2022-06-28 14:23:13 -0700 | [diff] [blame] | 192 | }, |
Nicolas Geoffray | 83f4730 | 2021-03-03 22:00:47 +0000 | [diff] [blame] | 193 | min_sdk_version: "31", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | // |
| 197 | // Build for the target (device). |
| 198 | // |
| 199 | |
Tobias Thierer | 5233164 | 2019-05-29 12:11:39 +0000 | [diff] [blame] | 200 | // A target used to bootstrap compilation for the core library. |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 201 | // |
Tobias Thierer | 5233164 | 2019-05-29 12:11:39 +0000 | [diff] [blame] | 202 | // See core-all-system-modules for more details. |
| 203 | java_library { |
| 204 | name: "core-all", |
Tobias Thierer | 5233164 | 2019-05-29 12:11:39 +0000 | [diff] [blame] | 205 | defaults: ["libcore_java_defaults"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 206 | |
| 207 | srcs: [ |
Paul Duffin | f975b71 | 2019-10-02 12:37:38 +0100 | [diff] [blame] | 208 | // Use the source code for the I18N module intra core API as using the |
| 209 | // compiled version does not work due to limitations in either soong or the javac |
| 210 | // toolchain. See http://b/142056316 for more details. |
Nicolas Geoffray | 1bb65aa | 2020-06-03 14:41:07 +0100 | [diff] [blame] | 211 | ":i18n.module.intra.core.api{.public.stubs.source}", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 212 | ":core_oj_java_files", |
| 213 | ":core_libart_java_files", |
Victor Chang | 0cd67fb | 2021-05-12 10:35:00 +0100 | [diff] [blame] | 214 | // framework-api-annotations contain API annotations, e.g. @SystemApi. |
| 215 | ":framework-api-annotations", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 216 | ":openjdk_lambda_stub_files", |
atrost | 69474bb | 2019-11-04 17:06:25 +0000 | [diff] [blame] | 217 | ":app-compat-annotations-source", |
paulhu | 4a7a945 | 2021-03-15 16:51:19 +0800 | [diff] [blame] | 218 | |
| 219 | // Use the okhttp source too to allow libcore code to reference it |
| 220 | // directly. |
| 221 | ":okhttp_impl_files", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 222 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 223 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 224 | sdk_version: "none", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 225 | system_modules: "none", |
Paul Duffin | 1d7d4a7 | 2019-10-10 18:15:01 +0100 | [diff] [blame] | 226 | patch_module: "java.base", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 227 | openjdk9: { |
| 228 | srcs: ["luni/src/module/java/module-info.java"], |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 229 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 230 | |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 231 | java_resources: core_resources, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 232 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 233 | installable: false, |
atrost | 98ec08d | 2019-08-05 12:23:41 +0100 | [diff] [blame] | 234 | |
Artur Satayev | a09cba0 | 2020-02-19 16:43:32 +0000 | [diff] [blame] | 235 | plugins: [ |
| 236 | "compat-changeid-annotation-processor", |
| 237 | "unsupportedappusage-annotation-processor", |
| 238 | ], |
paulhu | 4a7a945 | 2021-03-15 16:51:19 +0800 | [diff] [blame] | 239 | libs: [ |
| 240 | "conscrypt.module.intra.core.api", |
| 241 | ], |
atrost | 98ec08d | 2019-08-05 12:23:41 +0100 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | platform_compat_config { |
| 245 | name: "libcore-platform-compat-config", |
atrost | 98ec08d | 2019-08-05 12:23:41 +0100 | [diff] [blame] | 246 | src: ":core-all", |
Paul Duffin | 9026240 | 2021-03-19 15:14:09 +0000 | [diff] [blame] | 247 | visibility: [ |
| 248 | "//art/build/apex", |
| 249 | "//art/build/sdk", |
| 250 | ], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 251 | } |
| 252 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 253 | // A system modules definition for use by core library targets only. It only |
| 254 | // contains the core-all jar, which contains the classes that end up in core-oj, |
| 255 | // core-libart as well as the lambda stubs needed to compile Java lambda code. |
| 256 | // It does not contain other parts of core library like conscrypt, bouncycastle, |
| 257 | // etc. This system_modules definition is used to bootstrap compilation for |
Paul Duffin | 00b174e | 2019-09-26 16:22:17 +0100 | [diff] [blame] | 258 | // other parts of the core library like core-oj, core-libart, conscrypt, |
Roland Levillain | 6dad3e2 | 2020-08-20 20:30:16 +0100 | [diff] [blame] | 259 | // bouncycastle, etc. It is also used to compile Libcore tests, as well as ART |
| 260 | // Java tests (run-tests). |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 261 | java_system_modules { |
| 262 | name: "core-all-system-modules", |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 263 | |
| 264 | // Visibility is deliberately restricted to a small set of build modules that |
| 265 | // the core library team control. |
| 266 | visibility: [ |
Roland Levillain | efa963d | 2020-02-13 15:44:43 +0000 | [diff] [blame] | 267 | "//art/test:__subpackages__", |
Jihoon Kang | 6fbe999 | 2024-02-13 06:37:03 +0000 | [diff] [blame] | 268 | "//build/make/tools/aconfig/fake_device_config", |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 269 | "//external/apache-harmony:__subpackages__", |
| 270 | "//external/apache-xml", |
Jihoon Kang | 6fbe999 | 2024-02-13 06:37:03 +0000 | [diff] [blame] | 271 | "//external/icu", |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 272 | "//external/okhttp", |
Jihoon Kang | 6fbe999 | 2024-02-13 06:37:03 +0000 | [diff] [blame] | 273 | "//frameworks/libs/modules-utils/java", |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 274 | "//libcore:__subpackages__", |
Jihoon Kang | 6fbe999 | 2024-02-13 06:37:03 +0000 | [diff] [blame] | 275 | "//tools/platform-compat/java/android/compat/annotation", |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 276 | ], |
| 277 | |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 278 | libs: ["core-all"], |
| 279 | } |
| 280 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 281 | // Contains the parts of core library associated with OpenJDK. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 282 | java_library { |
| 283 | name: "core-oj", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 284 | visibility: [ |
| 285 | "//art/build/apex", |
Martin Stjernholm | 6b50f8f | 2020-12-17 18:03:21 +0000 | [diff] [blame] | 286 | "//art/build/sdk", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 287 | "//external/wycheproof", |
Paul Duffin | 94f7023 | 2019-05-22 16:22:29 +0100 | [diff] [blame] | 288 | "//libcore/benchmarks", |
Martin Stjernholm | 6b50f8f | 2020-12-17 18:03:21 +0000 | [diff] [blame] | 289 | "//packages/modules/ArtPrebuilt", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 290 | ], |
Jiyong Park | b916cac | 2019-12-19 02:12:09 +0000 | [diff] [blame] | 291 | apex_available: [ |
Martin Stjernholm | fe8feb6 | 2020-10-12 15:11:14 +0100 | [diff] [blame] | 292 | "com.android.art", |
Jiyong Park | b916cac | 2019-12-19 02:12:09 +0000 | [diff] [blame] | 293 | "com.android.art.debug", |
| 294 | ], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 295 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 296 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 297 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 298 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 299 | srcs: [":core_oj_java_files"], |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 300 | java_resources: core_resources, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 301 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 302 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 303 | system_modules: "core-all-system-modules", |
Paul Duffin | 1d7d4a7 | 2019-10-10 18:15:01 +0100 | [diff] [blame] | 304 | patch_module: "java.base", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 305 | |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 306 | jacoco: { |
Pete Gillin | 27ca058 | 2018-01-10 17:04:17 +0000 | [diff] [blame] | 307 | exclude_filter: [ |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 308 | "java.lang.Class", |
| 309 | "java.lang.Long", |
| 310 | "java.lang.Number", |
| 311 | "java.lang.Object", |
| 312 | "java.lang.String", |
| 313 | "java.lang.invoke.MethodHandle", |
Orion Hodson | 650aa36 | 2021-11-15 09:29:51 +0000 | [diff] [blame] | 314 | "java.lang.invoke.VarHandle", |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 315 | "java.lang.ref.Reference", |
| 316 | "java.lang.reflect.Proxy", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 317 | "java.util.AbstractMap", |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 318 | "java.util.HashMap", |
| 319 | "java.util.HashMap$Node", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 320 | "java.util.Map", |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 321 | ], |
| 322 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 323 | |
Paul Duffin | b51fc6f | 2021-01-26 14:59:17 +0000 | [diff] [blame] | 324 | hiddenapi_additional_annotations: [ |
| 325 | "core-oj-hiddenapi-annotations", |
| 326 | ], |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 327 | |
| 328 | errorprone: { |
| 329 | javacflags: [ |
| 330 | "-Xep:ReturnValueIgnored:WARN", |
| 331 | "-Xep:HashtableContains:WARN", |
| 332 | "-Xep:ComparableType:WARN", |
| 333 | "-Xep:IdentityBinaryExpression:WARN", |
| 334 | "-Xep:BoxedPrimitiveEquality:WARN", |
| 335 | "-Xep:EmptyTopLevelDeclaration:WARN", |
| 336 | "-Xep:GetClassOnClass:WARN", |
| 337 | ], |
| 338 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 339 | } |
| 340 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 341 | // Contains parts of core library not associated with OpenJDK. Contains not |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 342 | // just java.*, javax.* code but also android.system.* and various internal |
| 343 | // libcore.* packages. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 344 | java_library { |
| 345 | name: "core-libart", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 346 | visibility: [ |
| 347 | "//art/build/apex", |
Paul Duffin | 8d01a55 | 2020-03-25 12:02:54 +0000 | [diff] [blame] | 348 | "//art/build/sdk", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 349 | "//external/wycheproof", |
Paul Duffin | 94f7023 | 2019-05-22 16:22:29 +0100 | [diff] [blame] | 350 | "//libcore/benchmarks", |
Martin Stjernholm | 6b50f8f | 2020-12-17 18:03:21 +0000 | [diff] [blame] | 351 | "//packages/modules/ArtPrebuilt", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 352 | ], |
Jiyong Park | b916cac | 2019-12-19 02:12:09 +0000 | [diff] [blame] | 353 | apex_available: [ |
Martin Stjernholm | fe8feb6 | 2020-10-12 15:11:14 +0100 | [diff] [blame] | 354 | "com.android.art", |
Jiyong Park | b916cac | 2019-12-19 02:12:09 +0000 | [diff] [blame] | 355 | "com.android.art.debug", |
| 356 | ], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 357 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 358 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 359 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 360 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 361 | srcs: [":core_libart_java_files"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 362 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 363 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 364 | system_modules: "core-all-system-modules", |
Paul Duffin | 1d7d4a7 | 2019-10-10 18:15:01 +0100 | [diff] [blame] | 365 | patch_module: "java.base", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 366 | |
Pete Gillin | 80ebe87 | 2018-02-13 15:21:20 +0000 | [diff] [blame] | 367 | jacoco: { |
| 368 | exclude_filter: [ |
| 369 | "java.lang.DexCache", |
| 370 | "dalvik.system.ClassExt", |
| 371 | ], |
| 372 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 373 | |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 374 | target: { |
| 375 | hostdex: { |
| 376 | required: [ |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 377 | // Files used to simulate the /system, runtime APEX and tzdata |
| 378 | // APEX dir structure on host. |
| 379 | "icu_tzdata.dat_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 380 | "tzdata_host", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 381 | "tzdata_host_tzdata_apex", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 382 | "tzlookup.xml_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 383 | "tz_version_host", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 384 | "tz_version_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 385 | ], |
| 386 | }, |
Yo Chiang | 119e3e1 | 2020-08-07 04:22:18 +0000 | [diff] [blame] | 387 | darwin: { |
| 388 | enabled: false, |
| 389 | }, |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 390 | }, |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 391 | |
| 392 | errorprone: { |
| 393 | javacflags: [ |
| 394 | "-Xep:EmptyTopLevelDeclaration:WARN", |
| 395 | "-Xep:GetClassOnAnnotation:WARN", |
| 396 | "-Xep:NullableOnContainingClass:WARN", |
| 397 | ], |
| 398 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 399 | } |
| 400 | |
Paul Duffin | 816daae | 2021-04-19 17:19:56 +0100 | [diff] [blame] | 401 | // Java library for use on host, e.g. by robolectric or layoutlib. |
| 402 | java_library { |
| 403 | name: "core-libart-for-host", |
| 404 | visibility: [ |
| 405 | "//art/build/sdk", |
Rex Hoffman | 2e79b4c | 2022-08-25 23:22:23 +0000 | [diff] [blame] | 406 | "//external/robolectric", |
Paul Duffin | 816daae | 2021-04-19 17:19:56 +0100 | [diff] [blame] | 407 | "//external/robolectric-shadows", |
Jeff Sharkey | 99f98c7 | 2024-01-11 20:23:14 +0000 | [diff] [blame] | 408 | "//frameworks/base", |
Paul Duffin | 816daae | 2021-04-19 17:19:56 +0100 | [diff] [blame] | 409 | "//frameworks/layoutlib", |
| 410 | ], |
| 411 | static_libs: [ |
| 412 | "core-libart", |
| 413 | ], |
| 414 | sdk_version: "none", |
| 415 | system_modules: "none", |
| 416 | } |
| 417 | |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 418 | // Provided solely to contribute information about which hidden parts of the |
| 419 | // core-oj API are used by apps. |
Paul Duffin | c6bf27b | 2019-05-15 14:41:00 +0100 | [diff] [blame] | 420 | // |
Paul Duffin | c6bf27b | 2019-05-15 14:41:00 +0100 | [diff] [blame] | 421 | // Usually, e.g. for core-libart, the UnsupportedAppUsage annotations are |
| 422 | // added to the source that is compiled directly into the bootjar and the build |
| 423 | // system extracts the information about UnsupportedAppUsage directly from |
| 424 | // there. |
| 425 | // |
| 426 | // This approach of having separate annotated source and a separate build |
| 427 | // target was taken for ojluni to avoid having to maintain local patches in the |
| 428 | // ojluni source for UnsupportedAppUsage annotations as that would make it more |
| 429 | // difficult to pull down changes from upstream. |
| 430 | // |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 431 | java_library { |
Paul Duffin | b51fc6f | 2021-01-26 14:59:17 +0000 | [diff] [blame] | 432 | name: "core-oj-hiddenapi-annotations", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 433 | // Do not allow this to be accessed from outside this directory. |
Orion Hodson | 9e54acd | 2022-10-27 12:55:56 +0100 | [diff] [blame] | 434 | visibility: ["//libcore:__subpackages__"], |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 435 | defaults: ["libcore_java_defaults"], |
| 436 | compile_dex: true, |
| 437 | |
| 438 | srcs: [":openjdk_hiddenapi_javadoc_files"], |
| 439 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 440 | sdk_version: "none", |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 441 | system_modules: "core-all-system-modules", |
Paul Duffin | 1d7d4a7 | 2019-10-10 18:15:01 +0100 | [diff] [blame] | 442 | patch_module: "java.base", |
Artur Satayev | a09cba0 | 2020-02-19 16:43:32 +0000 | [diff] [blame] | 443 | plugins: ["unsupportedappusage-annotation-processor"], |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 444 | |
| 445 | errorprone: { |
| 446 | javacflags: [ |
| 447 | "-Xep:ComparableType:WARN", |
| 448 | ], |
| 449 | }, |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 450 | } |
| 451 | |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 452 | java_defaults { |
| 453 | name: "core_lambda_stubs_defaults", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 454 | defaults: ["libcore_java_defaults"], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 455 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 456 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 457 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 458 | system_modules: "core-all-system-modules", |
Paul Duffin | 1d7d4a7 | 2019-10-10 18:15:01 +0100 | [diff] [blame] | 459 | patch_module: "java.base", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 460 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 461 | installable: false, |
| 462 | include_srcs: true, |
| 463 | } |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 464 | |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 465 | // Creates a jar that exists to satisfy javac when compiling source code that |
| 466 | // contains lambdas. This contains all classes / methods required by javac |
| 467 | // when generating invoke-dynamic lambda implementation code, even those that |
| 468 | // are also in the public SDK API from API level 26 onwards. |
| 469 | java_library { |
| 470 | name: "core-lambda-stubs", |
Jihoon Kang | 9188d1a | 2023-06-14 23:03:38 +0000 | [diff] [blame] | 471 | visibility: [ |
Jihoon Kang | 4f6d56d | 2023-11-01 22:42:46 +0000 | [diff] [blame] | 472 | "//visibility:public", |
Jihoon Kang | 9188d1a | 2023-06-14 23:03:38 +0000 | [diff] [blame] | 473 | ], |
| 474 | defaults: ["core_lambda_stubs_defaults"], |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 475 | srcs: [ |
| 476 | ":openjdk_lambda_stub_files", |
| 477 | ":openjdk_lambda_duplicate_stub_files", |
| 478 | ], |
Colin Cross | dafdf70 | 2020-07-30 11:30:11 -0700 | [diff] [blame] | 479 | // This jar is packaged as part of the SDK, use -target 8 so that it works |
| 480 | // with old JDKs. |
| 481 | java_version: "1.8", |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 482 | } |
| 483 | |
| 484 | // An alternative to core-lambda-stubs that omits openjdk_lambda_duplicate_stub_files |
| 485 | // because those classes are also part of the core library public SDK API |
| 486 | // (since API level 26). |
| 487 | java_library { |
| 488 | name: "core-lambda-stubs-for-system-modules", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 489 | visibility: [ |
Paul Duffin | 882c7ba | 2021-07-10 23:28:13 +0100 | [diff] [blame] | 490 | "//art/build/sdk", |
| 491 | "//build/soong/java/core-libraries", |
Colin Cross | 46beebf | 2022-11-10 14:21:06 -0800 | [diff] [blame] | 492 | "//frameworks/base", |
Anton Hansson | 8c5fd9b | 2023-03-03 17:29:24 +0000 | [diff] [blame] | 493 | "//frameworks/base/api", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 494 | ], |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 495 | defaults: ["core_lambda_stubs_defaults"], |
| 496 | srcs: [ |
| 497 | ":openjdk_lambda_stub_files", |
| 498 | ], |
Colin Cross | dc66334 | 2020-04-17 18:16:31 -0700 | [diff] [blame] | 499 | include_srcs: true, |
Sorin Basca | 1656ca5 | 2023-05-16 15:24:53 +0100 | [diff] [blame] | 500 | // This jar is packaged as part of the SDK, use -target 8 so that it works |
| 501 | // with old JDKs. |
| 502 | java_version: "1.8", |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 503 | } |
| 504 | |
Spandan Das | 711652d | 2022-12-28 22:24:40 +0000 | [diff] [blame] | 505 | // This is an empty jar that exists for backwards compatibility with T (and below). |
| 506 | // Historically, it existed to satisfy javac when compiling source code that |
| 507 | // contains @Generated annotations. |
| 508 | // This is no longer necessary since @Generated was added to ART's Public API |
| 509 | // surface in U. |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 510 | java_library { |
| 511 | name: "core-generated-annotation-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 512 | visibility: [ |
Paul Duffin | 882c7ba | 2021-07-10 23:28:13 +0100 | [diff] [blame] | 513 | "//art/build/sdk", |
| 514 | "//build/soong/java/core-libraries", |
Colin Cross | 46beebf | 2022-11-10 14:21:06 -0800 | [diff] [blame] | 515 | "//frameworks/base", |
Anton Hansson | 8c5fd9b | 2023-03-03 17:29:24 +0000 | [diff] [blame] | 516 | "//frameworks/base/api", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 517 | ], |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 518 | defaults: ["libcore_java_defaults"], |
| 519 | srcs: [ |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 520 | ], |
| 521 | hostdex: true, |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 522 | sdk_version: "none", |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 523 | system_modules: "core-all-system-modules", |
Paul Duffin | 1d7d4a7 | 2019-10-10 18:15:01 +0100 | [diff] [blame] | 524 | patch_module: "java.base", |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 525 | installable: false, |
| 526 | include_srcs: true, |
Sorin Basca | c90e1e7 | 2023-06-02 11:13:31 +0000 | [diff] [blame] | 527 | // This jar is packaged as part of the SDK, use -target 8 so that it works |
| 528 | // with old JDKs. |
| 529 | java_version: "1.8", |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 530 | } |
| 531 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 532 | // Builds libcore test rules |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 533 | java_library_static { |
| 534 | name: "core-test-rules", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 535 | visibility: [ |
Paul Duffin | 86abe9e | 2020-01-16 16:55:36 +0000 | [diff] [blame] | 536 | "//art/build/sdk", |
Victor Chang | 31e0d0d | 2023-06-16 16:17:34 +0100 | [diff] [blame] | 537 | "//cts/tests/core/runner-axt", |
Baligh Uddin | e7098da | 2020-12-23 18:17:44 +0000 | [diff] [blame] | 538 | "//cts/tests/tests/util", |
Paul Duffin | 01f6c02 | 2019-09-24 14:44:15 +0100 | [diff] [blame] | 539 | "//external/conscrypt", |
Daulet Zhanguzin | c6789a3 | 2020-03-19 20:30:59 +0000 | [diff] [blame] | 540 | "//external/conscrypt/apex/tests", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 541 | "//frameworks/base/location/tests/locationtests", |
David Su | 76713fc | 2019-12-06 16:33:09 -0800 | [diff] [blame] | 542 | "//frameworks/base/core/tests/coretests", |
David Su | 5355a77 | 2019-12-18 16:11:17 -0800 | [diff] [blame] | 543 | "//frameworks/base/wifi/tests", |
Victor Chang | 31e0d0d | 2023-06-16 16:17:34 +0100 | [diff] [blame] | 544 | "//libcore/ojluni/src/test", |
Sorin Basca | 676774c | 2022-01-17 13:35:42 +0000 | [diff] [blame] | 545 | "//libcore/luni/src/test/java9compatibility", |
Baligh Uddin | e7098da | 2020-12-23 18:17:44 +0000 | [diff] [blame] | 546 | "//packages/modules/Wifi/framework/tests", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 547 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 548 | hostdex: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 549 | srcs: [ |
| 550 | "dalvik/test-rules/src/main/**/*.java", |
| 551 | "test-rules/src/main/**/*.java", |
| 552 | ], |
Victor Chang | 31e0d0d | 2023-06-16 16:17:34 +0100 | [diff] [blame] | 553 | static_libs: [ |
| 554 | "junit", |
| 555 | "platform-test-annotations", |
| 556 | ], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 557 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 558 | sdk_version: "none", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 559 | system_modules: "core-all-system-modules", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 560 | } |
| 561 | |
Andrei Onea | e439225 | 2019-09-03 11:54:14 +0100 | [diff] [blame] | 562 | // Builds platform_compat test rules |
| 563 | java_library_static { |
Andrei Onea | 2829b54 | 2019-11-18 14:24:53 +0000 | [diff] [blame] | 564 | name: "core-compat-test-rules", |
| 565 | visibility: [ |
Paul Duffin | 86abe9e | 2020-01-16 16:55:36 +0000 | [diff] [blame] | 566 | "//art/build/sdk", |
Andrei Onea | 2829b54 | 2019-11-18 14:24:53 +0000 | [diff] [blame] | 567 | "//frameworks/base/tests/PlatformCompatGating/test-rules", |
| 568 | ], |
Andrei Onea | e439225 | 2019-09-03 11:54:14 +0100 | [diff] [blame] | 569 | srcs: [ |
| 570 | "luni/src/main/java/android/compat/**/*.java", |
| 571 | "test-rules/src/platform_compat/**/*.java", |
| 572 | "luni/src/main/java/libcore/api/CorePlatformApi.java", |
| 573 | "luni/src/main/java/libcore/api/IntraCoreApi.java", |
Andrei Onea | e439225 | 2019-09-03 11:54:14 +0100 | [diff] [blame] | 574 | ], |
| 575 | static_libs: [ |
| 576 | "junit", |
| 577 | "guava", |
Andrei Onea | e439225 | 2019-09-03 11:54:14 +0100 | [diff] [blame] | 578 | ], |
Andrei Onea | 2829b54 | 2019-11-18 14:24:53 +0000 | [diff] [blame] | 579 | sdk_version: "none", |
| 580 | system_modules: "core-all-system-modules", |
Pete Gillin | 7fb42bb | 2019-10-14 11:36:45 +0100 | [diff] [blame] | 581 | // This builds classes that are in the java.base Java module: |
| 582 | patch_module: "java.base", |
Andrei Onea | 2829b54 | 2019-11-18 14:24:53 +0000 | [diff] [blame] | 583 | hostdex: true, |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 584 | |
| 585 | errorprone: { |
| 586 | javacflags: [ |
| 587 | "-Xep:EmptyTopLevelDeclaration:WARN", |
| 588 | "-Xep:GetClassOnAnnotation:WARN", |
| 589 | ], |
| 590 | }, |
Andrei Onea | e439225 | 2019-09-03 11:54:14 +0100 | [diff] [blame] | 591 | } |
| 592 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 593 | // Builds the core-tests-support library used by various tests. |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 594 | java_library_static { |
| 595 | name: "core-tests-support", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 596 | visibility: [ |
Paul Duffin | 86abe9e | 2020-01-16 16:55:36 +0000 | [diff] [blame] | 597 | "//art/build/sdk", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 598 | "//cts/apps/CtsVerifier", |
| 599 | "//cts/tests/tests/keystore", |
| 600 | "//cts/tests/tests/net", |
Miguel | 4d6bbd3 | 2022-05-10 16:59:50 +0000 | [diff] [blame] | 601 | "//cts/hostsidetests/statsdatom/apps/statsdapp", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 602 | "//cts/tests/tests/net/api23Test", |
| 603 | "//external/apache-harmony", |
| 604 | "//frameworks/base/core/tests/coretests", |
Miguel | c5467c3 | 2022-06-10 11:49:11 +0000 | [diff] [blame] | 605 | "//frameworks/base/apct-tests/perftests/core", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 606 | "//libcore/benchmarks", |
| 607 | "//packages/apps/KeyChain/tests", |
| 608 | "//system/timezone/distro/core", |
Remi NGUYEN VAN | ff86d7b | 2021-06-08 10:22:57 +0900 | [diff] [blame] | 609 | "//packages/modules/Connectivity/tests:__subpackages__", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 610 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 611 | hostdex: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 612 | srcs: ["support/src/test/java/**/*.java"], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 613 | |
Paul Duffin | 53c491f | 2019-06-12 13:48:14 +0100 | [diff] [blame] | 614 | sdk_version: "core_platform", |
Paul Duffin | 602d2f4 | 2022-08-23 12:57:15 +0000 | [diff] [blame] | 615 | // Make sure that this will be added to the sdk snapshot for S. |
| 616 | min_sdk_version: "S", |
Neil Fuller | 4380ab2 | 2018-10-18 19:38:53 +0100 | [diff] [blame] | 617 | libs: ["junit"], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 618 | static_libs: [ |
Neil Fuller | de8b086 | 2018-10-12 21:53:31 +0100 | [diff] [blame] | 619 | "bouncycastle-unbundled", |
| 620 | "bouncycastle-bcpkix-unbundled", |
| 621 | "bouncycastle-ocsp-unbundled", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 622 | ], |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 623 | errorprone: { |
| 624 | javacflags: [ |
| 625 | "-Xep:BoxedPrimitiveEquality:WARN", |
| 626 | ], |
| 627 | }, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 628 | } |
| 629 | |
Victor Chang | 6efc82c | 2022-07-29 16:49:17 +0100 | [diff] [blame] | 630 | // Used to generate the prebuilt file luni/src/test/resources/prebuilt-dex-from-java.dex. |
| 631 | // The reason why we pre-build this dex file is to stabilize the test result from the |
| 632 | // dexer / javac / other toolchains change. |
| 633 | // Regenerate the prebuilt file with the following command: |
| 634 | // m core-tests-prebuilt-dex-from-java && |
| 635 | // unzip out/soong/.intermediates/libcore/core-tests-prebuilt-dex-from-java/android_common/dex/core-tests-prebuilt-dex-from-java.jar classes.dex \ |
| 636 | // -d libcore/luni/src/test/resources/ && mv libcore/luni/src/test/resources/classes.dex libcore/luni/src/test/resources/prebuilt-dex-from-java.dex |
| 637 | java_test { |
| 638 | name: "core-tests-prebuilt-dex-from-java", |
| 639 | srcs: ["luni/src/test/dex_src/**/*.java"], |
| 640 | compile_dex: true, |
| 641 | defaults: ["libcore_java_defaults"], |
| 642 | sdk_version: "none", |
| 643 | system_modules: "core-all-system-modules", |
| 644 | |
| 645 | visibility: [ |
| 646 | "//libcore:__subpackages__", |
| 647 | ], |
| 648 | } |
| 649 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 650 | // Builds the jsr166-tests library. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 651 | java_test { |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 652 | name: "jsr166-tests", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 653 | visibility: [ |
Paul Duffin | 8d01a55 | 2020-03-25 12:02:54 +0000 | [diff] [blame] | 654 | "//art/build/sdk", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 655 | "//cts/tests/libcore/jsr166", |
| 656 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 657 | srcs: ["jsr166-tests/src/test/java/**/*.java"], |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 658 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 659 | system_modules: "core-all-system-modules", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 660 | libs: [ |
| 661 | "junit", |
| 662 | ], |
Cole Faust | 18d939a | 2021-11-23 11:37:22 -0800 | [diff] [blame] | 663 | errorprone: { |
| 664 | javacflags: [ |
| 665 | "-Xep:DoNotCall:OFF", |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 666 | "-Xep:ModifyingCollectionWithItself:WARN", |
| 667 | "-Xep:ReturnValueIgnored:WARN", |
| 668 | "-Xep:HashtableContains:WARN", |
Cole Faust | 18d939a | 2021-11-23 11:37:22 -0800 | [diff] [blame] | 669 | ], |
| 670 | }, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 671 | } |
Nan Zhang | 65f27a3 | 2018-01-05 10:41:46 -0800 | [diff] [blame] | 672 | |
Pete Gillin | ec902b8 | 2019-06-26 17:23:00 +0100 | [diff] [blame] | 673 | // A filegroup that provides access to a source file for a toolchain test that |
| 674 | // checks Java 9 language features are handled properly by JarJar. |
| 675 | filegroup { |
| 676 | name: "core-java-9-language-features-source", |
| 677 | srcs: ["luni/src/main/java/libcore/internal/Java9LanguageFeatures.java"], |
| 678 | visibility: ["//libcore/luni/src/test/java9language"], |
| 679 | } |
| 680 | |
Sorin Basca | 29de0a8 | 2021-12-01 14:03:45 +0000 | [diff] [blame] | 681 | // A filegroup that provides access to a source file for a toolchain test that |
| 682 | // checks Java 11 language features are handled properly by JarJar. |
| 683 | filegroup { |
| 684 | name: "core-java-11-language-features-source", |
| 685 | srcs: ["luni/src/main/java/libcore/internal/Java11LanguageFeatures.java"], |
| 686 | visibility: ["//libcore/luni/src/test/java11language"], |
| 687 | } |
| 688 | |
Sorin Basca | e4383a4 | 2022-05-27 11:53:43 +0100 | [diff] [blame] | 689 | // A filegroup that provides access to a source file for a toolchain test that |
| 690 | // checks Java 17 language features are handled properly by JarJar. |
| 691 | filegroup { |
| 692 | name: "core-java-17-language-features-source", |
| 693 | srcs: ["luni/src/main/java/libcore/internal/Java17LanguageFeatures.java"], |
| 694 | visibility: ["//libcore/luni/src/test/java17language"], |
| 695 | } |
| 696 | |
Dan Zimmerman | c2bd7fd | 2019-12-17 08:15:44 -0800 | [diff] [blame] | 697 | genrule { |
| 698 | name: "core-tests-smali-dex", |
| 699 | srcs: ["luni/src/test/java/**/*.smali"], |
David Srbecky | bfc626f | 2023-12-06 16:31:29 +0000 | [diff] [blame] | 700 | cmd: "$(location android-smali) ass --api 28 -o $(out) $(in)", |
Dan Zimmerman | c2bd7fd | 2019-12-17 08:15:44 -0800 | [diff] [blame] | 701 | out: ["core-tests-smali.dex"], |
David Srbecky | bfc626f | 2023-12-06 16:31:29 +0000 | [diff] [blame] | 702 | tools: ["android-smali"], |
Dan Zimmerman | c2bd7fd | 2019-12-17 08:15:44 -0800 | [diff] [blame] | 703 | } |
| 704 | |
Orion Hodson | 720a8d3 | 2022-10-27 08:06:09 +0000 | [diff] [blame] | 705 | filegroup { |
| 706 | name: "core-ojtests-javax-resources", |
| 707 | // Set path to keep the resources and .class files in the same directory in the jar file. |
| 708 | path: "ojluni/src", |
| 709 | srcs: ["ojluni/src/test/javax/**/*"], |
| 710 | exclude_srcs: ["ojluni/src/test/javax/**/*.java"], |
| 711 | } |
| 712 | |
| 713 | filegroup { |
| 714 | name: "core-ojtests-java-resources", |
| 715 | // Set path to keep the resources and .class files in the same directory in the jar file. |
| 716 | path: "ojluni/src", |
| 717 | srcs: [ |
| 718 | "ojluni/src/test/java/util/regex/**/*", |
| 719 | "ojluni/src/test/java/util/Base64/**/*", |
Almaz Mingaleev | 34a5939 | 2022-11-29 14:42:16 +0000 | [diff] [blame] | 720 | "ojluni/src/test/java/util/Scanner/**/*", |
Almaz Mingaleev | 94cee7b | 2023-10-27 16:36:46 +0100 | [diff] [blame] | 721 | "ojluni/src/test/java/util/Properties/**/*", |
Orion Hodson | 720a8d3 | 2022-10-27 08:06:09 +0000 | [diff] [blame] | 722 | ], |
| 723 | exclude_srcs: ["ojluni/src/test/java/**/*.java"], |
| 724 | } |
| 725 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 726 | // Builds the core-tests library. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 727 | java_test { |
| 728 | name: "core-tests", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 729 | visibility: [ |
Paul Duffin | 8d01a55 | 2020-03-25 12:02:54 +0000 | [diff] [blame] | 730 | "//art/build/sdk", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 731 | "//cts/tests/libcore/luni", |
| 732 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 733 | defaults: ["libcore_java_defaults"], |
| 734 | hostdex: true, |
| 735 | srcs: [ |
| 736 | "dalvik/src/test/java/**/*.java", |
| 737 | "dalvik/test-rules/src/test/java/**/*.java", |
| 738 | "dom/src/test/java/**/*.java", |
| 739 | "harmony-tests/src/test/java/**/*.java", |
| 740 | "json/src/test/java/**/*.java", |
| 741 | "luni/src/test/java/**/*.java", |
Paul Duffin | 4ba1453 | 2019-03-21 10:32:41 +0000 | [diff] [blame] | 742 | "test-rules/src/test/java/**/*.java", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 743 | "xml/src/test/java/**/*.java", |
| 744 | ], |
| 745 | exclude_srcs: [ |
Daulet Zhanguzin | a923aa3 | 2020-04-03 17:31:30 +0100 | [diff] [blame] | 746 | "harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/*.java", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 747 | "luni/src/test/java/libcore/java/util/zip/Zip64Test.java", |
| 748 | "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java", |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 749 | "luni/src/test/java/libcore/javax/crypto/**/*.java", |
Daulet Zhanguzin | a923aa3 | 2020-04-03 17:31:30 +0100 | [diff] [blame] | 750 | "luni/src/test/java/libcore/javax/net/ssl/**/*.java", |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 751 | "luni/src/test/java/org/apache/harmony/crypto/**/*.java", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 752 | ], |
| 753 | |
| 754 | java_resource_dirs: [ |
| 755 | "*/src/test/java", |
| 756 | "*/src/test/resources", |
| 757 | ], |
| 758 | exclude_java_resource_dirs: [ |
| 759 | "ojluni/src/test/java", |
Victor Chang | 23102e4 | 2021-02-24 15:28:35 +0000 | [diff] [blame] | 760 | "ojluni/src/test/javax", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 761 | "ojluni/src/test/resources", |
| 762 | ], |
| 763 | |
| 764 | java_resources: [ |
Paul Duffin | 16a057f | 2019-05-13 12:20:55 +0100 | [diff] [blame] | 765 | ":annotations-test", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 766 | ":filesystemstest", |
| 767 | ":parameter-metadata-test", |
Dan Zimmerman | c2bd7fd | 2019-12-17 08:15:44 -0800 | [diff] [blame] | 768 | ":core-tests-smali-dex", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 769 | ], |
| 770 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 771 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 772 | system_modules: "core-all-system-modules", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 773 | libs: [ |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 774 | "okhttp", |
| 775 | "bouncycastle", |
| 776 | ], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 777 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 778 | static_libs: [ |
Victor Chang | 91465f3 | 2023-07-01 01:07:31 +0100 | [diff] [blame] | 779 | "apache-xml-tests", |
Andrei Onea | 2829b54 | 2019-11-18 14:24:53 +0000 | [diff] [blame] | 780 | "core-compat-test-rules", |
Sorin Basca | 676774c | 2022-01-17 13:35:42 +0000 | [diff] [blame] | 781 | "core-java-9-compatibility-tests", |
Pete Gillin | 05a4320 | 2019-06-27 14:41:21 +0100 | [diff] [blame] | 782 | "core-java-9-language-tests", |
Sorin Basca | 29de0a8 | 2021-12-01 14:03:45 +0000 | [diff] [blame] | 783 | "core-java-11-language-tests", |
Sorin Basca | e4383a4 | 2022-05-27 11:53:43 +0100 | [diff] [blame] | 784 | "core-java-17-language-tests", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 785 | "core-test-rules", |
| 786 | "core-tests-support", |
| 787 | "junit-params", |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 788 | "libcore-crypto-tests", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 789 | "mockftpserver", |
| 790 | "mockito-target", |
| 791 | "mockwebserver", |
| 792 | "nist-pkix-tests", |
| 793 | "slf4j-jdk14", |
| 794 | "sqlite-jdbc", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 795 | ], |
| 796 | |
| 797 | errorprone: { |
| 798 | javacflags: [ |
| 799 | "-Xep:TryFailThrowable:ERROR", |
| 800 | "-Xep:ComparisonOutOfRange:ERROR", |
Cole Faust | d4b4cf7 | 2021-11-24 14:47:10 -0800 | [diff] [blame] | 801 | "-Xep:DoNotCall:OFF", |
Cole Faust | e90ec46 | 2022-08-15 15:03:06 -0700 | [diff] [blame] | 802 | "-Xep:ArrayToString:WARN", |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 803 | "-Xep:SelfEquals:WARN", |
| 804 | "-Xep:SelfComparison:WARN", |
| 805 | "-Xep:ReturnValueIgnored:WARN", |
| 806 | "-Xep:BoxedPrimitiveEquality:WARN", |
| 807 | "-Xep:SizeGreaterThanOrEqualsZero:WARN", |
| 808 | "-Xep:MisusedDayOfYear:WARN", |
| 809 | "-Xep:InvalidTimeZoneID:WARN", |
| 810 | "-Xep:CollectionToArraySafeParameter:WARN", |
| 811 | "-Xep:ModifyingCollectionWithItself:WARN", |
| 812 | "-Xep:ComparableType:WARN", |
| 813 | "-Xep:UnusedCollectionModifiedInPlace:WARN", |
| 814 | "-Xep:HashtableContains:WARN", |
| 815 | "-Xep:DoubleBraceInitialization:WARN", |
| 816 | "-Xep:RandomModInteger:WARN", |
| 817 | "-Xep:IdentityBinaryExpression:WARN", |
Cole Faust | 5e00c0e | 2023-11-14 17:24:13 -0800 | [diff] [blame] | 818 | "-Xep:UnnecessaryStringBuilder:OFF", // https://github.com/google/error-prone/issues/4195 |
| 819 | "-Xep:InvalidPatternSyntax:WARN", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 820 | ], |
| 821 | }, |
Simran Basi | 3be01e0 | 2018-08-21 17:53:49 -0700 | [diff] [blame] | 822 | |
| 823 | test_config: "AndroidTest-core-tests.xml", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 824 | } |
| 825 | |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 826 | java_test { |
| 827 | name: "libcore-crypto-tests", |
| 828 | |
| 829 | visibility: [ |
| 830 | "//art/build/sdk", |
| 831 | "//external/conscrypt/apex/tests", |
| 832 | ], |
Miguel Aranda | 79eebf6 | 2023-10-25 11:47:03 +0000 | [diff] [blame] | 833 | exclude_srcs: [ |
| 834 | "luni/src/test/java/libcore/javax/crypto/CipherTest.java", |
| 835 | ], |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 836 | srcs: [ |
Daulet Zhanguzin | a923aa3 | 2020-04-03 17:31:30 +0100 | [diff] [blame] | 837 | "harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/*.java", |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 838 | "luni/src/test/java/libcore/javax/crypto/**/*.java", |
Daulet Zhanguzin | a923aa3 | 2020-04-03 17:31:30 +0100 | [diff] [blame] | 839 | "luni/src/test/java/libcore/javax/net/ssl/**/*.java", |
Almaz Mingaleev | 465ea8d | 2021-05-18 16:42:18 +0100 | [diff] [blame] | 840 | "luni/src/test/java/libcore/libcore/util/SerializationTester.java", |
Miguel | 49d4f33 | 2022-02-16 11:10:24 +0000 | [diff] [blame] | 841 | "luni/src/test/java/libcore/sun/security/**/*.java", |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 842 | "luni/src/test/java/org/apache/harmony/crypto/**/*.java", |
| 843 | ], |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 844 | |
| 845 | java_resource_dirs: [ |
| 846 | "luni/src/test/java", |
| 847 | "luni/src/test/resources", |
| 848 | "support/src/test/java", |
| 849 | ], |
| 850 | |
| 851 | sdk_version: "none", |
| 852 | system_modules: "core-all-system-modules", |
| 853 | |
| 854 | static_libs: [ |
| 855 | "core-test-rules", |
| 856 | "core-tests-support", |
| 857 | "junit-params", |
| 858 | "mockito-target", |
| 859 | ], |
Cole Faust | e90ec46 | 2022-08-15 15:03:06 -0700 | [diff] [blame] | 860 | |
| 861 | errorprone: { |
| 862 | javacflags: [ |
| 863 | "-Xep:ArrayToString:WARN", |
Cole Faust | c06793a2 | 2022-10-15 21:33:32 -0700 | [diff] [blame] | 864 | "-Xep:ReturnValueIgnored:WARN", |
Cole Faust | e90ec46 | 2022-08-15 15:03:06 -0700 | [diff] [blame] | 865 | ], |
| 866 | }, |
Daulet Zhanguzin | 8f6ec37 | 2020-03-30 20:55:29 +0100 | [diff] [blame] | 867 | } |
| 868 | |
Victor Chang | 59ea0c3 | 2023-09-12 15:56:13 +0100 | [diff] [blame] | 869 | java_genrule { |
| 870 | name: "libcore-non-cts-tests-txt", |
| 871 | host_supported: true, |
| 872 | srcs: [ |
Cole Faust | 406bd52 | 2023-11-30 12:29:31 -0800 | [diff] [blame] | 873 | ":apache-harmony-tests{.jar}", |
| 874 | ":conscrypt-tests{.jar}", |
| 875 | ":core-tests{.jar}", |
| 876 | ":core-ojtests{.jar}", |
Victor Chang | 59ea0c3 | 2023-09-12 15:56:13 +0100 | [diff] [blame] | 877 | ], |
| 878 | tools: ["non-cts-json-generator"], |
| 879 | out: ["libcore-non-cts-tests.txt"], |
Cole Faust | 406bd52 | 2023-11-30 12:29:31 -0800 | [diff] [blame] | 880 | cmd: "$(location non-cts-json-generator) $(in) > $(out)", |
Victor Chang | 59ea0c3 | 2023-09-12 15:56:13 +0100 | [diff] [blame] | 881 | } |
| 882 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 883 | // Exports annotated stubs source files in ojluni/annotations/sdk to make them |
| 884 | // available to metalava. Used for nullability annotations in OpenJDK source. |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 885 | droiddoc_exported_dir { |
Pete Gillin | 0728b74 | 2018-09-17 15:41:45 +0100 | [diff] [blame] | 886 | name: "ojluni-annotated-sdk-stubs", |
Paul Duffin | 9b6ba59 | 2021-04-07 16:53:30 +0100 | [diff] [blame] | 887 | visibility: [ |
| 888 | "//libcore:__subpackages__", |
| 889 | ], |
Pete Gillin | 0728b74 | 2018-09-17 15:41:45 +0100 | [diff] [blame] | 890 | path: "ojluni/annotations/sdk", |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 891 | } |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 892 | |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 893 | droiddoc_exported_dir { |
| 894 | name: "ojluni-annotated-nullability-stubs", |
| 895 | path: "ojluni/annotations/sdk/nullability", |
| 896 | } |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 897 | |
| 898 | // Exports annotated stubs source files in ojluni/annotations/mmodules to make |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 899 | // them available to metalava. Used for core platform API and intra-core API |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 900 | // annotations in OpenJDK source. |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 901 | droiddoc_exported_dir { |
| 902 | name: "ojluni-annotated-mmodule-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 903 | visibility: [ |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 904 | "//libcore/mmodules/intracoreapi", |
| 905 | ], |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 906 | path: "ojluni/annotations/mmodule", |
| 907 | } |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 908 | |
Victor Chang | 92f77ce | 2023-12-13 16:01:07 +0000 | [diff] [blame] | 909 | droiddoc_exported_dir { |
| 910 | name: "ojluni-annotated-flagged-stubs", |
| 911 | path: "ojluni/annotations/flagged_api", |
| 912 | visibility: ["//visibility:private"], |
| 913 | } |
| 914 | |
Neil Fuller | 6f16b46 | 2018-09-04 15:40:39 +0100 | [diff] [blame] | 915 | // A file containing the list of tags that are "known" to us from the OpenJdk |
| 916 | // source code and so should not cause an error or warning. |
Nan Zhang | d55722b | 2018-02-27 15:08:20 -0800 | [diff] [blame] | 917 | filegroup { |
| 918 | name: "known-oj-tags", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 919 | visibility: [ |
| 920 | "//frameworks/base", |
Anton Hansson | 8c5fd9b | 2023-03-03 17:29:24 +0000 | [diff] [blame] | 921 | "//frameworks/base/api", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 922 | ], |
Nan Zhang | d55722b | 2018-02-27 15:08:20 -0800 | [diff] [blame] | 923 | srcs: [ |
| 924 | "known_oj_tags.txt", |
| 925 | ], |
| 926 | } |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 927 | |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 928 | // A special set of stubs containing the minimal set of self consistent |
| 929 | // classes for which a system module can be created. Every system module must |
| 930 | // contain the java.lang classes so the set was constructed by starting with |
| 931 | // the java.lang classes and then adding their transitive dependencies without |
| 932 | // splitting packages. So, if one class from a package is used then all classes |
| 933 | // in that package were added to the set. |
| 934 | // |
| 935 | // Needed for java-current-stubs-system-modules. |
| 936 | droidstubs { |
| 937 | name: "java-current-stubs-source", |
| 938 | srcs: [ |
| 939 | ":core_oj_api_files", |
| 940 | ":core_libart_api_files", |
| 941 | ], |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 942 | installable: false, |
| 943 | sdk_version: "none", |
| 944 | system_modules: "none", |
| 945 | |
| 946 | args: "--stub-packages java.*:javax.*:org.w3c.dom.*:org.xml.sax.*", |
| 947 | } |
| 948 | |
Victor Chang | a0b264b | 2023-12-28 16:56:25 +0000 | [diff] [blame] | 949 | // Generates stub files for the classes exposed in the public API, without |
| 950 | // javadoc. This can be used as a starting point for adding a new file to |
| 951 | // libcore/luni/annotations/flagged_api. |
| 952 | droidstubs { |
| 953 | name: "libart-sdk-stubs-no-javadoc", |
| 954 | srcs: [":core_libart_api_files"], |
| 955 | installable: false, |
| 956 | sdk_version: "none", |
| 957 | system_modules: "none", |
| 958 | args: "--exclude-documentation-from-stubs", |
| 959 | } |
| 960 | |
| 961 | // Separate @FlaggedApi annotations for luni/ to avoid a circular dependency between |
| 962 | // libcore_aconfig_flags_lib and core-all |
| 963 | droiddoc_exported_dir { |
| 964 | name: "luni-annotated-flagged-stubs", |
| 965 | path: "luni/annotations/flagged_api", |
| 966 | visibility: ["//visibility:private"], |
| 967 | } |
| 968 | |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 969 | java_library { |
| 970 | name: "java.current.stubs", |
| 971 | srcs: [":java-current-stubs-source"], |
| 972 | errorprone: { |
| 973 | javacflags: [ |
| 974 | "-Xep:MissingOverride:OFF", |
| 975 | ], |
| 976 | }, |
| 977 | patch_module: "java.base", |
| 978 | sdk_version: "none", |
| 979 | system_modules: "none", |
| 980 | } |
| 981 | |
Paul Duffin | c9abfe9 | 2020-09-10 10:48:09 +0100 | [diff] [blame] | 982 | // A special set of system modules needed to build art.module.public.api |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 983 | java_system_modules { |
| 984 | name: "java-current-stubs-system-modules", |
| 985 | libs: [ |
| 986 | // Minimal set of classes required for a system module. |
| 987 | "java.current.stubs", |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 988 | ], |
| 989 | } |
| 990 | |
Victor Chang | 0cd67fb | 2021-05-12 10:35:00 +0100 | [diff] [blame] | 991 | java_library { |
| 992 | name: "framework-api-annotations-lib", |
| 993 | srcs: [":framework-api-annotations"], |
| 994 | sdk_version: "none", |
| 995 | patch_module: "java.base", |
| 996 | system_modules: "core-all-system-modules", |
| 997 | installable: false, |
| 998 | visibility: [ |
| 999 | "//visibility:private", |
| 1000 | ], |
| 1001 | } |
| 1002 | |
Victor Chang | 28f71fa | 2023-12-08 16:30:07 +0000 | [diff] [blame] | 1003 | aconfig_declarations { |
| 1004 | name: "libcore_aconfig_flags", |
| 1005 | package: "com.android.libcore", |
Oriol Prieto Gasco | d48ec99 | 2024-02-05 14:54:56 +0000 | [diff] [blame] | 1006 | container: "system", |
Victor Chang | 28f71fa | 2023-12-08 16:30:07 +0000 | [diff] [blame] | 1007 | srcs: ["libcore.aconfig"], |
| 1008 | } |
| 1009 | |
| 1010 | java_aconfig_library { |
| 1011 | name: "libcore_aconfig_flags_lib", |
| 1012 | aconfig_declarations: "libcore_aconfig_flags", |
| 1013 | sdk_version: "none", |
| 1014 | patch_module: "java.base", |
| 1015 | system_modules: "core-all-system-modules", |
| 1016 | apex_available: [ |
| 1017 | "com.android.art", |
| 1018 | // Remove :platform until we allow platform codes to use libcore's @FlaggedApi APIs |
| 1019 | // "//apex_available:platform", |
| 1020 | ], |
| 1021 | visibility: [ |
| 1022 | "//visibility:private", |
| 1023 | ], |
| 1024 | } |
| 1025 | |
Paul Duffin | c9abfe9 | 2020-09-10 10:48:09 +0100 | [diff] [blame] | 1026 | // Define the public SDK API provided by the ART module. |
| 1027 | java_sdk_library { |
| 1028 | name: "art.module.public.api", |
Paul Duffin | 93f2f6c | 2020-03-26 15:31:24 +0000 | [diff] [blame] | 1029 | visibility: [ |
Paul Duffin | 8d01a55 | 2020-03-25 12:02:54 +0000 | [diff] [blame] | 1030 | "//art/build/sdk", |
Paul Duffin | 882c7ba | 2021-07-10 23:28:13 +0100 | [diff] [blame] | 1031 | "//build/soong/java/core-libraries", |
Paul Duffin | 93f2f6c | 2020-03-26 15:31:24 +0000 | [diff] [blame] | 1032 | "//frameworks/base", |
Anton Hansson | aba92c7 | 2020-12-17 17:00:01 +0000 | [diff] [blame] | 1033 | "//frameworks/base/api", |
Paul Duffin | 8a1867f | 2022-07-15 09:18:09 +0000 | [diff] [blame] | 1034 | |
| 1035 | // DO NOT REMOVE: Legacy visibility, needed for snapshots that are |
| 1036 | // generated for the S build. |
| 1037 | "//libcore/mmodules/core_platform_api", |
Paul Duffin | 93f2f6c | 2020-03-26 15:31:24 +0000 | [diff] [blame] | 1038 | ], |
Paul Duffin | 53690cb | 2019-09-19 15:11:28 +0100 | [diff] [blame] | 1039 | srcs: [ |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 1040 | ":core_oj_api_files", |
| 1041 | ":core_libart_api_files", |
Victor Chang | 82f70f4 | 2021-05-27 12:30:53 +0100 | [diff] [blame] | 1042 | |
| 1043 | // Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are |
| 1044 | // annotated by applying annotations to the .annotated.java stubs files in |
| 1045 | // ojluni/annotated/mmodules and rather than in the original source. See the comments |
| 1046 | // in openjdk_java_files.bp for more details. |
| 1047 | ":openjdk_mmodule_extra_files", |
Victor Chang | e965ca1 | 2021-06-23 17:39:18 +0100 | [diff] [blame] | 1048 | ":okhttp_api_files", |
Paul Duffin | 53690cb | 2019-09-19 15:11:28 +0100 | [diff] [blame] | 1049 | ], |
Paul Duffin | 4836374 | 2023-11-15 13:05:28 +0000 | [diff] [blame] | 1050 | api_srcs: [ |
| 1051 | ":openjdk_javadoc_only_files", |
| 1052 | ], |
Paul Duffin | fe5f63c | 2019-10-11 09:53:11 +0100 | [diff] [blame] | 1053 | libs: [ |
Victor Chang | 0cd67fb | 2021-05-12 10:35:00 +0100 | [diff] [blame] | 1054 | // Put framework-api-annotations into libs to avoid exposing the definition of framework's |
| 1055 | // annotations from libcore (wrong place) instead of framework (correct place). |
| 1056 | "framework-api-annotations-lib", |
Paul Duffin | fe5f63c | 2019-10-11 09:53:11 +0100 | [diff] [blame] | 1057 | // Provide access to I18N constants that are used to initialize |
| 1058 | // constants in the public API. i.e. to allow the value of the |
| 1059 | // java.text.CollectionElementIterator.NULLORDER to be initialized from |
| 1060 | // android.icu.text.CollationElementIterator.NULLORDER. |
| 1061 | "i18n.module.intra.core.api.stubs", |
Victor Chang | 28f71fa | 2023-12-08 16:30:07 +0000 | [diff] [blame] | 1062 | "libcore_aconfig_flags_lib", |
Paul Duffin | fe5f63c | 2019-10-11 09:53:11 +0100 | [diff] [blame] | 1063 | ], |
Anton Hansson | 8a1d0f6 | 2021-04-21 16:33:35 +0100 | [diff] [blame] | 1064 | stub_only_static_libs: ["notices-for-stubs-jar"], |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 1065 | |
Paul Duffin | 8a2f9ab | 2021-04-16 18:52:01 +0100 | [diff] [blame] | 1066 | // Make dex jars for the stubs available for use by hiddenapi processing. |
| 1067 | compile_dex: true, |
| 1068 | |
Paul Duffin | c9abfe9 | 2020-09-10 10:48:09 +0100 | [diff] [blame] | 1069 | public: { |
| 1070 | enabled: true, |
| 1071 | }, |
Victor Chang | 0cd67fb | 2021-05-12 10:35:00 +0100 | [diff] [blame] | 1072 | system: { |
| 1073 | enabled: true, |
| 1074 | }, |
| 1075 | module_lib: { |
| 1076 | enabled: true, |
| 1077 | }, |
Paul Duffin | 3f028ca | 2019-11-11 20:17:28 +0000 | [diff] [blame] | 1078 | |
Paul Duffin | c9abfe9 | 2020-09-10 10:48:09 +0100 | [diff] [blame] | 1079 | api_only: true, |
| 1080 | droiddoc_options: [ |
Anton Hansson | b630de8 | 2020-12-22 11:25:54 +0000 | [diff] [blame] | 1081 | "--force-convert-to-warning-nullability-annotations +*:-android.*:+android.icu.*:-dalvik.* ", |
Victor Chang | 82f70f4 | 2021-05-27 12:30:53 +0100 | [diff] [blame] | 1082 | "--hide-annotation libcore.api.Hide", |
Paul Duffin | c9abfe9 | 2020-09-10 10:48:09 +0100 | [diff] [blame] | 1083 | ], |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 1084 | |
Victor Chang | 92f77ce | 2023-12-13 16:01:07 +0000 | [diff] [blame] | 1085 | merge_inclusion_annotations_dirs: [ |
Victor Chang | a0b264b | 2023-12-28 16:56:25 +0000 | [diff] [blame] | 1086 | "luni-annotated-flagged-stubs", |
Victor Chang | 92f77ce | 2023-12-13 16:01:07 +0000 | [diff] [blame] | 1087 | "ojluni-annotated-flagged-stubs", |
| 1088 | "ojluni-annotated-mmodule-stubs", |
| 1089 | ], |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 1090 | // Emit nullability annotations from the source to the stub files. |
Paul Duffin | c3e1c0a | 2019-11-01 20:29:36 +0000 | [diff] [blame] | 1091 | annotations_enabled: true, |
| 1092 | |
| 1093 | merge_annotations_dirs: [ |
Paul Duffin | c9abfe9 | 2020-09-10 10:48:09 +0100 | [diff] [blame] | 1094 | "metalava-manual", |
Paul Duffin | c3e1c0a | 2019-11-01 20:29:36 +0000 | [diff] [blame] | 1095 | "ojluni-annotated-sdk-stubs", |
| 1096 | ], |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 1097 | |
Paul Duffin | 0f3b114 | 2020-09-16 17:17:25 +0100 | [diff] [blame] | 1098 | doctag_files: [ |
| 1099 | ":known-oj-tags", |
| 1100 | ], |
| 1101 | |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 1102 | errorprone: { |
| 1103 | javacflags: [ |
| 1104 | "-Xep:MissingOverride:OFF", |
| 1105 | ], |
| 1106 | }, |
Paul Duffin | 1d7d4a7 | 2019-10-10 18:15:01 +0100 | [diff] [blame] | 1107 | patch_module: "java.base", |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 1108 | sdk_version: "none", |
Paul Duffin | 5cd69e4 | 2019-10-11 17:12:23 +0100 | [diff] [blame] | 1109 | system_modules: "java-current-stubs-system-modules", |
Anton Hansson | aba92c7 | 2020-12-17 17:00:01 +0000 | [diff] [blame] | 1110 | // The base name for the artifacts that are automatically published to the |
| 1111 | // dist and which end up in one of the sub-directories of prebuilts/sdk. |
| 1112 | // As long as this matches the name of the artifacts in prebuilts/sdk then |
| 1113 | // the API will be checked for compatibility against the latest released |
| 1114 | // version of the API. |
| 1115 | dist_stem: "art", |
Colin Cross | 08ed416 | 2021-05-10 10:48:15 -0700 | [diff] [blame] | 1116 | dist_group: "android", |
Jihoon Kang | 5680a6d | 2024-01-04 00:54:10 +0000 | [diff] [blame] | 1117 | aconfig_declarations: [ |
| 1118 | "libcore_aconfig_flags", |
| 1119 | ], |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 1120 | } |
| 1121 | |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 1122 | // Target for validating nullability annotations for correctness and |
| 1123 | // completeness. To check that there are no nullability errors: |
Paul Duffin | bfbfb67 | 2019-10-03 17:53:32 +0100 | [diff] [blame] | 1124 | // m art-module-public-api-stubs-nullability-validation |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 1125 | // To check that there are only the expected nullability warnings: |
Paul Duffin | bfbfb67 | 2019-10-03 17:53:32 +0100 | [diff] [blame] | 1126 | // m art-module-public-api-stubs-nullability-validation-check-nullability-warnings |
Pete Gillin | cdca7f8 | 2019-10-04 13:28:57 +0100 | [diff] [blame] | 1127 | // (If that check fails, it will provide instructions on how to proceed, |
| 1128 | // including the command to run to update the expected warnings file.) |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 1129 | droidstubs { |
Paul Duffin | bfbfb67 | 2019-10-03 17:53:32 +0100 | [diff] [blame] | 1130 | name: "art-module-public-api-stubs-nullability-validation", |
| 1131 | srcs: [":art_module_api_files"], |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 1132 | installable: false, |
Paul Duffin | 419b242 | 2019-06-25 15:42:05 +0100 | [diff] [blame] | 1133 | sdk_version: "none", |
Paul Duffin | c799a7c | 2019-10-11 14:19:36 +0100 | [diff] [blame] | 1134 | system_modules: "none", |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 1135 | annotations_enabled: true, |
| 1136 | args: "--hide-annotation libcore.api.Hide " + |
| 1137 | "--validate-nullability-from-merged-stubs ", |
| 1138 | merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"], |
| 1139 | merge_annotations_dirs: [ |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 1140 | // N.B. Stubs in this filegroup will be validated: |
| 1141 | "ojluni-annotated-nullability-stubs", |
| 1142 | ], |
Pete Gillin | c5f179b | 2018-11-14 18:42:19 +0000 | [diff] [blame] | 1143 | // The list of classes which have nullability annotations included in the source. |
| 1144 | // (This is in addition to those which have annotations in the merged stubs.) |
| 1145 | validate_nullability_from_list: "nullability_annotated_classes.txt", |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 1146 | // The expected set of warnings about missing annotations: |
| 1147 | check_nullability_warnings: "nullability_warnings.txt", |
| 1148 | } |
| 1149 | |
Paul Duffin | f48513e | 2019-10-07 14:04:04 +0100 | [diff] [blame] | 1150 | // A special set of system modules for building the following library for use |
| 1151 | // in the art-module-public-api-system-modules. |
| 1152 | java_system_modules { |
| 1153 | name: "api-annotations-system-modules", |
| 1154 | libs: [ |
| 1155 | "art.module.public.api.stubs", |
| 1156 | ], |
| 1157 | } |
| 1158 | |
Paul Duffin | 81dd1df | 2019-10-10 15:44:53 +0100 | [diff] [blame] | 1159 | // A library that contains annotations that define API surfaces (core |
| 1160 | // platform, intra core and the hidden API) along with some supporting |
| 1161 | // constants. The annotations are source only and do not introduce any runtime |
| 1162 | // dependencies. Specially built for use in system modules definitions to |
| 1163 | // avoid introducing compile time cycles. |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 1164 | java_library { |
Paul Duffin | 81dd1df | 2019-10-10 15:44:53 +0100 | [diff] [blame] | 1165 | name: "art.module.api.annotations.for.system.modules", |
Spandan Das | 5494093 | 2022-12-08 02:40:37 +0000 | [diff] [blame] | 1166 | visibility: [ |
| 1167 | "//build/soong/java/core-libraries", |
| 1168 | ], |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 1169 | srcs: [ |
Paul Duffin | 81dd1df | 2019-10-10 15:44:53 +0100 | [diff] [blame] | 1170 | ":api_surface_annotation_files", |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 1171 | ], |
| 1172 | |
| 1173 | installable: false, |
Paul Duffin | f545bc7 | 2019-10-02 14:07:04 +0100 | [diff] [blame] | 1174 | sdk_version: "none", |
Paul Duffin | f48513e | 2019-10-07 14:04:04 +0100 | [diff] [blame] | 1175 | system_modules: "api-annotations-system-modules", |
| 1176 | patch_module: "java.base", |
Sorin Basca | c90e1e7 | 2023-06-02 11:13:31 +0000 | [diff] [blame] | 1177 | // This jar is packaged as part of the SDK, use -target 8 so that it works |
| 1178 | // with old JDKs. |
| 1179 | java_version: "1.8", |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 1180 | } |
| 1181 | |
Paul Duffin | 81dd1df | 2019-10-10 15:44:53 +0100 | [diff] [blame] | 1182 | // Create a library containing the api surface annotations, built against |
| 1183 | // core_current for use by the annotation processor in frameworks/base. |
| 1184 | java_library { |
| 1185 | name: "art.module.api.annotations", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 1186 | visibility: [ |
Martin Stjernholm | 4b8e2f9 | 2020-11-11 02:46:59 +0000 | [diff] [blame] | 1187 | "//art/build/sdk", |
| 1188 | "//external/icu/android_icu4j", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 1189 | "//frameworks/base", |
Anton Hansson | 8c5fd9b | 2023-03-03 17:29:24 +0000 | [diff] [blame] | 1190 | "//frameworks/base/api", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 1191 | ], |
Paul Duffin | 81dd1df | 2019-10-10 15:44:53 +0100 | [diff] [blame] | 1192 | host_supported: true, |
Andrei Onea | 24892e2 | 2019-04-16 16:48:37 +0100 | [diff] [blame] | 1193 | srcs: [ |
Paul Duffin | 81dd1df | 2019-10-10 15:44:53 +0100 | [diff] [blame] | 1194 | ":api_surface_annotation_files", |
Andrei Onea | 24892e2 | 2019-04-16 16:48:37 +0100 | [diff] [blame] | 1195 | ], |
Paul Duffin | 81dd1df | 2019-10-10 15:44:53 +0100 | [diff] [blame] | 1196 | sdk_version: "core_current", |
Paul Duffin | 602d2f4 | 2022-08-23 12:57:15 +0000 | [diff] [blame] | 1197 | // Make sure that this will be added to the sdk snapshot for S. |
| 1198 | min_sdk_version: "S", |
Sorin Basca | 1eeea0f | 2023-06-13 15:47:01 +0000 | [diff] [blame] | 1199 | // This jar is packaged as part of the ART module host exports, use -target 8 so that it works |
| 1200 | // with old JDKs. |
| 1201 | java_version: "1.8", |
Neil Fuller | 86345d7 | 2019-04-25 09:15:32 +0100 | [diff] [blame] | 1202 | } |