gerrit/Documentation/BUCK
Shawn Pearce bd69e3e3ec Add Documentation:js_licenses.txt for JavaScript
//Documentation:js_licenses.txt is an optional target to build
the closure of licenses that are compiled into the JavaScript
by the GWT compiler. This is a subset of what is inside of
licenses.txt, but this subset may be necessary in some cases.

Explicitly break some edges that would otherwise by found
in the build graph to avoid dragging in license information
that is not necessary in the partial report created by the
js_licenses.txt target.

Change-Id: Ibbebb3365faf8dccbcd02ad7ef82280255fc5245
2015-06-25 14:26:07 -07:00

81 lines
1.7 KiB
Python

include_defs('//Documentation/asciidoc.defs')
include_defs('//Documentation/config.defs')
include_defs('//tools/git.defs')
DOC_DIR = 'Documentation'
JSUI = ['//gerrit-gwtui:ui_module']
MAIN = ['//gerrit-pgm:pgm'] + JSUI
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) --asciidoc ' + ' '.join(MAIN) + ' >$OUT',
deps = MAIN,
out = 'licenses.txt',
)
# Required by Google for gerrit-review.
genrule(
name = 'js_licenses.txt',
cmd = '$(exe :gen_licenses) --partial ' + ' '.join(JSUI) + ' >$OUT',
deps = JSUI,
out = 'js_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'],
)