include_defs('//Documentation/asciidoc.defs') include_defs('//Documentation/config.defs') include_defs('//tools/git.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;' + 'cp $SRCDIR/licenses.txt LICENSES.txt;' + 'zip -qr $OUT *', srcs = [genfile(d) for d in HTML] + glob([ 'images/*.jpg', 'images/*.png', ]) + [ genfile('doc.css'), genfile('licenses.html'), genfile('licenses.txt'), ], deps = [':' + d for d in HTML] + [ ':licenses.html', ':licenses.txt', ':doc.css', ], out = 'html.zip', visibility = ['PUBLIC'], ) genrule( name = 'doc.css', cmd = 'ln -s $SRCDIR/doc.css $OUT', srcs = ['doc.css'], out = 'doc.css', ) genasciidoc( srcs = SRCS + [genfile('licenses.txt')], outs = HTML + ['licenses.html'], deps = DOCUMENTATION_DEPS, attributes = documentation_attributes(git_describe()), backend = 'html5', ) 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', )