$ bazel run polygerrit-ui:devserver
extension-api
plugin-api
acceptance-framework
bazlets project: reusable Bazel rules for standalone plugin build mode
tools/eclipse/project.py)
$ bazel run polygerrit-ui:devserver
headless.war: without UI
release.war: PolyGerrit UI, core plugins, documentation
$HOME directory
build --disk_cache=~/.gerritcodereview/bazel-cache/cas
$ bazel build //...
gerrit:server target
bazel build --java_toolchain //tools:error_prone_warnings_toolchain //...
kafka-event plugin spawns kafka docker image to run the tests
$ bin/zookeeper-server-start.sh config/zookeeper.properties
$ bin/kafka-server-start.sh config/server.properties
$ bazel test plugins/kafka-events:kafka_events_tests
maven_jar( name = "testcontainers-kafka", artifact = "org.testcontainers:kafka:1.8.0", )
public void setUpTestPlugin() throws Exception { kafka = new KafkaContainer(); kafka.start(); }
$ bazel test plugins/kafka-events:kafka_events_tests
$ bazel build \
--host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java9 \
--java_toolchain=@bazel_tools//tools/jdk:toolchain_java9 \
:release
$ bazel build \
--define=ABSOLUTE_JAVABASE=/usr/lib64/jvm/java-11 \
--host_javabase=@bazel_tools//tools/jdk:absolute_javabase \
--host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
--java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
:release
ABSOLUTE_JAVABASE variable is used to avoid non-portable parts in build files
gerrit.war built with the command above
[container]
javaOptions = --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED
init command.
java.xml.bind module was removed from JDK 11
maven_jar( name = "jaxb-api", artifact = "javax.xml.bind:jaxb-api:2.3.1", )
DatatypeConverter methods from javax.xml.bind module in
WalkEncryption class:
DatatypeConverter#printHexBinary()
DatatypeConverter#parseHexBinary()
$ grep minimum_bazel_version WORKSPACE
versions.check(minimum_bazel_version = "0.19.0")
minimum_bazel_version was only added recently:
$ git checkout v2.14.1 # corresponds to June, 2017
$ grep minimum_bazel_version WORKSPACE
<no match>
$ bazel build gerrit-server:server
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': The native http_archive rule is deprecated. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule.
--incompatible_remove_native_http_archive=false
$ ERROR: /home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/io_bazel_rules_closure/closure/private/defs.bzl:27:16: name 'set' is not defined
baselisk tool: https://github.com/philwo/bazelisk
USE_BAZEL_VERSION is set, it will use the version specified in the value
.bazelversion file exists in the current directory or recursively any parent directory, it will read the file and use the the version specified in it.
latest means the latest stable version of Bazel as released on GitHub.
0.19.0 means that exact version of Bazel.
.bazelisk inside your home directory and will store them there.
David Ostrovsky
Mainatainer, Gerrit Code Review