gerrit/Documentation/BUCK
David Ostrovsky 5dacc8bcc2 Buck: Make deps to $(exe :foo) and $(location :bar) implicitly
Apply [1] on our Buck tree.

[1] https://github.com/facebook/buck/issues/128

Change-Id: Ie3a9de0b2ee3725170bcbd06df059ea5d9ae5252
2014-06-10 07:29:42 +00:00

70 lines
1.5 KiB
Python

include_defs('//Documentation/asciidoc.defs')
include_defs('//Documentation/config.defs')
include_defs('//tools/git.defs')
DOC_DIR = 'Documentation'
MAIN = ['//gerrit-pgm:pgm', '//gerrit-gwtui:ui_module']
SRCS = glob(['*.txt'], excludes = ['licenses.txt'])
genrule(
name = 'html',
cmd = 'cd $TMP;' +
'mkdir -p %s/images;' % DOC_DIR +
'unzip -q $(location %s) -d %s/;'
% (':generate_html', DOC_DIR) +
'for s in $SRCS;do ln -s $s %s;done;' % DOC_DIR +
'mv %s/*.{jpg,png} %s/images;' % (DOC_DIR, DOC_DIR) +
'cp $(location %s) LICENSES.txt;' % ':licenses.txt' +
'zip -qr $OUT *',
srcs = glob([
'images/*.jpg',
'images/*.png',
]) + ['doc.css'],
out = 'html.zip',
visibility = ['PUBLIC'],
)
genasciidoc(
name = 'generate_html',
srcs = SRCS + [':licenses.txt'],
attributes = documentation_attributes(git_describe()),
backend = 'html5',
out = 'only_html.zip',
)
genrule(
name = 'licenses.txt',
cmd = '$(exe :gen_licenses) >$OUT',
deps = [':gen_licenses'] + MAIN,
out = 'licenses.txt',
)
python_binary(
name = 'gen_licenses',
main = 'gen_licenses.py',
)
python_binary(
name = 'replace_macros',
main = 'replace_macros.py',
)
genrule(
name = 'index',
cmd = '$(exe //lib/asciidoctor:doc_indexer) ' +
'-o $OUT ' +
'--prefix "%s/" ' % DOC_DIR +
'--in-ext ".txt" ' +
'--out-ext ".html" ' +
'$SRCS ' +
'$(location :licenses.txt)',
srcs = SRCS,
out = 'index.jar',
)
prebuilt_jar(
name = 'index_lib',
binary_jar = ':index',
visibility = ['PUBLIC'],
)