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 | // |
| 16 | // Definitions for building the Java library and associated tests. |
| 17 | // |
| 18 | |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 19 | // libcore has some sub-directories that follow a common structure: |
| 20 | // e.g. dalvik, dom, harmony-tests, json, jsr166-tests, luni, libart, ojluni, |
| 21 | // support, xml, xmlpull. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 22 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 23 | // The structure of these is generally: |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 24 | // |
| 25 | // src/ |
| 26 | // main/ # To be shipped on every device. |
| 27 | // java/ # Java source for library code. |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 28 | // native/ # C/C++ source for library code. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 29 | // resources/ # Support files. |
| 30 | // test/ # Built only on demand, for testing. |
| 31 | // java/ # Java source for tests. |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 32 | // native/ # C/C++ source for tests (rare). |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 33 | // resources/ # Support files. |
| 34 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 35 | // All subdirectories are optional. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 36 | |
| 37 | build = [ |
| 38 | "openjdk_java_files.bp", |
| 39 | "non_openjdk_java_files.bp", |
| 40 | ] |
| 41 | |
| 42 | // The Java files and their associated resources. |
| 43 | core_resource_dirs = [ |
| 44 | "luni/src/main/java", |
| 45 | "ojluni/src/main/resources/", |
| 46 | ] |
| 47 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 48 | // The source files that go into core-oj. |
| 49 | filegroup { |
| 50 | name: "core_oj_java_files", |
| 51 | srcs: [":openjdk_java_files"], |
| 52 | } |
| 53 | |
| 54 | // OpenJDK source is not annotated with @hide so we need a separate |
| 55 | // filegroup for just the parts that contribute to the API. |
| 56 | filegroup { |
| 57 | name: "core_oj_api_files", |
| 58 | srcs: [":openjdk_javadoc_files"], |
| 59 | } |
| 60 | |
| 61 | // The source files that go into core-libart. |
| 62 | filegroup { |
| 63 | name: "core_libart_java_files", |
| 64 | srcs: [ |
| 65 | ":non_openjdk_java_files", |
| 66 | ":android_icu4j_src_files", |
| 67 | ], |
| 68 | } |
| 69 | |
| 70 | // Some parts of libart are not annotated with @hide so we need a separate |
| 71 | // filegroup for just the parts that contribute to the API. |
| 72 | filegroup { |
| 73 | name: "core_libart_api_files", |
| 74 | srcs: [ |
| 75 | ":non_openjdk_javadoc_files", |
| 76 | ":android_icu4j_src_files", |
| 77 | ], |
| 78 | } |
| 79 | |
| 80 | // The set of files in core that have been marked up with @hide and API-related |
| 81 | // annotations. |
| 82 | filegroup { |
| 83 | name: "core_api_files", |
| 84 | srcs: [ |
Neil Fuller | a77f710 | 2018-09-21 19:04:41 +0100 | [diff] [blame] | 85 | ":bouncycastle_java_files", |
Neil Fuller | 603e1a7 | 2018-09-25 11:55:41 +0100 | [diff] [blame] | 86 | ":conscrypt_java_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 87 | ":core_oj_api_files", |
| 88 | ":core_libart_api_files", |
| 89 | ":core_simple_java_files", |
Neil Fuller | 641d5f9 | 2018-09-24 15:40:39 +0100 | [diff] [blame] | 90 | ":okhttp_api_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 91 | ], |
| 92 | } |
| 93 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 94 | java_defaults { |
| 95 | name: "libcore_java_defaults", |
| 96 | javacflags: [ |
| 97 | //"-Xlint:all", |
| 98 | //"-Xlint:-serial,-deprecation,-unchecked", |
| 99 | ], |
| 100 | dxflags: ["--core-library"], |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 101 | errorprone: { |
| 102 | javacflags: [ |
| 103 | "-Xep:MissingOverride:OFF", // Ignore missing @Override. |
Andreas Gampe | 24a2017 | 2018-06-13 11:28:45 -0700 | [diff] [blame] | 104 | "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 105 | ], |
| 106 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | // |
| 110 | // Build for the target (device). |
| 111 | // |
| 112 | |
Victor Chang | 7fef405 | 2018-09-25 14:12:03 +0100 | [diff] [blame^] | 113 | // Rule generating resource lib for android_icu4j. |
| 114 | // In the downstream branch master-icu-dev, the resource files are generated. |
| 115 | // This rule can't be moved external/icu because soong enforces that no_standard_libs:true can only |
| 116 | // be used in libcore/ or development/ |
| 117 | java_library { |
| 118 | name: "android_icu4j_resources_lib", |
| 119 | java_resources: [":android_icu4j_resources"], |
| 120 | no_standard_libs: true, |
| 121 | system_modules: "none", |
| 122 | } |
| 123 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 124 | java_library { |
| 125 | name: "core-all", |
| 126 | defaults: ["libcore_java_defaults"], |
| 127 | |
| 128 | srcs: [ |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 129 | ":core_oj_java_files", |
| 130 | ":core_libart_java_files", |
| 131 | ":core_simple_java_files", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 132 | ":openjdk_lambda_stub_files", |
| 133 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 134 | |
| 135 | no_standard_libs: true, |
| 136 | system_modules: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 137 | openjdk9: { |
| 138 | srcs: ["luni/src/module/java/module-info.java"], |
| 139 | javacflags: ["--patch-module=java.base=."], |
| 140 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 141 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 142 | java_resource_dirs: core_resource_dirs, |
Victor Chang | 7fef405 | 2018-09-25 14:12:03 +0100 | [diff] [blame^] | 143 | static_libs: ["android_icu4j_resources_lib"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 144 | |
| 145 | required: [ |
| 146 | "tzdata", |
| 147 | "tzlookup.xml", |
| 148 | ], |
| 149 | |
| 150 | installable: false, |
| 151 | } |
| 152 | |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 153 | java_system_modules { |
| 154 | name: "core-all-system-modules", |
| 155 | libs: ["core-all"], |
| 156 | } |
| 157 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 158 | java_library { |
| 159 | name: "core-oj", |
| 160 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 161 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 162 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 163 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 164 | srcs: [":core_oj_java_files"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 165 | java_resource_dirs: core_resource_dirs, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 166 | |
| 167 | no_standard_libs: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 168 | libs: ["core-all"], |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 169 | system_modules: "core-all-system-modules", |
| 170 | openjdk9: { |
| 171 | javacflags: ["--patch-module=java.base=."], |
| 172 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 173 | |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 174 | jacoco: { |
Pete Gillin | 27ca058 | 2018-01-10 17:04:17 +0000 | [diff] [blame] | 175 | exclude_filter: [ |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 176 | "java.lang.Class", |
| 177 | "java.lang.Long", |
| 178 | "java.lang.Number", |
| 179 | "java.lang.Object", |
| 180 | "java.lang.String", |
| 181 | "java.lang.invoke.MethodHandle", |
| 182 | "java.lang.ref.Reference", |
| 183 | "java.lang.reflect.Proxy", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 184 | "java.util.AbstractMap", |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 185 | "java.util.HashMap", |
| 186 | "java.util.HashMap$Node", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 187 | "java.util.Map", |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 188 | ], |
| 189 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 190 | |
| 191 | notice: "ojluni/NOTICE", |
| 192 | |
| 193 | required: [ |
| 194 | "tzdata", |
| 195 | "tzlookup.xml", |
| 196 | ], |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 197 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | // Definitions to make the core library. |
| 201 | java_library { |
| 202 | name: "core-libart", |
| 203 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 204 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 205 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 206 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 207 | srcs: [":core_libart_java_files"], |
Victor Chang | 7fef405 | 2018-09-25 14:12:03 +0100 | [diff] [blame^] | 208 | static_libs: ["android_icu4j_resources_lib"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 209 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 210 | no_standard_libs: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 211 | libs: ["core-all"], |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 212 | system_modules: "core-all-system-modules", |
| 213 | openjdk9: { |
| 214 | javacflags: ["--patch-module=java.base=."], |
| 215 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 216 | |
Pete Gillin | 80ebe87 | 2018-02-13 15:21:20 +0000 | [diff] [blame] | 217 | jacoco: { |
| 218 | exclude_filter: [ |
| 219 | "java.lang.DexCache", |
| 220 | "dalvik.system.ClassExt", |
| 221 | ], |
| 222 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 223 | |
| 224 | required: [ |
| 225 | "tzdata", |
| 226 | "tzlookup.xml", |
| 227 | ], |
| 228 | } |
| 229 | |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 230 | // A guaranteed unstripped version of core-oj and core-libart. |
| 231 | // The build system may or may not strip the core-oj and core-libart jars, |
| 232 | // but these will not be stripped. See b/24535627. |
| 233 | java_library { |
| 234 | name: "core-oj-testdex", |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 235 | installable: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 236 | static_libs: ["core-oj"], |
| 237 | no_standard_libs: true, |
| 238 | libs: ["core-all"], |
| 239 | system_modules: "core-all-system-modules", |
| 240 | dxflags: ["--core-library"], |
Colin Cross | 485ed36 | 2017-12-05 17:24:22 -0800 | [diff] [blame] | 241 | dex_preopt: { |
| 242 | enabled: false, |
| 243 | }, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 244 | notice: "ojluni/NOTICE", |
| 245 | required: [ |
| 246 | "tzdata", |
| 247 | "tzlookup.xml", |
| 248 | ], |
| 249 | } |
| 250 | |
| 251 | java_library { |
| 252 | name: "core-libart-testdex", |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 253 | installable: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 254 | static_libs: ["core-libart"], |
| 255 | no_standard_libs: true, |
| 256 | libs: ["core-all"], |
| 257 | system_modules: "core-all-system-modules", |
| 258 | dxflags: ["--core-library"], |
Colin Cross | 485ed36 | 2017-12-05 17:24:22 -0800 | [diff] [blame] | 259 | dex_preopt: { |
| 260 | enabled: false, |
| 261 | }, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 262 | notice: "ojluni/NOTICE", |
| 263 | required: [ |
| 264 | "tzdata", |
| 265 | "tzlookup.xml", |
| 266 | ], |
| 267 | } |
| 268 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 269 | // A library that exists to satisfy javac when |
| 270 | // compiling source code that contains lambdas. |
| 271 | java_library { |
| 272 | name: "core-lambda-stubs", |
| 273 | defaults: ["libcore_java_defaults"], |
| 274 | |
| 275 | srcs: [ |
| 276 | ":openjdk_lambda_stub_files", |
| 277 | ":openjdk_lambda_duplicate_stub_files", |
| 278 | ], |
| 279 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 280 | no_standard_libs: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 281 | libs: ["core-all"], |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 282 | system_modules: "core-all-system-modules", |
| 283 | openjdk9: { |
| 284 | javacflags: ["--patch-module=java.base=."], |
| 285 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 286 | |
| 287 | notice: "ojluni/NOTICE", |
| 288 | |
| 289 | installable: false, |
| 290 | include_srcs: true, |
| 291 | } |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 292 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 293 | // The libraries that make up core. |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 294 | java_system_modules { |
| 295 | name: "core-system-modules", |
| 296 | libs: [ |
| 297 | "core-oj", |
| 298 | "core-libart", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 299 | "core-simple", |
| 300 | // This one is not on device but it's needed when javac compiles code |
| 301 | // containing lambdas. |
| 302 | "core-lambda-stubs" |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 303 | ], |
| 304 | } |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 305 | |
| 306 | // Build libcore test rules |
| 307 | java_library_static { |
| 308 | name: "core-test-rules", |
| 309 | hostdex: true, |
| 310 | no_framework_libs: true, |
| 311 | srcs: [ |
| 312 | "dalvik/test-rules/src/main/**/*.java", |
| 313 | "test-rules/src/main/**/*.java", |
| 314 | ], |
| 315 | static_libs: ["junit"], |
| 316 | } |
| 317 | |
| 318 | // Make the core-tests-support library. |
| 319 | java_library_static { |
| 320 | name: "core-tests-support", |
| 321 | hostdex: true, |
| 322 | no_framework_libs: true, |
| 323 | srcs: ["support/src/test/java/**/*.java"], |
| 324 | libs: [ |
| 325 | "junit", |
| 326 | "bouncycastle", |
| 327 | ], |
| 328 | static_libs: [ |
| 329 | "bouncycastle-bcpkix", |
| 330 | "bouncycastle-ocsp", |
| 331 | ], |
| 332 | } |
| 333 | |
| 334 | // Make the jsr166-tests library. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 335 | java_test { |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 336 | name: "jsr166-tests", |
| 337 | srcs: ["jsr166-tests/src/test/java/**/*.java"], |
| 338 | no_framework_libs: true, |
| 339 | libs: [ |
| 340 | "junit", |
| 341 | ], |
| 342 | } |
Nan Zhang | 65f27a3 | 2018-01-05 10:41:46 -0800 | [diff] [blame] | 343 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 344 | // Build a library just containing files from luni/src/test/filesystems for use in tests. |
| 345 | java_library { |
| 346 | name: "filesystemstest", |
| 347 | compile_dex: true, |
| 348 | srcs: ["luni/src/test/filesystems/src/**/*.java"], |
| 349 | java_resource_dirs: ["luni/src/test/filesystems/resources"], |
| 350 | no_framework_libs: true, |
| 351 | errorprone: { |
| 352 | javacflags: ["-Xep:MissingOverride:OFF"], |
| 353 | }, |
| 354 | } |
| 355 | |
| 356 | // Build a library just containing files from luni/src/test/parameter_metadata for use in tests. |
| 357 | java_library { |
| 358 | name: "parameter-metadata-test", |
| 359 | compile_dex: true, |
| 360 | srcs: ["luni/src/test/parameter_metadata/src/**/*.java"], |
| 361 | no_framework_libs: true, |
| 362 | javacflags: ["-parameters"], |
| 363 | errorprone: { |
| 364 | javacflags: ["-Xep:MissingOverride:OFF"], |
| 365 | }, |
| 366 | } |
| 367 | |
| 368 | // Make the core-tests library. |
| 369 | java_test { |
| 370 | name: "core-tests", |
| 371 | defaults: ["libcore_java_defaults"], |
| 372 | hostdex: true, |
Roland Levillain | 5e028a2 | 2018-08-17 17:33:59 +0100 | [diff] [blame] | 373 | no_framework_libs: true, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 374 | srcs: [ |
| 375 | "dalvik/src/test/java/**/*.java", |
| 376 | "dalvik/test-rules/src/test/java/**/*.java", |
| 377 | "dom/src/test/java/**/*.java", |
| 378 | "harmony-tests/src/test/java/**/*.java", |
| 379 | "json/src/test/java/**/*.java", |
| 380 | "luni/src/test/java/**/*.java", |
| 381 | "xml/src/test/java/**/*.java", |
| 382 | ], |
| 383 | exclude_srcs: [ |
| 384 | "luni/src/test/java/libcore/java/util/zip/Zip64Test.java", |
| 385 | "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java", |
| 386 | ], |
| 387 | |
| 388 | java_resource_dirs: [ |
| 389 | "*/src/test/java", |
| 390 | "*/src/test/resources", |
| 391 | ], |
| 392 | exclude_java_resource_dirs: [ |
| 393 | "ojluni/src/test/java", |
| 394 | "ojluni/src/test/resources", |
| 395 | ], |
| 396 | |
| 397 | java_resources: [ |
| 398 | ":filesystemstest", |
| 399 | ":parameter-metadata-test", |
| 400 | ], |
| 401 | |
| 402 | libs: [ |
| 403 | "okhttp", |
| 404 | "bouncycastle", |
| 405 | ], |
| 406 | static_libs: [ |
| 407 | "archive-patcher", |
| 408 | "core-test-rules", |
| 409 | "core-tests-support", |
| 410 | "junit-params", |
| 411 | "mockftpserver", |
| 412 | "mockito-target", |
| 413 | "mockwebserver", |
| 414 | "nist-pkix-tests", |
| 415 | "slf4j-jdk14", |
| 416 | "sqlite-jdbc", |
| 417 | "tzdata-testing", |
| 418 | ], |
| 419 | |
| 420 | errorprone: { |
| 421 | javacflags: [ |
| 422 | "-Xep:TryFailThrowable:ERROR", |
| 423 | "-Xep:ComparisonOutOfRange:ERROR", |
| 424 | ], |
| 425 | }, |
Simran Basi | 3be01e0 | 2018-08-21 17:53:49 -0700 | [diff] [blame] | 426 | |
| 427 | test_config: "AndroidTest-core-tests.xml", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 428 | } |
| 429 | |
| 430 | // Make the core-ojtests library. |
| 431 | java_test { |
| 432 | name: "core-ojtests", |
| 433 | defaults: ["libcore_java_defaults"], |
| 434 | hostdex: true, |
Roland Levillain | 5e028a2 | 2018-08-17 17:33:59 +0100 | [diff] [blame] | 435 | no_framework_libs: true, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 436 | |
| 437 | srcs: [ |
| 438 | "ojluni/src/test/java/**/*.java", |
| 439 | ], |
| 440 | java_resource_dirs: [ |
| 441 | "ojluni/src/test/java", |
| 442 | "ojluni/src/test/resources", |
| 443 | ], |
| 444 | libs: [ |
| 445 | "okhttp", |
| 446 | "bouncycastle", |
| 447 | ], |
| 448 | static_libs: ["testng"], |
| 449 | |
| 450 | // ojluni/src/test/java/util/stream/{bootlib,boottest} |
| 451 | // contains tests that are in packages from java.base; |
| 452 | // By default, OpenJDK 9's javac will only compile such |
| 453 | // code if it's declared to also be in java.base at |
| 454 | // compile time. |
| 455 | // |
| 456 | // For now, we use --patch-module to put all sources |
| 457 | // and dependencies from this make target into java.base; |
| 458 | // other source directories in this make target are in |
| 459 | // packages not from java.base; if this becomes a problem |
| 460 | // in future, this could be addressed eg. by splitting |
| 461 | // boot{lib,test} out into a separate make target, |
| 462 | // deleting those tests or moving them to a different |
| 463 | // package. |
| 464 | patch_module: "java.base", |
| 465 | } |
| 466 | |
| 467 | // Make the core-ojtests-public library. Excludes any private API tests. |
| 468 | java_test { |
| 469 | name: "core-ojtests-public", |
| 470 | defaults: ["libcore_java_defaults"], |
Roland Levillain | 5e028a2 | 2018-08-17 17:33:59 +0100 | [diff] [blame] | 471 | no_framework_libs: true, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 472 | srcs: [ |
| 473 | "ojluni/src/test/java/**/*.java", |
| 474 | ], |
| 475 | // Filter out the following: |
| 476 | // 1.) DeserializeMethodTest and SerializedLambdaTest, because they depends on stub classes |
| 477 | // and won't actually run, and |
| 478 | // 2.) util/stream/boot*. Those directories contain classes in the package java.util.stream; |
| 479 | // excluding them means we don't need patch_module: "java.base" |
| 480 | exclude_srcs: [ |
| 481 | "**/DeserializeMethodTest.java", |
| 482 | "**/SerializedLambdaTest.java", |
| 483 | "ojluni/src/test/java/util/stream/boot*/**/*", |
| 484 | ], |
| 485 | java_resource_dirs: [ |
| 486 | "ojluni/src/test/java", |
| 487 | "ojluni/src/test/resources", |
| 488 | // Include source code as part of JAR |
| 489 | "ojluni/src/test/dist", |
| 490 | ], |
| 491 | libs: [ |
| 492 | "bouncycastle", |
| 493 | "okhttp", |
| 494 | "testng", |
| 495 | ], |
| 496 | } |
| 497 | |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 498 | // Make the annotated stubs in ojluni/annotations available to metalava: |
| 499 | droiddoc_exported_dir { |
Pete Gillin | 0728b74 | 2018-09-17 15:41:45 +0100 | [diff] [blame] | 500 | name: "ojluni-annotated-sdk-stubs", |
| 501 | path: "ojluni/annotations/sdk", |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 502 | } |
| 503 | |
Neil Fuller | 6f16b46 | 2018-09-04 15:40:39 +0100 | [diff] [blame] | 504 | // A file containing the list of tags that are "known" to us from the OpenJdk |
| 505 | // source code and so should not cause an error or warning. |
Nan Zhang | d55722b | 2018-02-27 15:08:20 -0800 | [diff] [blame] | 506 | filegroup { |
| 507 | name: "known-oj-tags", |
| 508 | srcs: [ |
| 509 | "known_oj_tags.txt", |
| 510 | ], |
| 511 | } |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 512 | |
Neil Fuller | a6ba359 | 2018-09-21 13:19:37 +0100 | [diff] [blame] | 513 | // Stubs for the parts of the public SDK API provided by the core libraries. |
Nan Zhang | f020760 | 2018-09-10 18:57:38 -0700 | [diff] [blame] | 514 | droidstubs { |
| 515 | name: "core-current-stubs-gen", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 516 | srcs: [":core_api_files"], |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 517 | installable: false, |
| 518 | no_framework_libs: true, |
Nan Zhang | 68c55b4 | 2018-08-21 17:31:51 +0000 | [diff] [blame] | 519 | args: " --exclude-annotations", |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 520 | } |
| 521 | |
Neil Fuller | a6ba359 | 2018-09-21 13:19:37 +0100 | [diff] [blame] | 522 | // A library containing the parts of the public SDK API provided by the core libraries. |
| 523 | // Don't use this directly, use "sdk_version: core_current". |
| 524 | java_library { |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 525 | name: "core.current.stubs", |
Nan Zhang | f020760 | 2018-09-10 18:57:38 -0700 | [diff] [blame] | 526 | srcs: [":core-current-stubs-gen"], |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 527 | errorprone: { |
| 528 | javacflags: [ |
| 529 | "-Xep:MissingOverride:OFF", |
| 530 | ], |
| 531 | }, |
Tobias Thierer | 496a938 | 2018-06-12 14:09:11 +0100 | [diff] [blame] | 532 | openjdk9: { |
| 533 | javacflags: ["--patch-module=java.base=."], |
| 534 | }, |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 535 | no_standard_libs: true, |
| 536 | system_modules: "none", |
| 537 | } |