3931c16bdb
Change-Id: I06f811fc46a606b719582c0724e8d0c89e823b37
39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
def java_doc(
|
|
name,
|
|
title,
|
|
pkgs,
|
|
source_jar,
|
|
srcs = [],
|
|
deps = [],
|
|
visibility = [],
|
|
external_docs = [],
|
|
):
|
|
# TODO(davido): Actually we shouldn't need to extract the source
|
|
# archive, javadoc should just work with provided archive.
|
|
external_docs.insert(0, 'http://docs.oracle.com/javase/8/docs/api')
|
|
genrule(
|
|
name = name,
|
|
cmd = ' '.join([
|
|
'mkdir $TMP/sourcepath &&',
|
|
'unzip $(location %s) -d $TMP/sourcepath &&' % source_jar,
|
|
'javadoc',
|
|
'-Xdoclint:-missing',
|
|
'-quiet',
|
|
'-protected',
|
|
'-encoding UTF-8',
|
|
'-charset UTF-8',
|
|
'-notimestamp',
|
|
'-windowtitle "' + title + '"',
|
|
' '.join(['-link %s' % url for url in external_docs]),
|
|
'-subpackages ',
|
|
':'.join(pkgs),
|
|
'-sourcepath $TMP/sourcepath',
|
|
' -classpath ',
|
|
':'.join(['$(classpath %s)' % n for n in deps]),
|
|
'-d $TMP',
|
|
]) + ';jar cf $OUT -C $TMP .',
|
|
srcs = srcs,
|
|
out = name + '.jar',
|
|
visibility = visibility,
|
|
)
|