From 9e218ae0906a9c23bda8d9ae5d6064faa219734b Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Thu, 22 Jan 2015 23:18:33 +0100 Subject: [PATCH] Buck: Expose extension client sources to plugin API The extension package exposes some sources to the client. Make them available to the plugins as well. To use, the plugin only needs to inherit the new Extensions GWT module: Given that the class files and javadocs for exposed sources are already contained in the gerrit-plugin artifact, we don't expose them again in the plugin-gwtui artifact. Change-Id: I4b98ee470614a5eab1bd96cc7801895336851cc1 --- gerrit-extension-api/BUCK | 33 ++++++++++++++++++++++----------- gerrit-plugin-gwtui/BUCK | 2 ++ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/gerrit-extension-api/BUCK b/gerrit-extension-api/BUCK index 5cce9aa400..6bb31e98ec 100644 --- a/gerrit-extension-api/BUCK +++ b/gerrit-extension-api/BUCK @@ -1,23 +1,34 @@ SRC = 'src/main/java/com/google/gerrit/extensions/' SRCS = glob([SRC + '**/*.java']) +# TODO(davido): align this rule with package boundaries. +# This would probably affect quite some plugins, though. +CLIENT_SRCS = [SRC + n for n in [ + 'api/projects/ProjectState.java', + 'common/ChangeStatus.java', + 'common/Comment.java', + 'common/InheritableBoolean.java', + 'common/ListChangesOption.java', + 'common/Side.java', + 'common/SubmitType.java', + 'common/Theme.java', + 'webui/GerritTopMenu.java', +]] + gwt_module( name = 'client', - srcs = glob([ - SRC + 'api/projects/ProjectState.java', - SRC + 'common/ChangeStatus.java', - SRC + 'common/Comment.java', - SRC + 'common/InheritableBoolean.java', - SRC + 'common/ListChangesOption.java', - SRC + 'common/Side.java', - SRC + 'common/SubmitType.java', - SRC + 'common/Theme.java', - SRC + 'webui/GerritTopMenu.java', - ]), + srcs = glob(CLIENT_SRCS), gwt_xml = SRC + 'Extensions.gwt.xml', visibility = ['PUBLIC'], ) +java_library( + name = 'client-lib', + srcs = glob(CLIENT_SRCS), + resources = glob(CLIENT_SRCS + [SRC + 'Extensions.gwt.xml']), + visibility = ['PUBLIC'], +) + java_binary( name = 'extension-api', deps = [':lib'], diff --git a/gerrit-plugin-gwtui/BUCK b/gerrit-plugin-gwtui/BUCK index 07e475b25e..3b695ce411 100644 --- a/gerrit-plugin-gwtui/BUCK +++ b/gerrit-plugin-gwtui/BUCK @@ -12,6 +12,7 @@ java_binary( name = 'gwtui-api', deps = [ ':gwtui-api-lib', + '//gerrit-extension-api:client-lib', '//gerrit-gwtui-common:client-lib', ], visibility = ['PUBLIC'], @@ -28,6 +29,7 @@ java_library( srcs = SRCS, resources = glob(['src/main/**/*']), exported_deps = [ + '//gerrit-extension-api:client-lib', '//gerrit-gwtexpui:Clippy', '//gerrit-gwtexpui:GlobalKey', '//gerrit-gwtexpui:SafeHtml',