gerrit/lib/greenmail
David Ostrovsky 0bceb04b26 Bazel: Add support for Java 11 and newer Java versions
VanillaJavaBuilder is used to build with Java 10. It turns out, that the
same approach can be used to support build with newer Java versions.

Rename Bazel config setting from java10 to java_next to reflect that
generic approach, so that we can still use java_next even for Java 12
and later versions.

In Java 11 javax.activation module was removed from the JDK. To rectify,
add this test dependency to greenmail library explicitly, but do it
conditionally, depending on what JDK is used.

Similarly, in Java 11 javax.xml.bind module was removed from the JDK.
JGit's WalkEncryption class transitively depends on it. It seems that
gerrit doesn't use this class, so that we can ignore that for now.
Alternatively, we would have to ship javax.xml.bind:jaxb-api with
Gerrit release.war.

Test Plan:

* To build, run:

  $ bazel build --host_javabase=:absolute_javabase \
    --define=ABSOLUTE_JAVABASE=/usr/lib64/jvm/java-11 \
    --define=USE_ABSOLUTE_JAVABASE=true \
    --host_java_toolchain=//:toolchain_vanilla \
    --java_toolchain=//:toolchain_vanilla \
    :release

* To run the tests, --javabase option must be passed as well, because
bazel test runs the test using the target javabase:

  $ bazel build --host_javabase=:absolute_javabase \
  --javabase=:absolute_javabase \
  [...]
  //...

Change-Id: I4a4b4124048e5f45d7deb75d520ccc3f76443ade
2018-11-07 23:44:01 +01:00
..
BUILD Bazel: Add support for Java 11 and newer Java versions 2018-11-07 23:44:01 +01:00