bazel: build a polygerrit war too.

Change-Id: Id45967aa844faedee3ab501491cd30cdb903a789
This commit is contained in:
Han-Wen Nienhuys
2016-10-20 14:58:01 +02:00
committed by David Ostrovsky
parent e48abffbca
commit da5999b039
4 changed files with 20 additions and 9 deletions

4
BUILD
View File

@@ -20,3 +20,7 @@ genrule(
pkg_war(name = 'gerrit')
pkg_war(name = 'headless', ui = None)
pkg_war(name = 'release', ui = 'ui_optdbg_r', context = ['//plugins:core'])
pkg_war(
name = "polygerrit",
ui = "polygerrit"
)

View File

@@ -38,15 +38,18 @@ To build the Gerrit web application that includes GWT UI and PolyGerrit UI:
bazel build gerrit
----
[NOTE]
PolyGerrit UI not yet working.
The output executable WAR will be placed in:
----
bazel-bin/gerrit.war
----
to run,
----
$(bazel info output_base)/external/local_jdk/bin/java \
-jar bazel-bin/release.war daemon -d ../gerrit_testsite
----
=== Headless Mode

View File

@@ -53,10 +53,11 @@ def _add_file(in_file, output):
]
def _make_war(input_dir, output):
return ''.join([
'(root=$(pwd) && ',
'cd %s && ' % input_dir,
'zip -9qr ${root}/%s .)' % (output.path),
return '(%s)' % ' && '.join([
'root=$(pwd)',
'cd %s' % input_dir,
"find . -exec touch -t 198001010000 '{}' ';' 2> /dev/null",
'zip -9qr ${root}/%s .' % (output.path),
])
def _war_impl(ctx):
@@ -126,8 +127,11 @@ _pkg_war = rule(
def pkg_war(name, ui = 'ui_optdbg', context = [], **kwargs):
ui_deps = []
if ui:
if ui == 'polygerrit' or ui == 'ui_optdbg' or ui == 'ui_optdbg_r':
ui_deps.append('//polygerrit-ui/app:polygerrit_ui')
if ui != 'polygerrit':
ui_deps.append('//gerrit-gwtui:%s' % ui)
_pkg_war(
name = name,
libs = LIBS,