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 | |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 85 | // OpenJDK source is not annotated with @hide so we need this separate |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 86 | // filegroup for just the parts that contribute to the API. |
| 87 | filegroup { |
| 88 | name: "core_oj_api_files", |
| 89 | srcs: [":openjdk_javadoc_files"], |
| 90 | } |
| 91 | |
| 92 | // The source files that go into core-libart. |
| 93 | filegroup { |
| 94 | name: "core_libart_java_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 95 | visibility: [ |
| 96 | "//libcore:__subpackages__", |
| 97 | ], |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 98 | srcs: [ |
| 99 | ":non_openjdk_java_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 100 | ], |
| 101 | } |
| 102 | |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 103 | // 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] | 104 | // filegroup for just the parts that contribute to the API. |
| 105 | filegroup { |
| 106 | name: "core_libart_api_files", |
| 107 | srcs: [ |
| 108 | ":non_openjdk_javadoc_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 109 | ], |
| 110 | } |
| 111 | |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 112 | // The set of files for the core library that have been marked up with @hide |
| 113 | // for the public SDK APIs. Used from frameworks/base/ to indicate the source |
| 114 | // files for inclusion in the public SDK docs. |
| 115 | filegroup { |
| 116 | name: "core_public_api_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 117 | visibility: [ |
| 118 | "//frameworks/base", |
| 119 | ], |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 120 | srcs: [ |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 121 | ":android_icu4j_src_files", |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 122 | ":core_oj_api_files", |
| 123 | ":core_libart_api_files", |
| 124 | ":conscrypt_public_api_files", |
| 125 | ], |
| 126 | } |
| 127 | |
Paul Duffin | a38da2d | 2019-10-01 17:49:50 +0100 | [diff] [blame] | 128 | // The set of files for the core library that contribute to one or more API |
| 129 | // surfaces. This includes files that are in the public API as well as those |
| 130 | // that are not but which have been marked up with @hide plus one or more of |
| 131 | // the API defining annotations. |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 132 | filegroup { |
| 133 | name: "core_api_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 134 | visibility: [ |
| 135 | "//libcore:__subpackages__", |
| 136 | ], |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 137 | srcs: [ |
Paul Duffin | a38da2d | 2019-10-01 17:49:50 +0100 | [diff] [blame] | 138 | ":art_module_api_files", |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 139 | ":android_icu4j_src_files", |
Paul Duffin | a38da2d | 2019-10-01 17:49:50 +0100 | [diff] [blame] | 140 | ":conscrypt_java_files", |
| 141 | ], |
| 142 | } |
| 143 | |
| 144 | // The set of files for the ART module that contribute to one or more API |
| 145 | // surfaces. This includes files that are in the public API as well as those |
| 146 | // that are not but which have been marked up with @hide plus one or more of |
| 147 | // the API defining annotations. |
| 148 | // |
| 149 | // Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are |
| 150 | // annotated by applying annotations to the .annotated.java stubs files in |
| 151 | // ojluni/annotated/mmodules and rather than in the original source. See the comments |
| 152 | // in openjdk_java_files.bp for more details. |
| 153 | filegroup { |
| 154 | name: "art_module_api_files", |
| 155 | visibility: [ |
| 156 | "//libcore:__subpackages__", |
| 157 | ], |
| 158 | srcs: [ |
Neil Fuller | d129bc9 | 2018-09-26 11:12:58 +0100 | [diff] [blame] | 159 | ":apache-xml_api_files", |
Neil Fuller | a77f710 | 2018-09-21 19:04:41 +0100 | [diff] [blame] | 160 | ":bouncycastle_java_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 161 | ":core_oj_api_files", |
| 162 | ":core_libart_api_files", |
Neil Fuller | 641d5f9 | 2018-09-24 15:40:39 +0100 | [diff] [blame] | 163 | ":okhttp_api_files", |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 164 | ":openjdk_mmodule_extra_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 165 | ], |
| 166 | } |
| 167 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 168 | java_defaults { |
| 169 | name: "libcore_java_defaults", |
| 170 | javacflags: [ |
| 171 | //"-Xlint:all", |
| 172 | //"-Xlint:-serial,-deprecation,-unchecked", |
| 173 | ], |
| 174 | dxflags: ["--core-library"], |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 175 | errorprone: { |
| 176 | javacflags: [ |
Paul Duffin | c31f6bb | 2019-05-15 12:32:44 +0100 | [diff] [blame] | 177 | "-Xep:MissingOverride:OFF", // Ignore missing @Override. |
| 178 | "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 179 | ], |
| 180 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | // |
| 184 | // Build for the target (device). |
| 185 | // |
| 186 | |
Tobias Thierer | 5233164 | 2019-05-29 12:11:39 +0000 | [diff] [blame] | 187 | // A target used to bootstrap compilation for the core library. |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 188 | // |
Tobias Thierer | 5233164 | 2019-05-29 12:11:39 +0000 | [diff] [blame] | 189 | // See core-all-system-modules for more details. |
| 190 | java_library { |
| 191 | name: "core-all", |
Tobias Thierer | 5233164 | 2019-05-29 12:11:39 +0000 | [diff] [blame] | 192 | defaults: ["libcore_java_defaults"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 193 | |
| 194 | srcs: [ |
Paul Duffin | f975b71 | 2019-10-02 12:37:38 +0100 | [diff] [blame] | 195 | // Use the source code for the I18N module intra core API as using the |
| 196 | // compiled version does not work due to limitations in either soong or the javac |
| 197 | // toolchain. See http://b/142056316 for more details. |
| 198 | ":i18n-module-intra-core-api-stubs-source", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 199 | ":core_oj_java_files", |
| 200 | ":core_libart_java_files", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 201 | ":openjdk_lambda_stub_files", |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 202 | ":openjdk_generated_annotation_stub_files", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 203 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 204 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 205 | sdk_version: "none", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 206 | system_modules: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 207 | openjdk9: { |
| 208 | srcs: ["luni/src/module/java/module-info.java"], |
| 209 | javacflags: ["--patch-module=java.base=."], |
| 210 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 211 | |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 212 | java_resources: core_resources, |
Victor Chang | 7fef405 | 2018-09-25 14:12:03 +0100 | [diff] [blame] | 213 | static_libs: ["android_icu4j_resources_lib"], |
Tobias Thierer | de99123 | 2018-03-07 15:10:46 +0000 | [diff] [blame] | 214 | java_version: "1.9", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 215 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 216 | installable: false, |
atrost | 98ec08d | 2019-08-05 12:23:41 +0100 | [diff] [blame] | 217 | |
| 218 | plugins: ["compat-changeid-annotation-processor"], |
| 219 | } |
| 220 | |
| 221 | platform_compat_config { |
| 222 | name: "libcore-platform-compat-config", |
atrost | 98ec08d | 2019-08-05 12:23:41 +0100 | [diff] [blame] | 223 | src: ":core-all", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 224 | } |
| 225 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 226 | // A system modules definition for use by core library targets only. It only |
| 227 | // contains the core-all jar, which contains the classes that end up in core-oj, |
| 228 | // core-libart as well as the lambda stubs needed to compile Java lambda code. |
| 229 | // It does not contain other parts of core library like conscrypt, bouncycastle, |
| 230 | // etc. This system_modules definition is used to bootstrap compilation for |
Paul Duffin | 00b174e | 2019-09-26 16:22:17 +0100 | [diff] [blame] | 231 | // other parts of the core library like core-oj, core-libart, conscrypt, |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 232 | // bouncycastle, etc. |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 233 | java_system_modules { |
| 234 | name: "core-all-system-modules", |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 235 | |
| 236 | // Visibility is deliberately restricted to a small set of build modules that |
| 237 | // the core library team control. |
| 238 | visibility: [ |
| 239 | "//external/apache-harmony:__subpackages__", |
| 240 | "//external/apache-xml", |
Paul Duffin | a8173c5 | 2019-09-24 13:04:42 +0100 | [diff] [blame] | 241 | "//external/okhttp", |
| 242 | "//libcore:__subpackages__", |
| 243 | ], |
| 244 | |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 245 | libs: ["core-all"], |
| 246 | } |
| 247 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 248 | // Contains the parts of core library associated with OpenJDK. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 249 | java_library { |
| 250 | name: "core-oj", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 251 | visibility: [ |
| 252 | "//art/build/apex", |
| 253 | "//external/wycheproof", |
Paul Duffin | 94f7023 | 2019-05-22 16:22:29 +0100 | [diff] [blame] | 254 | "//libcore/benchmarks", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 255 | ], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 256 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 257 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 258 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 259 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 260 | srcs: [":core_oj_java_files"], |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 261 | java_resources: core_resources, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 262 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 263 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 264 | system_modules: "core-all-system-modules", |
| 265 | openjdk9: { |
| 266 | javacflags: ["--patch-module=java.base=."], |
| 267 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 268 | |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 269 | jacoco: { |
Pete Gillin | 27ca058 | 2018-01-10 17:04:17 +0000 | [diff] [blame] | 270 | exclude_filter: [ |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 271 | "java.lang.Class", |
| 272 | "java.lang.Long", |
| 273 | "java.lang.Number", |
| 274 | "java.lang.Object", |
| 275 | "java.lang.String", |
| 276 | "java.lang.invoke.MethodHandle", |
| 277 | "java.lang.ref.Reference", |
| 278 | "java.lang.reflect.Proxy", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 279 | "java.util.AbstractMap", |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 280 | "java.util.HashMap", |
| 281 | "java.util.HashMap$Node", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 282 | "java.util.Map", |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 283 | ], |
| 284 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 285 | |
| 286 | notice: "ojluni/NOTICE", |
| 287 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 288 | } |
| 289 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 290 | // Contains parts of core library not associated with OpenJDK. Contains not |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 291 | // just java.*, javax.* code but also android.system.* and various internal |
| 292 | // libcore.* packages. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 293 | java_library { |
| 294 | name: "core-libart", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 295 | visibility: [ |
| 296 | "//art/build/apex", |
| 297 | "//external/robolectric-shadows", |
| 298 | "//external/wycheproof", |
Paul Duffin | 94f7023 | 2019-05-22 16:22:29 +0100 | [diff] [blame] | 299 | "//libcore/benchmarks", |
Colin Cross | f0ef625 | 2019-05-31 08:26:47 -0700 | [diff] [blame] | 300 | "//frameworks/layoutlib", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 301 | ], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 302 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 303 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 304 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 305 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 306 | srcs: [":core_libart_java_files"], |
Tobias Thierer | de99123 | 2018-03-07 15:10:46 +0000 | [diff] [blame] | 307 | java_version: "1.9", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 308 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 309 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 310 | system_modules: "core-all-system-modules", |
| 311 | openjdk9: { |
| 312 | javacflags: ["--patch-module=java.base=."], |
| 313 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 314 | |
Pete Gillin | 80ebe87 | 2018-02-13 15:21:20 +0000 | [diff] [blame] | 315 | jacoco: { |
| 316 | exclude_filter: [ |
| 317 | "java.lang.DexCache", |
| 318 | "dalvik.system.ClassExt", |
| 319 | ], |
| 320 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 321 | |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 322 | target: { |
| 323 | hostdex: { |
| 324 | required: [ |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 325 | // Files used to simulate the /system, runtime APEX and tzdata |
| 326 | // APEX dir structure on host. |
| 327 | "icu_tzdata.dat_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 328 | "tzdata_host", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 329 | "tzdata_host_tzdata_apex", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 330 | "tzlookup.xml_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 331 | "tz_version_host", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 332 | "tz_version_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 333 | ], |
| 334 | }, |
| 335 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 336 | } |
| 337 | |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 338 | // Provided solely to contribute information about which hidden parts of the |
| 339 | // core-oj API are used by apps. |
Paul Duffin | c6bf27b | 2019-05-15 14:41:00 +0100 | [diff] [blame] | 340 | // |
| 341 | // The build system determines that this library provides hiddenapi information |
| 342 | // for the core-oj bootjar because its name is of the form <x>-hiddenapi, where |
| 343 | // <x> is the name of a boot jar. That triggers the generation of a flags.csv |
| 344 | // file which encapsulates information extracted from the UnsupportedAppUsage |
| 345 | // annotations in the dex. The information from that file is then encoded into |
| 346 | // the core-oj file. |
| 347 | // |
| 348 | // Usually, e.g. for core-libart, the UnsupportedAppUsage annotations are |
| 349 | // added to the source that is compiled directly into the bootjar and the build |
| 350 | // system extracts the information about UnsupportedAppUsage directly from |
| 351 | // there. |
| 352 | // |
| 353 | // This approach of having separate annotated source and a separate build |
| 354 | // target was taken for ojluni to avoid having to maintain local patches in the |
| 355 | // ojluni source for UnsupportedAppUsage annotations as that would make it more |
| 356 | // difficult to pull down changes from upstream. |
| 357 | // |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 358 | java_library { |
| 359 | name: "core-oj-hiddenapi", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 360 | // Do not allow this to be accessed from outside this directory. |
| 361 | visibility: ["//visibility:private"], |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 362 | defaults: ["libcore_java_defaults"], |
| 363 | compile_dex: true, |
| 364 | |
| 365 | srcs: [":openjdk_hiddenapi_javadoc_files"], |
| 366 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 367 | sdk_version: "none", |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 368 | system_modules: "core-all-system-modules", |
| 369 | openjdk9: { |
| 370 | javacflags: ["--patch-module=java.base=."], |
| 371 | }, |
| 372 | } |
| 373 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 374 | // |
Paul Duffin | 00b174e | 2019-09-26 16:22:17 +0100 | [diff] [blame] | 375 | // Guaranteed unstripped versions of core-oj and core-libart. |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 376 | // |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 377 | // The build system may or may not strip the core-oj and core-libart jars, |
| 378 | // but these will not be stripped. See b/24535627. |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 379 | // |
| 380 | |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 381 | java_library { |
| 382 | name: "core-oj-testdex", |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 383 | installable: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 384 | static_libs: ["core-oj"], |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 385 | sdk_version: "none", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 386 | system_modules: "core-all-system-modules", |
| 387 | dxflags: ["--core-library"], |
Colin Cross | 485ed36 | 2017-12-05 17:24:22 -0800 | [diff] [blame] | 388 | dex_preopt: { |
| 389 | enabled: false, |
| 390 | }, |
Tobias Thierer | de99123 | 2018-03-07 15:10:46 +0000 | [diff] [blame] | 391 | java_version: "1.9", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 392 | notice: "ojluni/NOTICE", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 393 | } |
| 394 | |
| 395 | java_library { |
| 396 | name: "core-libart-testdex", |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 397 | installable: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 398 | static_libs: ["core-libart"], |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 399 | sdk_version: "none", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 400 | system_modules: "core-all-system-modules", |
| 401 | dxflags: ["--core-library"], |
Colin Cross | 485ed36 | 2017-12-05 17:24:22 -0800 | [diff] [blame] | 402 | dex_preopt: { |
| 403 | enabled: false, |
| 404 | }, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 405 | notice: "ojluni/NOTICE", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 406 | } |
| 407 | |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 408 | java_defaults { |
| 409 | name: "core_lambda_stubs_defaults", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 410 | defaults: ["libcore_java_defaults"], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 411 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 412 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 413 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 414 | system_modules: "core-all-system-modules", |
| 415 | openjdk9: { |
| 416 | javacflags: ["--patch-module=java.base=."], |
| 417 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 418 | |
| 419 | notice: "ojluni/NOTICE", |
| 420 | |
| 421 | installable: false, |
| 422 | include_srcs: true, |
| 423 | } |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 424 | |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 425 | // Creates a jar that exists to satisfy javac when compiling source code that |
| 426 | // contains lambdas. This contains all classes / methods required by javac |
| 427 | // when generating invoke-dynamic lambda implementation code, even those that |
| 428 | // are also in the public SDK API from API level 26 onwards. |
| 429 | java_library { |
| 430 | name: "core-lambda-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 431 | visibility: ["//visibility:public"], |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 432 | defaults: ["core_lambda_stubs_defaults"], |
| 433 | srcs: [ |
| 434 | ":openjdk_lambda_stub_files", |
| 435 | ":openjdk_lambda_duplicate_stub_files", |
| 436 | ], |
| 437 | } |
| 438 | |
| 439 | // An alternative to core-lambda-stubs that omits openjdk_lambda_duplicate_stub_files |
| 440 | // because those classes are also part of the core library public SDK API |
| 441 | // (since API level 26). |
| 442 | java_library { |
| 443 | name: "core-lambda-stubs-for-system-modules", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 444 | visibility: [ |
| 445 | "//libcore/mmodules/core_platform_api", |
| 446 | ], |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 447 | defaults: ["core_lambda_stubs_defaults"], |
| 448 | srcs: [ |
| 449 | ":openjdk_lambda_stub_files", |
| 450 | ], |
| 451 | } |
| 452 | |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 453 | // Creates a jar that exists to satisfy javac when compiling source code that |
| 454 | // contains @Generated annotations, which are produced by some code generation |
| 455 | // tools (notably dagger) but aren't part of the Android API. |
| 456 | // See http://b/123891440. |
| 457 | java_library { |
| 458 | name: "core-generated-annotation-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 459 | visibility: [ |
| 460 | "//libcore/mmodules/core_platform_api", |
| 461 | ], |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 462 | defaults: ["libcore_java_defaults"], |
| 463 | srcs: [ |
| 464 | ":openjdk_generated_annotation_stub_files", |
| 465 | ], |
| 466 | hostdex: true, |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 467 | sdk_version: "none", |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 468 | system_modules: "core-all-system-modules", |
| 469 | openjdk9: { |
| 470 | javacflags: ["--patch-module=java.base=."], |
| 471 | }, |
| 472 | notice: "ojluni/NOTICE", |
| 473 | installable: false, |
| 474 | include_srcs: true, |
| 475 | } |
| 476 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 477 | // Builds libcore test rules |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 478 | java_library_static { |
| 479 | name: "core-test-rules", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 480 | visibility: [ |
Paul Duffin | 01f6c02 | 2019-09-24 14:44:15 +0100 | [diff] [blame] | 481 | "//external/conscrypt", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 482 | "//frameworks/base/location/tests/locationtests", |
| 483 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 484 | hostdex: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 485 | srcs: [ |
| 486 | "dalvik/test-rules/src/main/**/*.java", |
| 487 | "test-rules/src/main/**/*.java", |
| 488 | ], |
| 489 | static_libs: ["junit"], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 490 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 491 | sdk_version: "none", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 492 | system_modules: "core-all-system-modules", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 493 | } |
| 494 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 495 | // Builds the core-tests-support library used by various tests. |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 496 | java_library_static { |
| 497 | name: "core-tests-support", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 498 | visibility: [ |
| 499 | "//cts/apps/CtsVerifier", |
| 500 | "//cts/tests/tests/keystore", |
| 501 | "//cts/tests/tests/net", |
| 502 | "//cts/tests/tests/net/api23Test", |
| 503 | "//external/apache-harmony", |
| 504 | "//frameworks/base/core/tests/coretests", |
| 505 | "//libcore/benchmarks", |
| 506 | "//packages/apps/KeyChain/tests", |
| 507 | "//system/timezone/distro/core", |
| 508 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 509 | hostdex: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 510 | srcs: ["support/src/test/java/**/*.java"], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 511 | |
Paul Duffin | 53c491f | 2019-06-12 13:48:14 +0100 | [diff] [blame] | 512 | sdk_version: "core_platform", |
Neil Fuller | 4380ab2 | 2018-10-18 19:38:53 +0100 | [diff] [blame] | 513 | libs: ["junit"], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 514 | static_libs: [ |
Neil Fuller | de8b086 | 2018-10-12 21:53:31 +0100 | [diff] [blame] | 515 | "bouncycastle-unbundled", |
| 516 | "bouncycastle-bcpkix-unbundled", |
| 517 | "bouncycastle-ocsp-unbundled", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 518 | ], |
| 519 | } |
| 520 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 521 | // Builds the jsr166-tests library. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 522 | java_test { |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 523 | name: "jsr166-tests", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 524 | visibility: [ |
| 525 | "//cts/tests/libcore/jsr166", |
| 526 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 527 | srcs: ["jsr166-tests/src/test/java/**/*.java"], |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 528 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 529 | system_modules: "core-all-system-modules", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 530 | libs: [ |
| 531 | "junit", |
| 532 | ], |
| 533 | } |
Nan Zhang | 65f27a3 | 2018-01-05 10:41:46 -0800 | [diff] [blame] | 534 | |
Pete Gillin | ec902b8 | 2019-06-26 17:23:00 +0100 | [diff] [blame] | 535 | // A filegroup that provides access to a source file for a toolchain test that |
| 536 | // checks Java 9 language features are handled properly by JarJar. |
| 537 | filegroup { |
| 538 | name: "core-java-9-language-features-source", |
| 539 | srcs: ["luni/src/main/java/libcore/internal/Java9LanguageFeatures.java"], |
| 540 | visibility: ["//libcore/luni/src/test/java9language"], |
| 541 | } |
| 542 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 543 | // Builds the core-tests library. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 544 | java_test { |
| 545 | name: "core-tests", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 546 | visibility: [ |
| 547 | "//cts/tests/libcore/luni", |
| 548 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 549 | defaults: ["libcore_java_defaults"], |
| 550 | hostdex: true, |
| 551 | srcs: [ |
| 552 | "dalvik/src/test/java/**/*.java", |
| 553 | "dalvik/test-rules/src/test/java/**/*.java", |
| 554 | "dom/src/test/java/**/*.java", |
| 555 | "harmony-tests/src/test/java/**/*.java", |
| 556 | "json/src/test/java/**/*.java", |
| 557 | "luni/src/test/java/**/*.java", |
Paul Duffin | 4ba1453 | 2019-03-21 10:32:41 +0000 | [diff] [blame] | 558 | "test-rules/src/test/java/**/*.java", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 559 | "xml/src/test/java/**/*.java", |
| 560 | ], |
| 561 | exclude_srcs: [ |
| 562 | "luni/src/test/java/libcore/java/util/zip/Zip64Test.java", |
| 563 | "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java", |
| 564 | ], |
| 565 | |
| 566 | java_resource_dirs: [ |
| 567 | "*/src/test/java", |
| 568 | "*/src/test/resources", |
| 569 | ], |
| 570 | exclude_java_resource_dirs: [ |
| 571 | "ojluni/src/test/java", |
| 572 | "ojluni/src/test/resources", |
| 573 | ], |
| 574 | |
| 575 | java_resources: [ |
Paul Duffin | 16a057f | 2019-05-13 12:20:55 +0100 | [diff] [blame] | 576 | ":annotations-test", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 577 | ":filesystemstest", |
| 578 | ":parameter-metadata-test", |
| 579 | ], |
| 580 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 581 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 582 | system_modules: "core-all-system-modules", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 583 | libs: [ |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 584 | "okhttp", |
| 585 | "bouncycastle", |
| 586 | ], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 587 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 588 | static_libs: [ |
| 589 | "archive-patcher", |
Pete Gillin | 05a4320 | 2019-06-27 14:41:21 +0100 | [diff] [blame] | 590 | "core-java-9-language-tests", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 591 | "core-test-rules", |
| 592 | "core-tests-support", |
| 593 | "junit-params", |
| 594 | "mockftpserver", |
| 595 | "mockito-target", |
| 596 | "mockwebserver", |
| 597 | "nist-pkix-tests", |
| 598 | "slf4j-jdk14", |
| 599 | "sqlite-jdbc", |
| 600 | "tzdata-testing", |
Paul Duffin | a4df237 | 2018-12-10 15:48:01 +0000 | [diff] [blame] | 601 | "truth-prebuilt", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 602 | ], |
| 603 | |
| 604 | errorprone: { |
| 605 | javacflags: [ |
| 606 | "-Xep:TryFailThrowable:ERROR", |
| 607 | "-Xep:ComparisonOutOfRange:ERROR", |
| 608 | ], |
| 609 | }, |
Simran Basi | 3be01e0 | 2018-08-21 17:53:49 -0700 | [diff] [blame] | 610 | |
| 611 | test_config: "AndroidTest-core-tests.xml", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 612 | } |
| 613 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 614 | // Builds the core-ojtests library that contains test code from OpenJDK. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 615 | java_test { |
| 616 | name: "core-ojtests", |
| 617 | defaults: ["libcore_java_defaults"], |
| 618 | hostdex: true, |
| 619 | |
| 620 | srcs: [ |
| 621 | "ojluni/src/test/java/**/*.java", |
| 622 | ], |
| 623 | java_resource_dirs: [ |
| 624 | "ojluni/src/test/java", |
| 625 | "ojluni/src/test/resources", |
| 626 | ], |
Neil Fuller | b669ccb | 2018-10-04 23:10:27 +0100 | [diff] [blame] | 627 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 628 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 629 | system_modules: "core-all-system-modules", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 630 | libs: [ |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 631 | "okhttp", |
| 632 | "bouncycastle", |
| 633 | ], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 634 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 635 | static_libs: ["testng"], |
| 636 | |
| 637 | // ojluni/src/test/java/util/stream/{bootlib,boottest} |
| 638 | // contains tests that are in packages from java.base; |
| 639 | // By default, OpenJDK 9's javac will only compile such |
| 640 | // code if it's declared to also be in java.base at |
| 641 | // compile time. |
| 642 | // |
| 643 | // For now, we use --patch-module to put all sources |
| 644 | // and dependencies from this make target into java.base; |
| 645 | // other source directories in this make target are in |
| 646 | // packages not from java.base; if this becomes a problem |
| 647 | // in future, this could be addressed eg. by splitting |
| 648 | // boot{lib,test} out into a separate make target, |
| 649 | // deleting those tests or moving them to a different |
| 650 | // package. |
| 651 | patch_module: "java.base", |
| 652 | } |
| 653 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 654 | // Builds the core-ojtests-public library. Excludes any private API tests. |
| 655 | // Like core-ojtests but smaller. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 656 | java_test { |
| 657 | name: "core-ojtests-public", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 658 | visibility: [ |
| 659 | "//cts/tests/libcore/ojluni", |
| 660 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 661 | defaults: ["libcore_java_defaults"], |
| 662 | srcs: [ |
| 663 | "ojluni/src/test/java/**/*.java", |
| 664 | ], |
| 665 | // Filter out the following: |
| 666 | // 1.) DeserializeMethodTest and SerializedLambdaTest, because they depends on stub classes |
| 667 | // and won't actually run, and |
| 668 | // 2.) util/stream/boot*. Those directories contain classes in the package java.util.stream; |
| 669 | // excluding them means we don't need patch_module: "java.base" |
| 670 | exclude_srcs: [ |
| 671 | "**/DeserializeMethodTest.java", |
| 672 | "**/SerializedLambdaTest.java", |
| 673 | "ojluni/src/test/java/util/stream/boot*/**/*", |
| 674 | ], |
| 675 | java_resource_dirs: [ |
| 676 | "ojluni/src/test/java", |
| 677 | "ojluni/src/test/resources", |
| 678 | // Include source code as part of JAR |
| 679 | "ojluni/src/test/dist", |
| 680 | ], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 681 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 682 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 683 | system_modules: "core-all-system-modules", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 684 | libs: [ |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 685 | "bouncycastle", |
| 686 | "okhttp", |
| 687 | "testng", |
| 688 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 689 | } |
| 690 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 691 | // Exports annotated stubs source files in ojluni/annotations/sdk to make them |
| 692 | // available to metalava. Used for nullability annotations in OpenJDK source. |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 693 | droiddoc_exported_dir { |
Pete Gillin | 0728b74 | 2018-09-17 15:41:45 +0100 | [diff] [blame] | 694 | name: "ojluni-annotated-sdk-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 695 | visibility: [ |
| 696 | "//frameworks/base", |
| 697 | ], |
Pete Gillin | 0728b74 | 2018-09-17 15:41:45 +0100 | [diff] [blame] | 698 | path: "ojluni/annotations/sdk", |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 699 | } |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 700 | |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 701 | droiddoc_exported_dir { |
| 702 | name: "ojluni-annotated-nullability-stubs", |
| 703 | path: "ojluni/annotations/sdk/nullability", |
| 704 | } |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 705 | |
| 706 | // Exports annotated stubs source files in ojluni/annotations/mmodules to make |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 707 | // 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] | 708 | // annotations in OpenJDK source. |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 709 | droiddoc_exported_dir { |
| 710 | name: "ojluni-annotated-mmodule-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 711 | visibility: [ |
| 712 | "//libcore/mmodules/core_platform_api", |
| 713 | "//libcore/mmodules/intracoreapi", |
| 714 | ], |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 715 | path: "ojluni/annotations/mmodule", |
| 716 | } |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 717 | |
Neil Fuller | 6f16b46 | 2018-09-04 15:40:39 +0100 | [diff] [blame] | 718 | // A file containing the list of tags that are "known" to us from the OpenJdk |
| 719 | // source code and so should not cause an error or warning. |
Nan Zhang | d55722b | 2018-02-27 15:08:20 -0800 | [diff] [blame] | 720 | filegroup { |
| 721 | name: "known-oj-tags", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 722 | visibility: [ |
| 723 | "//frameworks/base", |
| 724 | ], |
Nan Zhang | d55722b | 2018-02-27 15:08:20 -0800 | [diff] [blame] | 725 | srcs: [ |
| 726 | "known_oj_tags.txt", |
| 727 | ], |
| 728 | } |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 729 | |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 730 | // Generates stubs for the parts of the public SDK API provided by the ART module. |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 731 | // |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 732 | // Only for use by art.module.public.api.stubs target below. |
Nan Zhang | f020760 | 2018-09-10 18:57:38 -0700 | [diff] [blame] | 733 | droidstubs { |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 734 | name: "art-module-public-api-stubs-gen", |
Paul Duffin | 53690cb | 2019-09-19 15:11:28 +0100 | [diff] [blame] | 735 | srcs: [ |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 736 | ":core_oj_api_files", |
| 737 | ":core_libart_api_files", |
Paul Duffin | 53690cb | 2019-09-19 15:11:28 +0100 | [diff] [blame] | 738 | ], |
Tobias Thierer | de99123 | 2018-03-07 15:10:46 +0000 | [diff] [blame] | 739 | java_version: "1.9", |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 740 | installable: false, |
Paul Duffin | 419b242 | 2019-06-25 15:42:05 +0100 | [diff] [blame] | 741 | sdk_version: "none", |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 742 | } |
| 743 | |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 744 | // A stubs target containing the parts of the public SDK API provided by the ART module. |
| 745 | java_library { |
| 746 | name: "art.module.public.api.stubs", |
Paul Duffin | 00b174e | 2019-09-26 16:22:17 +0100 | [diff] [blame] | 747 | visibility: [ |
Paul Duffin | ba71f83 | 2019-09-27 14:54:23 +0100 | [diff] [blame] | 748 | "//external/conscrypt", |
Paul Duffin | 00b174e | 2019-09-26 16:22:17 +0100 | [diff] [blame] | 749 | "//external/icu/android_icu4j", |
| 750 | ], |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 751 | srcs: [":art-module-public-api-stubs-gen"], |
| 752 | errorprone: { |
| 753 | javacflags: [ |
| 754 | "-Xep:MissingOverride:OFF", |
| 755 | ], |
| 756 | }, |
| 757 | openjdk9: { |
| 758 | javacflags: ["--patch-module=java.base=."], |
| 759 | }, |
| 760 | sdk_version: "none", |
| 761 | system_modules: "none", |
| 762 | } |
| 763 | |
| 764 | // Used when compiling higher-level code against art.module.public.api.stubs. |
Paul Duffin | f545bc7 | 2019-10-02 14:07:04 +0100 | [diff] [blame] | 765 | // |
| 766 | // This is only intended for use within core libraries and must not be used |
| 767 | // from outside. |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 768 | java_system_modules { |
| 769 | name: "art-module-public-api-stubs-system-modules", |
| 770 | visibility: [ |
Paul Duffin | ba71f83 | 2019-09-27 14:54:23 +0100 | [diff] [blame] | 771 | "//external/conscrypt", |
Paul Duffin | 00b174e | 2019-09-26 16:22:17 +0100 | [diff] [blame] | 772 | "//external/icu/android_icu4j", |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 773 | "//external/wycheproof", |
| 774 | ], |
| 775 | libs: [ |
| 776 | "art.module.public.api.stubs", |
| 777 | // This one is not on device but it's needed when javac compiles code |
| 778 | // containing lambdas. |
| 779 | "core-lambda-stubs-for-system-modules", |
| 780 | // This one is not on device but it's needed when javac compiles code |
| 781 | // containing @Generated annotations produced by some code generation |
| 782 | // tools. |
| 783 | // See http://b/123891440. |
| 784 | "core-generated-annotation-stubs", |
Paul Duffin | f545bc7 | 2019-10-02 14:07:04 +0100 | [diff] [blame] | 785 | |
| 786 | // Ensure that core libraries that depend on the public API can access |
| 787 | // the UnsupportedAppUsage, CorePlatformApi and IntraCoreApi |
| 788 | // annotations. |
| 789 | "libcore-unsupportedappusage-annotation", |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 790 | ], |
| 791 | } |
| 792 | |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 793 | // A stubs target containing the parts of the public SDK API provided by the |
| 794 | // core library. |
| 795 | // |
| 796 | // Don't use this directly, use "sdk_version: core_current". |
| 797 | java_library { |
| 798 | name: "core.current.stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 799 | visibility: ["//visibility:public"], |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 800 | static_libs: [ |
| 801 | "art.module.public.api.stubs", |
| 802 | "conscrypt.module.public.api.stubs", |
| 803 | "i18n.module.public.api.stubs", |
| 804 | ], |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 805 | sdk_version: "none", |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 806 | system_modules: "none", |
Paul Duffin | 6564118 | 2019-04-08 10:24:23 +0100 | [diff] [blame] | 807 | |
| 808 | dist: { |
| 809 | targets: [ |
| 810 | "sdk", |
| 811 | "win_sdk", |
| 812 | ], |
| 813 | }, |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 814 | } |
| 815 | |
Neil Fuller | 61dabbf | 2018-10-21 22:53:18 +0100 | [diff] [blame] | 816 | // Used when compiling higher-level code against core.current.stubs. |
| 817 | java_system_modules { |
| 818 | name: "core-current-stubs-system-modules", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 819 | visibility: ["//visibility:public"], |
Neil Fuller | 61dabbf | 2018-10-21 22:53:18 +0100 | [diff] [blame] | 820 | libs: [ |
| 821 | "core.current.stubs", |
| 822 | // This one is not on device but it's needed when javac compiles code |
| 823 | // containing lambdas. |
| 824 | "core-lambda-stubs-for-system-modules", |
| 825 | // This one is not on device but it's needed when javac compiles code |
| 826 | // containing @Generated annotations produced by some code generation |
| 827 | // tools. |
| 828 | // See http://b/123891440. |
| 829 | "core-generated-annotation-stubs", |
| 830 | ], |
| 831 | } |
| 832 | |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 833 | // Target for validating nullability annotations for correctness and |
| 834 | // completeness. To check that there are no nullability errors: |
Paul Duffin | bfbfb67 | 2019-10-03 17:53:32 +0100 | [diff] [blame] | 835 | // m art-module-public-api-stubs-nullability-validation |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 836 | // To check that there are only the expected nullability warnings: |
Paul Duffin | bfbfb67 | 2019-10-03 17:53:32 +0100 | [diff] [blame] | 837 | // m art-module-public-api-stubs-nullability-validation-check-nullability-warnings |
Pete Gillin | cdca7f8 | 2019-10-04 13:28:57 +0100 | [diff] [blame] | 838 | // (If that check fails, it will provide instructions on how to proceed, |
| 839 | // including the command to run to update the expected warnings file.) |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 840 | droidstubs { |
Paul Duffin | bfbfb67 | 2019-10-03 17:53:32 +0100 | [diff] [blame] | 841 | name: "art-module-public-api-stubs-nullability-validation", |
| 842 | srcs: [":art_module_api_files"], |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 843 | installable: false, |
Paul Duffin | 419b242 | 2019-06-25 15:42:05 +0100 | [diff] [blame] | 844 | sdk_version: "none", |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 845 | annotations_enabled: true, |
| 846 | args: "--hide-annotation libcore.api.Hide " + |
| 847 | "--validate-nullability-from-merged-stubs ", |
| 848 | merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"], |
| 849 | merge_annotations_dirs: [ |
| 850 | "metalava-manual", |
| 851 | // N.B. Stubs in this filegroup will be validated: |
| 852 | "ojluni-annotated-nullability-stubs", |
| 853 | ], |
Pete Gillin | c5f179b | 2018-11-14 18:42:19 +0000 | [diff] [blame] | 854 | // The list of classes which have nullability annotations included in the source. |
| 855 | // (This is in addition to those which have annotations in the merged stubs.) |
| 856 | validate_nullability_from_list: "nullability_annotated_classes.txt", |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 857 | // The expected set of warnings about missing annotations: |
| 858 | check_nullability_warnings: "nullability_warnings.txt", |
| 859 | } |
| 860 | |
Neil Fuller | e784ef2 | 2018-11-16 15:54:30 +0000 | [diff] [blame] | 861 | // A host library containing time zone related classes. Used for |
| 862 | // host-side tools and tests that have to deal with Android |
| 863 | // time zone data. |
| 864 | java_library_host { |
| 865 | name: "timezone-host", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 866 | visibility: [ |
| 867 | "//system/timezone/distro/core", |
| 868 | ], |
Neil Fuller | e784ef2 | 2018-11-16 15:54:30 +0000 | [diff] [blame] | 869 | srcs: [":timezone_host_files"], |
| 870 | } |
Andrei Onea | 24892e2 | 2019-04-16 16:48:37 +0100 | [diff] [blame] | 871 | |
Paul Duffin | f48513e | 2019-10-07 14:04:04 +0100 | [diff] [blame^] | 872 | // A special set of system modules for building the following library for use |
| 873 | // in the art-module-public-api-system-modules. |
| 874 | java_system_modules { |
| 875 | name: "api-annotations-system-modules", |
| 876 | libs: [ |
| 877 | "art.module.public.api.stubs", |
| 878 | ], |
| 879 | } |
| 880 | |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 881 | // A library that contains annotations not retented in runtime and inline-able constants |
| 882 | // that should not introduce any runtime dependency for compiling core libraries, e.g. core-icu4j, |
| 883 | java_library { |
| 884 | name: "libcore-unsupportedappusage-annotation", |
| 885 | srcs: [ |
| 886 | ":unsupportedappusage_annotation_files", |
| 887 | ], |
| 888 | |
| 889 | installable: false, |
Paul Duffin | f545bc7 | 2019-10-02 14:07:04 +0100 | [diff] [blame] | 890 | sdk_version: "none", |
Paul Duffin | f48513e | 2019-10-07 14:04:04 +0100 | [diff] [blame^] | 891 | system_modules: "api-annotations-system-modules", |
| 892 | patch_module: "java.base", |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 893 | } |
| 894 | |
Andrei Onea | 24892e2 | 2019-04-16 16:48:37 +0100 | [diff] [blame] | 895 | // The source files that contain the UnsupportedAppUsage annotation and its dependencies. |
| 896 | filegroup { |
| 897 | name: "unsupportedappusage_annotation_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 898 | visibility: [ |
| 899 | "//frameworks/base", |
| 900 | ], |
Andrei Onea | 24892e2 | 2019-04-16 16:48:37 +0100 | [diff] [blame] | 901 | srcs: [ |
| 902 | "dalvik/src/main/java/dalvik/annotation/compat/UnsupportedAppUsage.java", |
| 903 | "dalvik/src/main/java/dalvik/system/VersionCodes.java", |
| 904 | "luni/src/main/java/libcore/api/CorePlatformApi.java", |
| 905 | "luni/src/main/java/libcore/api/IntraCoreApi.java", |
| 906 | ], |
Neil Fuller | 86345d7 | 2019-04-25 09:15:32 +0100 | [diff] [blame] | 907 | } |