gerrit/BUILD
David Ostrovsky 26f8da8f4d Bazel: Add :api rule to build all API artifacts at once
This simplifies house keeping for the CI implementations and this was
always supported in Buck driven build. Wenn new API is added, only one
rule needs to be updated, and all CI implementation would reflect
building of new API without any changes on their side.

Change-Id: I050cef1e1545431d8806bd3a15a267842e3ed809
2016-12-24 09:33:27 +01:00

73 lines
1.7 KiB
Python

package(default_visibility = ["//visibility:public"])
load("//tools/bzl:genrule2.bzl", "genrule2")
load("//tools/bzl:pkg_war.bzl", "pkg_war")
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,
visibility = ["//visibility:public"],
)
genrule(
name = "LICENSES",
srcs = ["//Documentation:licenses.txt"],
outs = ["LICENSES.txt"],
cmd = "cp $< $@",
visibility = ["//visibility:public"],
)
pkg_war(name = "gerrit")
pkg_war(
name = "headless",
ui = None,
)
pkg_war(
name = "polygerrit",
ui = "polygerrit",
)
pkg_war(
name = "release",
context = ["//plugins:core"],
doc = True,
ui = "ui_optdbg_r",
)
pkg_war(
name = "withdocs",
doc = True,
)
API_DEPS = [
"//gerrit-acceptance-framework:acceptance-framework_deploy.jar",
"//gerrit-acceptance-framework:liblib-src.jar",
"//gerrit-acceptance-framework:acceptance-framework-javadoc",
"//gerrit-extension-api:extension-api_deploy.jar",
"//gerrit-extension-api:libapi-src.jar",
"//gerrit-extension-api:extension-api-javadoc",
"//gerrit-plugin-api:plugin-api_deploy.jar",
"//gerrit-plugin-api:plugin-api-sources_deploy.jar",
"//gerrit-plugin-api:plugin-api-javadoc",
"//gerrit-plugin-gwtui:gwtui-api_deploy.jar",
"//gerrit-plugin-gwtui:gwtui-api-source_deploy.jar",
"//gerrit-plugin-gwtui:gwtui-api-javadoc",
]
genrule2(
name = 'api',
srcs = API_DEPS,
testonly = 1,
cmd = ' && '.join([
'cp $(SRCS) $$TMP',
'cd $$TMP',
'zip -qr $$ROOT/$@ .',
]),
outs = ['api.zip'],
)