
This gives us a JSON structure so we don't have to parse .dot output, which is nice. Tweak slightly the algorithm for cutting edges, so that DO_NOT_DISTRIBUTE is only detected if it is actually used. Because of the way Buck computes build cache keys for genrules, we need to handle Java and non-Java dependencies differently; see I09d95176 for a full explanation of this issue. Factor this logic out into a separate defs file for brevity. Change-Id: I6f6268e23074c714324c8e192157c85eb84c73c3
84 lines
1.6 KiB
Python
84 lines
1.6 KiB
Python
include_defs('//Documentation/asciidoc.defs')
|
|
include_defs('//Documentation/config.defs')
|
|
include_defs('//Documentation/license.defs')
|
|
include_defs('//tools/git.defs')
|
|
|
|
DOC_DIR = 'Documentation'
|
|
|
|
JSUI = '//gerrit-gwtui:ui_module'
|
|
MAIN = '//gerrit-pgm:pgm'
|
|
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'],
|
|
)
|
|
|
|
genlicenses(
|
|
name = 'licenses.txt',
|
|
opts = ['--asciidoc'],
|
|
java_deps = [MAIN, JSUI],
|
|
out = 'licenses.txt',
|
|
)
|
|
|
|
# Required by Google for gerrit-review.
|
|
genlicenses(
|
|
name = 'js_licenses.txt',
|
|
opts = ['--partial'],
|
|
java_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'],
|
|
)
|