gerrit/Documentation/BUCK
Yuxuan 'fishy' Wang f780397780 Add buck rule to generate docs for static hosting.
Add rule to build search-free documentation for static hosting, and update
dev-release documentation to reflect the new rule.

Change-Id: Ifc9284d3c44349e3099ad582fcc14ba27695f30a
2014-09-05 14:19:15 -07:00

72 lines
1.4 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'])
genasciidoc(
name = 'html',
out = 'html.zip',
docdir = DOC_DIR,
srcs = SRCS + [':licenses.txt'],
attributes = documentation_attributes(git_describe()),
backend = 'html5',
visibility = ['PUBLIC'],
)
genasciidoc(
name = 'searchfree',
out = 'searchfree.zip',
docdir = DOC_DIR,
srcs = SRCS + [':licenses.txt'],
attributes = documentation_attributes(git_describe()),
backend = 'html5',
searchbox = False,
visibility = ['PUBLIC'],
)
genrule(
name = 'licenses.txt',
cmd = '$(exe :gen_licenses) >$OUT',
deps = [':gen_licenses'] + MAIN,
out = 'licenses.txt',
)
genrule(
name = 'doc.css',
srcs = ['doc.css.in'],
cmd = 'cp $SRCS $OUT',
out = 'doc.css',
)
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'],
)