aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/java_tools
Commit message (Collapse)AuthorAge
* Split classpaths more eagerlyGravatar cushon2017-05-15
| | | | | | | | | | Allow classpath command line options to be whitespace-separated, and store as lists instead of joined strings. This avoids some unnecessary string operations, and keeps command lines below the per-arg limit. A future change will update Bazel to pass unjoined classpaths. PiperOrigin-RevId: 156085128
* Re-enabling passing -sourcepath via javacopts.Gravatar elenairina2017-05-11
| | | | | | | This is needed until java_common.compile will be strong enough to replace java_library, exposing all its features. PiperOrigin-RevId: 155773169
* Avoid windows-incompatible absolute path syntaxGravatar cushon2017-05-11
| | | | | | See #2977 PiperOrigin-RevId: 155711073
* Migrate off versioned javac and Error Prone targetsGravatar Liam Miller-Cushon2017-05-09
| | | | | Change-Id: Iad1e07ad55d5304d7c3dbb8bdab856728a91432d PiperOrigin-RevId: 155375893
* Enable jarjar-ing the Jacoco deploy jar on every supported platform.Gravatar lberki2017-05-08
| | | | | | | The bugs that broke this on Windows ( https://github.com/bazelbuild/bazel/issues/2306 and https://github.com/bazelbuild/bazel/issues/2342 ) have been fixed and FreeBSD has been bootstrapped so we can do this there, too. RELNOTES: None. PiperOrigin-RevId: 155371373
* Use the Java version of singlejar for building the Jacoco coverage runner ↵Gravatar lberki2017-05-08
| | | | | | | | | deploy jar. I thought that didn't work for some reason, but I apparently made a mistake while writing the command line. RELNOTES: None. PiperOrigin-RevId: 155368830
* More windows conditionsGravatar dmarting2017-05-05
| | | | | | | | https://github.com/bazelbuild/bazel/commit/610bf143dd02020e6cd5c94db38ff54c5a504b12 forgot to add them in the tools selection so we were still building C++ singlejar on Windows MSVC where we cannot bootstrap it. PiperOrigin-RevId: 155219067
* Add more condition for the windows platformGravatar dmarting2017-05-05
| | | | | | With MSYS-less version of Bazel for Windows, we have several config settings that correspond to windows, list them all in the select (right now it is breaking our CI: http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=windows-msvc-x86_64/1477/) PiperOrigin-RevId: 155211130
* Make JacocoCoverage_deploy.jar deterministic by running the output of jarjar ↵Gravatar lberki2017-05-05
| | | | | | | | | through `singlejar --normalize`. Fixes #2912. RELNOTES: None. PiperOrigin-RevId: 155193074
* Add a javac-turbine option for the reduced classpath optimizationGravatar cushon2017-05-04
| | | | PiperOrigin-RevId: 155131707
* Clean VanillaJavaBuilder output directoriesGravatar cushon2017-05-04
| | | | | | | | | | to ensure outputs from any previous local builds are discarded. To cherry-pick for #2692. Fixes #2941 PiperOrigin-RevId: 155089391
* JavaBuilder accepts a new --testonly argument to mark compilations ofGravatar eaftan2017-04-27
| | | | | | | test code. Error Prone will use these to distinguish between test and production code, e.g. for enforcing @VisibleForTesting. PiperOrigin-RevId: 154370318
* Prepend javac to test bootclasspathGravatar cushon2017-04-25
| | | | PiperOrigin-RevId: 154098929
* Update to javac9-r4023Gravatar cushon2017-04-25
| | | | PiperOrigin-RevId: 154078281
* Embed a prebuilt jarjar into Bazel so that Android builds work again.Gravatar lberki2017-04-20
| | | | | | | Fixes #2848. RELNOTES: None. PiperOrigin-RevId: 153692641
* Re-enable the Java coverage tests.Gravatar lberki2017-04-18
| | | | | | | | | It has been disabled in https://github.com/bazelbuild/bazel/commit/bce889840f91f14c05418d960984bcf1a5f59411 and in https://github.com/bazelbuild/bazel/commit/21fb8cac60c36cb527d6131ab0092bcdf138d99a and then was not re-enabled. Also update src/java_tools/junitrunner/java/com/google/testing/coverage/BUILD to which I accidentally submitted a change directly to our OSS repository. RELNOTES: None. PiperOrigin-RevId: 153460778
* Simplify LocalSpawnRunnerGravatar ulfjack2017-04-18
| | | | PiperOrigin-RevId: 153444516
* Vendor jarjar instead of using a binary version of it.Gravatar Lukacs T. Berki2017-04-18
| | | | | | | | | | | | | | | It appears that jarjar is not actually used except for renaming classes in the coverage collecting Java test runner as verified by `find . -name BUILD | xargs grep jarjar` Yak shaving for #2820. This is necessary because the current version of jarjar does not work with Java 8 classes because it embeds a version of ASM that doesn't support that yet. Change-Id: I6ac59b84bbbc1e85fe8e7f4f4876b98fc6129df0
* Roll forward of ↵Gravatar cushon2017-04-18
| | | | | | | | https://github.com/bazelbuild/bazel/commit/4a303e2cd840810b95cbc793e38bdca48e6d9556 Only unescape @@-quoted args once PiperOrigin-RevId: 153189611
* Automated g4 rollback of commit b0ac3b41700cdc575c36ff2de191bc9ba2b6abf0.Gravatar cushon2017-04-14
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** kokoro failures were not flakes :( *** Original change description *** Fix escaping of '@' in javabuilder command lines "@" is used to denote params files, so when it appears in labels it is escaped as "@@". The second "@" should be removed during flag parsing to avoid e.g. having it show up in strict deps errors. See bazelbuild/buildtools#83 PiperOrigin-RevId: 153127997
* Fix escaping of '@' in javabuilder command linesGravatar cushon2017-04-14
| | | | | | | | | | "@" is used to denote params files, so when it appears in labels it is escaped as "@@". The second "@" should be removed during flag parsing to avoid e.g. having it show up in strict deps errors. See bazelbuild/buildtools#83 PiperOrigin-RevId: 153098855
* Don't close System.errGravatar cushon2017-04-07
| | | | PiperOrigin-RevId: 152468763
* Remove unused data dependency on JavaBuilderGravatar cushon2017-04-06
| | | | PiperOrigin-RevId: 152336645
* Make encoding diagnostic tests slightly less fragileGravatar cushon2017-04-05
| | | | | | The wording of this diagnostic is changing in Java 9. PiperOrigin-RevId: 152222336
* Create parent directories for resource entries in singlejarGravatar cushon2017-04-05
| | | | | | | This mirrors the change to the c++ implementation made in https://github.com/bazelbuild/bazel/commit/874852ec52f9e03242fb4eccb41c2ea3f3036ac3. PiperOrigin-RevId: 152173345
* Avoid `Iterable<Path>`Gravatar cushon2017-04-05
| | | | | | | The signature of setLocationFromPaths changes in JDK 9, see: https://bugs.openjdk.java.net/browse/JDK-8150111 PiperOrigin-RevId: 152143259
* Roll forward change https://cr.bazel.build/9250 with Java 7 build failure fix.Gravatar xingao2017-04-04
| | | | | | | | | Make Java tool jars available from @bazel_tools. Now users can point to default Java tool jars in customized java_toolchain rule defined in project's BUILD file. PiperOrigin-RevId: 152012191
* Dump the classpaths in a separate file and read the classpaths from that ↵Gravatar Kush Chakraborty2017-03-28
| | | | | | | | | | file, so that each test run can have the latest version of the Classpaths. This does not tackle the case where runfiles are not present, such as windows. -- PiperOrigin-RevId: 151440999 MOS_MIGRATED_REVID=151440999
* Remove support for -bootclasspath in javacoptsGravatar Liam Miller-Cushon2017-03-24
| | | | | | -- PiperOrigin-RevId: 151092346 MOS_MIGRATED_REVID=151092346
* Remove obsolete extdir handlingGravatar Liam Miller-Cushon2017-03-24
| | | | | | -- PiperOrigin-RevId: 151089412 MOS_MIGRATED_REVID=151089412
* Replace ZipOutputFileManager with the standard filemanager and JimFSGravatar Liam Miller-Cushon2017-03-24
| | | | | | | | | | | Now that the standard filemanager supports nio, there's a better-supported way to keep the compilation outputs in memory. ZipOutputFileManager doesn't implement the full filemanager contract, is not compatible with the latest javac 9's. -- PiperOrigin-RevId: 151082823 MOS_MIGRATED_REVID=151082823
* 2nd attempt to split classpaths, and load test classes in a separate ↵Gravatar Kush Chakraborty2017-03-24
| | | | | | | | | | | | | | | | | | | | | | | | classloader. Currently this funcionality is hidden behind the "experimental_testrunner" flag. Original description (from commit 786cfa2ed980e278c42ee474408844f7e3720385): Separate the classpaths of the TestRunner with the test target, and use a separate Classloader to load the test target's classes. This enables a clean separation of the classes of the TestRunner with the target under test. This is achieved with the following steps: 1. Start the test runner with only the bare bones classpaths to the Test Runner's classes which are used by the system ClassLoader. 2. Have all the classpaths required to load the test target's classes in a TEST_TARGET_CLASSPATH environment variable exported by the stub script. 3. Use a new classloader to load all the test target's classes using the paths in TEST_TARGET_CLASSPATH. This additionally enables the persistent test runner (currently experimental), to reload all the target's classes for every subsequent test run, so it can pick up any changes to the classes in between runs. The persistent test runner can be used by adding the argument --test_strategy=experimental_worker to the bazel test command (and having the tag "experimental_testrunner" in the java_test rule). Tested this against: 1. gerrit/gerrit-common:client_tests: Dismal avg. improvement of 580ms to 557ms (just 23ms) 2. intellij/intellij/base:unit_tests: Somewhat modest avg. improvement 1661ms to 913ms (748 ms) -- PiperOrigin-RevId: 151065529 MOS_MIGRATED_REVID=151065529
* Adding -implict:none by default to java compilation.Gravatar Irina Iancu2017-03-23
| | | | | | | | Fixes #2606. -- PiperOrigin-RevId: 150892448 MOS_MIGRATED_REVID=150892448
* Cygwin support: fix junitrunner BUILD file Gravatar László Csomor2017-03-23
| | | | | | | | | | | See https://github.com/bazelbuild/bazel/issues/2725 Related to https://github.com/bazelbuild/bazel/issues/2447 -- Change-Id: I723764ee1b41caf62a7d71abcdcdfb704521f206 Reviewed-on: https://cr.bazel.build/9511 PiperOrigin-RevId: 150882100 MOS_MIGRATED_REVID=150882100
* Add sourcepath to java_common.compileGravatar Irina Iancu2017-03-20
| | | | | | | | | | | | and remove support for -sourcepath through javacopts. Progress on #2606. Supporting -implicit:none by default will be done in an upcoming change. -- PiperOrigin-RevId: 150445185 MOS_MIGRATED_REVID=150445185
* Don't declare parameters of type Iterable<Path>Gravatar Liam Miller-Cushon2017-03-17
| | | | | | | | context: https://bugs.openjdk.java.net/browse/JDK-8150111 -- PiperOrigin-RevId: 150390207 MOS_MIGRATED_REVID=150390207
* --Gravatar Kristina Chodorow2017-03-16
| | | | | PiperOrigin-RevId: 150197521 MOS_MIGRATED_REVID=150197521
* Bring back the persistent test runner functionality, on ExperimentalTestRunner.Gravatar Kush Chakraborty2017-03-09
| | | | | | | | This is essentially a rollforward of commit 7d0561b6ca92d72bd8767d4dca50e5437976812c, and changes triggering the perisitent runner using an environment variable instead of argument as suggested in commit 7d0561b6ca92d72bd8767d4dca50e5437976812c -- PiperOrigin-RevId: 149540564 MOS_MIGRATED_REVID=149540564
* Create ExperimentalTestRunner which is just the same as BazelTestRunner, but ↵Gravatar Kush Chakraborty2017-03-09
| | | | | | | | | | a testbed of upcoming changes, without breaking existing test targets. To use the alternate test runner a java test should add the tag "experimental_testrunner" and depend on "@bazel_tools//tools/jdk:ExperimentalTestRunner_deploy.jar" (instead of @bazel_tools//tools/jdk:TestRunner_deploy.jar) -- PiperOrigin-RevId: 149536298 MOS_MIGRATED_REVID=149536298
* VanillaJavaBuilder: don't crash formatting diagnostics without a source fileGravatar Liam Miller-Cushon2017-03-08
| | | | | | | | Fixes #2646 -- PiperOrigin-RevId: 149448578 MOS_MIGRATED_REVID=149448578
* Disallow duplicate srcjars in javac-turbineGravatar Liam Miller-Cushon2017-03-06
| | | | | | | | | | | | | Also improve srcjar extraction to use zipfs instead of a temp dir, remove the now unused temp dir handling, and use JSR 199 in a slightly more idiomatic way. This fixes a bug affecting srcjar entries that differ only in case when compiling on platforms with case-insensitive filesystems. -- PiperOrigin-RevId: 149175693 MOS_MIGRATED_REVID=149175693
* Pass through -sourcepath to the JavaBuilderGravatar Damien Martin-Guillerez2017-03-06
| | | | | | | | Fix #2606. -- PiperOrigin-RevId: 149096656 MOS_MIGRATED_REVID=149096656
* Eclipse's Java compiler can't do type inference on this code for some reasonGravatar Ulf Adams2017-03-02
| | | | | | | | Workaround by adding explicit types for now. -- PiperOrigin-RevId: 148984433 MOS_MIGRATED_REVID=148984433
* Don't leak file managersGravatar Liam Miller-Cushon2017-03-01
| | | | | | -- PiperOrigin-RevId: 148860690 MOS_MIGRATED_REVID=148860690
* Remind JavacOptions about the '-extra_checks' flagGravatar Liam Miller-Cushon2017-03-01
| | | | | | -- PiperOrigin-RevId: 148843788 MOS_MIGRATED_REVID=148843788
* Re-arrange JavaBuilder output jar handlingGravatar Liam Miller-Cushon2017-02-28
| | | | | | | | To make it more obvious that the JarOutputStream is closed (see #2538). -- PiperOrigin-RevId: 148791125 MOS_MIGRATED_REVID=148791125
* Rollback of commit 786cfa2ed980e278c42ee474408844f7e3720385.Gravatar Kush Chakraborty2017-02-24
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks dagger []: [] *** Original change description *** Separate the classpaths of the TestRunner with the test target, and use a separate Classloader to load the test target's classes. This enables a clean separation of the classes of the TestRunner with the target under test. This is achieved with the following steps: 1. Start the test runner with only the bare bones classpaths to the Test Runner's classes which are used by the system ClassLoader. 2. Have all the classpaths required to load the test target's classes in a TEST_TARGET_CLASSPATH envi... *** -- PiperOrigin-RevId: 148405598 MOS_MIGRATED_REVID=148405598
* Separate the classpaths of the TestRunner with the test target, and use a ↵Gravatar Kush Chakraborty2017-02-23
| | | | | | | | | | | | | | | | | | | | | | separate Classloader to load the test target's classes. This enables a clean separation of the classes of the TestRunner with the target under test. This is achieved with the following steps: 1. Start the test runner with only the bare bones classpaths to the Test Runner's classes which are used by the system ClassLoader. 2. Have all the classpaths required to load the test target's classes in a TEST_TARGET_CLASSPATH environment variable exported by the stub script. 3. Use a new classloader to load all the test target's classes using the paths in TEST_TARGET_CLASSPATH. This additionally enables the persistent test runner (currently experimental), to reload all the target's classes for every subsequent test run, so it can pick up any changes to the classes in between runs. The persistent test runner can be used by adding the argument --test_strategy=experimental_worker to the bazel test command. Tested this against: 1. gerrit/gerrit-common:client_tests: Dismal avg. improvement of 580ms to 557ms (just 23ms) 2. intellij/intellij/base:unit_tests: Somewhat modest avg. improvement 1661ms to 913ms (748 ms) RELNOTES: 1) Java tests and suites will now have to explicitly declare JUnit dependency 2) All non-legacy java_tests will now be run in a -- PiperOrigin-RevId: 148309979 MOS_MIGRATED_REVID=148309979
* Rolling forward the change to open source JUnit integration tests.Gravatar Kush Chakraborty2017-02-23
| | | | | | | | | | | | | | | | | | | | Fixed failures by removing the (expected) failing XML reports from the path, to stop Jenkins from reporting a failure despite passing tests. After removing the XMLs I see jenkins passing where it was previously failing: http://ci.bazel.io/job/Gerrit-bazel-tests/419/ (caused by an un-clean version of this change https://bazel-review.googlesource.com/c/9039/) <Rollback history below> *** Original change description *** Automated [] rollback of commit 9822151a2ab0574b3d7a884f623b6b260258cd6b. *** Reason for rollback *** Jenkins reports the tests as failing. See #2554 for more details. -- PiperOrigin-RevId: 148268951 MOS_MIGRATED_REVID=148268951
* Filter out Blaze-specific javacopts in VanillaJavaBuilderGravatar Liam Miller-Cushon2017-02-23
| | | | | | | | | e.g. Error Prone flags, since VanillaJavaBuilder doesn't support them. -- PiperOrigin-RevId: 148263963 MOS_MIGRATED_REVID=148263963