Merge changes I4b98ee47,I46947452
* changes: Buck: Expose extension client sources to plugin API Buck: Fix building GWT plugins
This commit is contained in:
@@ -1,23 +1,34 @@
|
|||||||
SRC = 'src/main/java/com/google/gerrit/extensions/'
|
SRC = 'src/main/java/com/google/gerrit/extensions/'
|
||||||
SRCS = glob([SRC + '**/*.java'])
|
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(
|
gwt_module(
|
||||||
name = 'client',
|
name = 'client',
|
||||||
srcs = glob([
|
srcs = glob(CLIENT_SRCS),
|
||||||
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',
|
|
||||||
]),
|
|
||||||
gwt_xml = SRC + 'Extensions.gwt.xml',
|
gwt_xml = SRC + 'Extensions.gwt.xml',
|
||||||
visibility = ['PUBLIC'],
|
visibility = ['PUBLIC'],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
java_library(
|
||||||
|
name = 'client-lib',
|
||||||
|
srcs = glob(CLIENT_SRCS),
|
||||||
|
resources = glob(CLIENT_SRCS + [SRC + 'Extensions.gwt.xml']),
|
||||||
|
visibility = ['PUBLIC'],
|
||||||
|
)
|
||||||
|
|
||||||
java_binary(
|
java_binary(
|
||||||
name = 'extension-api',
|
name = 'extension-api',
|
||||||
deps = [':lib'],
|
deps = [':lib'],
|
||||||
|
@@ -12,6 +12,7 @@ java_binary(
|
|||||||
name = 'gwtui-api',
|
name = 'gwtui-api',
|
||||||
deps = [
|
deps = [
|
||||||
':gwtui-api-lib',
|
':gwtui-api-lib',
|
||||||
|
'//gerrit-extension-api:client-lib',
|
||||||
'//gerrit-gwtui-common:client-lib',
|
'//gerrit-gwtui-common:client-lib',
|
||||||
],
|
],
|
||||||
visibility = ['PUBLIC'],
|
visibility = ['PUBLIC'],
|
||||||
@@ -28,6 +29,7 @@ java_library(
|
|||||||
srcs = SRCS,
|
srcs = SRCS,
|
||||||
resources = glob(['src/main/**/*']),
|
resources = glob(['src/main/**/*']),
|
||||||
exported_deps = [
|
exported_deps = [
|
||||||
|
'//gerrit-extension-api:client-lib',
|
||||||
'//gerrit-gwtexpui:Clippy',
|
'//gerrit-gwtexpui:Clippy',
|
||||||
'//gerrit-gwtexpui:GlobalKey',
|
'//gerrit-gwtexpui:GlobalKey',
|
||||||
'//gerrit-gwtexpui:SafeHtml',
|
'//gerrit-gwtexpui:SafeHtml',
|
||||||
|
@@ -127,20 +127,29 @@ def gerrit_plugin(
|
|||||||
srcs = mf_src,
|
srcs = mf_src,
|
||||||
out = 'MANIFEST.MF',
|
out = 'MANIFEST.MF',
|
||||||
)
|
)
|
||||||
gwt_deps = []
|
|
||||||
static_jars = []
|
static_jars = []
|
||||||
if gwt_module:
|
if gwt_module:
|
||||||
gwt_deps = GWT_PLUGIN_DEPS
|
|
||||||
static_jars = [':%s-static-jar' % name]
|
static_jars = [':%s-static-jar' % name]
|
||||||
java_library(
|
java_library(
|
||||||
name = name + '__plugin',
|
name = name + '__plugin',
|
||||||
srcs = srcs,
|
srcs = srcs,
|
||||||
resources = resources,
|
resources = resources,
|
||||||
deps = deps,
|
deps = deps,
|
||||||
provided_deps = ['//gerrit-%s-api:lib' % type] + provided_deps + gwt_deps,
|
provided_deps = ['//gerrit-%s-api:lib' % type] +
|
||||||
|
provided_deps +
|
||||||
|
GWT_PLUGIN_DEPS,
|
||||||
visibility = ['PUBLIC'],
|
visibility = ['PUBLIC'],
|
||||||
)
|
)
|
||||||
if gwt_module:
|
if gwt_module:
|
||||||
|
java_library(
|
||||||
|
name = name + '__gwt_module',
|
||||||
|
srcs = [],
|
||||||
|
resources = list(set(srcs + resources)),
|
||||||
|
deps = deps,
|
||||||
|
provided_deps = ['//lib/gwt:dev'] +
|
||||||
|
GWT_PLUGIN_DEPS,
|
||||||
|
visibility = ['PUBLIC'],
|
||||||
|
)
|
||||||
prebuilt_jar(
|
prebuilt_jar(
|
||||||
name = '%s-static-jar' % name,
|
name = '%s-static-jar' % name,
|
||||||
binary_jar = ':%s-static' % name,
|
binary_jar = ':%s-static' % name,
|
||||||
@@ -157,8 +166,8 @@ def gerrit_plugin(
|
|||||||
gwt_binary(
|
gwt_binary(
|
||||||
name = name + '__gwt_application',
|
name = name + '__gwt_application',
|
||||||
modules = [gwt_module],
|
modules = [gwt_module],
|
||||||
deps = gwt_deps,
|
deps = GWT_PLUGIN_DEPS,
|
||||||
module_deps = [':%s__plugin' % name],
|
module_deps = [':%s__gwt_module' % name],
|
||||||
local_workers = cpu_count(),
|
local_workers = cpu_count(),
|
||||||
strict = True,
|
strict = True,
|
||||||
experimental_args = GWT_COMPILER_ARGS,
|
experimental_args = GWT_COMPILER_ARGS,
|
||||||
|
Reference in New Issue
Block a user