gerrit/gerrit-extension-api/BUCK
Edwin Kempin c575055ab3 Allow ExternalIncludedIn extensions to add multiple Included In rows
So far ExternalIncludedIn extensions could only add a single row to
the Included In panel. The binding was done via DynamicMap and the
export name was used as row title, while the row values were provided
by the implementation of the ExternalIncludedIn interface. This meant
that multiple bindings were required if multiple rows needed to be
added to the Included In panel. This is bad, if you have an expensive
computation that results in multiple rows, because you want to do the
computation only once and passing the result between different
implementations of the ExternalIncludedIn extension point is
difficult.

Now the ExternalIncludedIn extension point allows to provide multiple
Inlcuded In rows from a single implementation. This is done by
returning the rows as multimap where the key is the row title. The
binding is then done via DynamicSet.

This breaks existing implementations of the ExternalIncludedIn
extension point, but likely this extension point is not used yet (at
least there is no known implementation). Also adaption existing
implementations to the new interface is straight-forward.

Change-Id: I938deed6b1d197dc156c9fe965f0357ff1fe65c3
Signed-off-by: Edwin Kempin <ekempin@google.com>
2016-08-05 16:40:11 +02:00

85 lines
1.6 KiB
Python

SRC = 'src/main/java/com/google/gerrit/extensions/'
SRCS = glob([SRC + '**/*.java'])
EXT_API_SRCS = glob([SRC + 'client/*.java'])
gwt_module(
name = 'client',
srcs = EXT_API_SRCS,
gwt_xml = SRC + 'Extensions.gwt.xml',
visibility = ['PUBLIC'],
)
java_library(
name = 'client-lib',
srcs = EXT_API_SRCS,
resources = EXT_API_SRCS + glob([SRC + 'Extensions.gwt.xml']),
visibility = ['PUBLIC'],
)
java_binary(
name = 'extension-api',
deps = [':lib'],
visibility = ['PUBLIC'],
)
java_library(
name = 'lib',
exported_deps = [
':api',
'//lib:guava',
'//lib/guice:guice',
'//lib/guice:guice-assistedinject',
'//lib/guice:guice-servlet',
'//lib:servlet-api-3_1',
],
visibility = ['PUBLIC'],
)
java_library(
name = 'api',
srcs = glob([SRC + '**/*.java']),
deps = [
'//gerrit-common:annotations',
],
provided_deps = [
'//lib:guava',
'//lib/guice:guice',
'//lib/guice:guice-assistedinject',
],
visibility = ['PUBLIC'],
)
java_sources(
name = 'extension-api-src',
srcs = SRCS,
visibility = ['PUBLIC'],
)
java_test(
name = 'api_tests',
srcs = glob(['src/test/java/**/*.java']),
deps = [
':api',
'//lib:truth',
'//lib/guice:guice',
],
source_under_test = [':api'],
)
java_doc(
name = 'extension-api-javadoc',
title = 'Gerrit Review Extension API Documentation',
pkgs = ['com.google.gerrit.extensions'],
paths = ['src/main/java'],
srcs = SRCS,
deps = [
'//lib/guice:javax-inject',
'//lib/guice:guice_library',
'//lib/guice:guice-assistedinject',
'//lib/jgit/org.eclipse.jgit:jgit',
'//gerrit-common:annotations',
],
visibility = ['PUBLIC'],
)