Files
gerrit/tools/java_doc.defs
Christian Aistleitner eda4d91a8c Allow to provide URLs for docs of external classes
Thereby, javadoc can render references to other projects (e.g.: JGit
classes) as proper links.

Change-Id: Ie011121c0aaeef2616d1c7f795cf9b48769ac274
2016-09-08 17:12:41 +09:00

41 lines
952 B
Plaintext

def java_doc(
name,
title,
pkgs,
paths,
srcs = [],
deps = [],
visibility = [],
do_it_wrong = False,
external_docs = [],
):
if do_it_wrong:
sourcepath = paths
else:
sourcepath = ['$SRCDIR/' + n for n in paths]
external_docs.insert(0, 'http://docs.oracle.com/javase/7/docs/api')
genrule(
name = name,
cmd = ' '.join([
'while ! test -f .buckconfig; do cd ..; done;',
'javadoc',
'-quiet',
'-protected',
'-encoding UTF-8',
'-charset UTF-8',
'-notimestamp',
'-windowtitle "' + title + '"',
' '.join(['-link %s' % url for url in external_docs]),
'-subpackages ',
':'.join(pkgs),
'-sourcepath ',
':'.join(sourcepath),
' -classpath ',
':'.join(['$(classpath %s)' % n for n in deps]),
'-d $TMP',
]) + ';jar cf $OUT -C $TMP .',
srcs = srcs,
out = name + '.jar',
visibility = visibility,
)