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