11d27c8ee8
Latest version of buck is faster than the prior version used by Gerrit. No-op updates when loading a debug version of the UI now take only 1.804s on my laptop (previously 7s) and a draft UI compile is only 24.659s (previously 39s). The slow acceptance tests must now be excluded with `--exclude slow`. Buck changed the meaning of the -e option to be --emulator, which is unfortunately useful only for Android application developers. genrule() now needs to use $(exe) to reference the binary to run, offers $(location) to make it easier to find files in the build tree. The empty srcs array is no longer required for genrule(). Buck has determined it is sufficiently powerful with $(location) and deps that requiring srcs is unnecessary. Supporting .src.zip files in the srcs array of java_library() means Gerrit no longer needs to run a separate genrule() to extract files produced by ANTLR, or call javac inside of the BuckPrologCompiler support glue. Change-Id: Ib03042921a081b867a7aad0423bd45523e42917a
62 lines
1.4 KiB
Python
62 lines
1.4 KiB
Python
include_defs('//Documentation/asciidoc.defs')
|
|
|
|
MAIN = ['//gerrit-pgm:pgm', '//gerrit-gwtui:ui_module']
|
|
SRCS = glob(['*.txt'], excludes = ['licenses.txt'])
|
|
HTML = [txt[0:-4] + '.html' for txt in SRCS]
|
|
|
|
genrule(
|
|
name = 'html',
|
|
cmd = 'cd $TMP;' +
|
|
'mkdir -p Documentation/images;' +
|
|
'for s in $SRCS;do ln -s $s Documentation;done;' +
|
|
'mv Documentation/*.{jpg,png} Documentation/images;' +
|
|
'rm Documentation/licenses.txt;' +
|
|
'ln -s $SRCDIR/licenses.txt LICENSES.txt;' +
|
|
'zip -qr $OUT *',
|
|
srcs = [genfile(d) for d in HTML] +
|
|
glob([
|
|
'images/*.jpg',
|
|
'images/*.png',
|
|
]) + [
|
|
genfile('licenses.html'),
|
|
genfile('licenses.txt'),
|
|
],
|
|
deps = [':' + d for d in HTML] + [
|
|
':licenses.html',
|
|
':licenses.txt',
|
|
],
|
|
out = 'html.zip',
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
genasciidoc(
|
|
name = 'generate_html',
|
|
srcs = SRCS + [genfile('licenses.txt')],
|
|
outs = HTML + ['licenses.html'],
|
|
deps = [':config', ':licenses.txt'],
|
|
attributes = ['toc', 'newline="\\n"'],
|
|
backend = 'xhtml11',
|
|
conf_file = genfile('asciidoc.conf'),
|
|
)
|
|
|
|
genrule(
|
|
name = 'licenses.txt',
|
|
cmd = '$(exe :gen_licenses) >$OUT',
|
|
deps = [':gen_licenses'] + MAIN,
|
|
out = 'licenses.txt',
|
|
)
|
|
|
|
genrule(
|
|
name = 'config',
|
|
cmd = 'cp $SRCS $OUT &&' +
|
|
'echo "[attributes]" >>$OUT &&' +
|
|
'echo "revision=`git describe HEAD`" >>$OUT',
|
|
srcs = ['asciidoc.conf'],
|
|
out = 'asciidoc.conf',
|
|
)
|
|
|
|
python_binary(
|
|
name = 'gen_licenses',
|
|
main = 'gen_licenses.py',
|
|
)
|