This is a preparation change to activate RBE build on GCP. Given that javadoc generation currently doesn't work on RBE, see this upstream issue for more details: [1], allow to exclude javadoc generation, and only build the API binaries and sources. [1] https://github.com/bazelbuild/bazel/issues/12765 Change-Id: I5ea4fcd6973786fd087405703205ff9210a9ae35
94 lines
2.0 KiB
Python
94 lines
2.0 KiB
Python
load("//tools/bzl:genrule2.bzl", "genrule2")
|
|
load("//tools/bzl:pkg_war.bzl", "pkg_war")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
config_setting(
|
|
name = "java11",
|
|
values = {
|
|
"java_toolchain": "@bazel_tools//tools/jdk:toolchain_java11",
|
|
},
|
|
)
|
|
|
|
config_setting(
|
|
name = "java_next",
|
|
values = {
|
|
"java_toolchain": "//tools:toolchain_vanilla",
|
|
},
|
|
)
|
|
|
|
genrule(
|
|
name = "gen_version",
|
|
outs = ["version.txt"],
|
|
cmd = ("cat bazel-out/volatile-status.txt bazel-out/stable-status.txt | " +
|
|
"grep STABLE_BUILD_GERRIT_LABEL | cut -d ' ' -f 2 > $@"),
|
|
stamp = 1,
|
|
)
|
|
|
|
genrule(
|
|
name = "LICENSES",
|
|
srcs = ["//Documentation:licenses.txt"],
|
|
outs = ["LICENSES.txt"],
|
|
cmd = "cp $< $@",
|
|
)
|
|
|
|
pkg_war(
|
|
name = "gerrit",
|
|
ui = "polygerrit",
|
|
)
|
|
|
|
pkg_war(
|
|
name = "headless",
|
|
ui = None,
|
|
)
|
|
|
|
pkg_war(
|
|
name = "release",
|
|
context = ["//plugins:core"],
|
|
doc = True,
|
|
)
|
|
|
|
pkg_war(
|
|
name = "withdocs",
|
|
doc = True,
|
|
)
|
|
|
|
API_DEPS = [
|
|
"//java/com/google/gerrit/acceptance:framework_deploy.jar",
|
|
"//java/com/google/gerrit/acceptance:libframework-lib-src.jar",
|
|
"//java/com/google/gerrit/extensions:extension-api_deploy.jar",
|
|
"//java/com/google/gerrit/extensions:libapi-src.jar",
|
|
"//plugins:plugin-api_deploy.jar",
|
|
"//plugins:plugin-api-sources_deploy.jar",
|
|
]
|
|
|
|
API_JAVADOC_DEPS = [
|
|
"//java/com/google/gerrit/acceptance:framework-javadoc",
|
|
"//java/com/google/gerrit/extensions:extension-api-javadoc",
|
|
"//plugins:plugin-api-javadoc",
|
|
]
|
|
|
|
genrule2(
|
|
name = "api",
|
|
testonly = True,
|
|
srcs = API_DEPS + API_JAVADOC_DEPS,
|
|
outs = ["api.zip"],
|
|
cmd = " && ".join([
|
|
"cp $(SRCS) $$TMP",
|
|
"cd $$TMP",
|
|
"zip -qr $$ROOT/$@ .",
|
|
]),
|
|
)
|
|
|
|
genrule2(
|
|
name = "api-skip-javadoc",
|
|
testonly = True,
|
|
srcs = API_DEPS,
|
|
outs = ["api-skip-javadoc.zip"],
|
|
cmd = " && ".join([
|
|
"cp $(SRCS) $$TMP",
|
|
"cd $$TMP",
|
|
"zip -qr $$ROOT/$@ .",
|
|
]),
|
|
)
|