Merge changes Ib605f6cd,Id77752f1

* changes:
  Buck: Create javadoc from source archive
  gerrit-acceptance-framework: Remove redundant build target
This commit is contained in:
David Pursehouse 2016-09-08 04:45:53 +00:00 committed by Gerrit Code Review
commit 5554c61ca9
5 changed files with 13 additions and 32 deletions

View File

@ -68,18 +68,8 @@ java_library(
)
java_sources(
name = 'src',
srcs = SRCS,
visibility = ['PUBLIC'],
)
# The above java_sources produces a .jar somewhere in the depths of
# buck-out, but it does not bring it to
# buck-out/gen/gerrit-acceptance-framework/gerrit-acceptance-framework-src.jar.
# We fix that by the following java_binary.
java_binary(
name = 'acceptance-framework-src',
deps = [ ':src' ],
srcs = SRCS,
visibility = ['PUBLIC'],
)
@ -87,7 +77,7 @@ java_doc(
name = 'acceptance-framework-javadoc',
title = 'Gerrit Acceptance Test Framework Documentation',
pkgs = [' com.google.gerrit.acceptance'],
paths = ['src/test/java'],
source_jar = ':acceptance-framework-src',
srcs = SRCS,
deps = DEPS + PROVIDED + [
'//lib:guava',

View File

@ -71,7 +71,7 @@ java_doc(
name = 'extension-api-javadoc',
title = 'Gerrit Review Extension API Documentation',
pkgs = ['com.google.gerrit.extensions'],
paths = ['src/main/java'],
source_jar = ':extension-api-src',
srcs = SRCS,
deps = [
'//lib:guava',

View File

@ -83,7 +83,7 @@ java_doc(
name = 'plugin-api-javadoc',
title = 'Gerrit Review Plugin API Documentation',
pkgs = ['com.google.gerrit'],
paths = [n for n in SRCS],
source_jar = ':plugin-api-src',
srcs = glob([n + '**/*.java' for n in SRCS]),
deps = [
':plugin-api',
@ -92,5 +92,4 @@ java_doc(
'//lib/bouncycastle:bcpkix',
],
visibility = ['PUBLIC'],
do_it_wrong = True,
)

View File

@ -1,8 +1,4 @@
COMMON = ['gerrit-gwtui-common/src/main/java/']
GWTEXPUI = ['gerrit-gwtexpui/src/main/java/']
SRC = 'src/main/java/com/google/gerrit/'
SRCS = glob([SRC + '**/*.java'])
SRCS = glob(['src/main/java/com/google/gerrit/**/*.java'])
DEPS = ['//lib/gwt:user']
java_binary(
@ -50,7 +46,7 @@ java_doc(
'com.google.gwtexpui.safehtml',
'com.google.gwtexpui.user',
],
paths = COMMON + GWTEXPUI,
source_jar = ':gwtui-api-src',
srcs = SRCS,
deps = DEPS + [
'//lib:gwtjsonrpc',
@ -61,5 +57,4 @@ java_doc(
'//gerrit-reviewdb:client',
],
visibility = ['PUBLIC'],
do_it_wrong = True,
)

View File

@ -2,20 +2,18 @@ def java_doc(
name,
title,
pkgs,
paths,
source_jar,
srcs = [],
deps = [],
visibility = [],
do_it_wrong = False,
):
if do_it_wrong:
sourcepath = paths
else:
sourcepath = ['$SRCDIR/' + n for n in paths]
# TODO(davido): Actually we shouldn't need to extract the source
# archive, javadoc should just work with provided archive.
genrule(
name = name,
cmd = ' '.join([
'while ! test -f .buckconfig; do cd ..; done;',
'mkdir $TMP/sourcepath &&',
'unzip $(location %s) -d $TMP/sourcepath &&' % source_jar,
'javadoc',
'-quiet',
'-protected',
@ -26,8 +24,7 @@ def java_doc(
'-link http://docs.oracle.com/javase/7/docs/api',
'-subpackages ',
':'.join(pkgs),
'-sourcepath ',
':'.join(sourcepath),
'-sourcepath $TMP/sourcepath',
' -classpath ',
':'.join(['$(classpath %s)' % n for n in deps]),
'-d $TMP',
@ -35,4 +32,4 @@ def java_doc(
srcs = srcs,
out = name + '.jar',
visibility = visibility,
)
)