Buck: Move gwt-dev transitive deps to first order dependency
Since bottom-up to top-down graph traversal switch in Buck, only
first order dependencies are built per default. This leads to a
problem when gerrit is built without --deep option (per default).
Move gwt-dev dependencies to gwt_binary() rules.
The correct fix for this issue would be to model the GWT compiler
as a tool, and ensure that its transitive deps are added as first
order deps of the gwt_binary() rules: [1]. Put this workaround for
now in tree and fix build breakages. We can always improve things
when Buck supports that new model.
Test plan:
* buck clean
* change one of GWT classes
* buck build //gerrit-gwtui:ui_opt
* buck build api_install
[1] https://github.com/facebook/buck/issues/469
Change-Id: I4212ac327acd27f33256c1ba1e86c0b098e07a93
diff --git a/gerrit-gwtui/BUCK b/gerrit-gwtui/BUCK
index 90fdcab..ead19f4 100644
--- a/gerrit-gwtui/BUCK
+++ b/gerrit-gwtui/BUCK
@@ -1,7 +1,7 @@
include_defs('//gerrit-gwtui/gwt.defs')
include_defs('//tools/gwt-constants.defs')
-DEPS = [
+DEPS = GWT_TRANSITIVE_DEPS + [
'//gerrit-gwtexpui:CSS',
'//lib:gwtjsonrpc',
'//lib/gwt:dev',
diff --git a/gerrit-plugin-gwtui/BUCK b/gerrit-plugin-gwtui/BUCK
index ec5903a..2ee0e19 100644
--- a/gerrit-plugin-gwtui/BUCK
+++ b/gerrit-plugin-gwtui/BUCK
@@ -55,7 +55,7 @@
deps = DEPS + [
'//lib:gwtjsonrpc',
'//lib:gwtorm_client',
- '//lib/gwt:dev__jar',
+ '//lib/gwt:dev',
'//gerrit-gwtui-common:client-lib',
'//gerrit-common:client',
'//gerrit-reviewdb:client',
diff --git a/lib/gwt/BUCK b/lib/gwt/BUCK
index 3e2f411..6876dfe 100644
--- a/lib/gwt/BUCK
+++ b/lib/gwt/BUCK
@@ -15,15 +15,6 @@
id = 'com.google.gwt:gwt-dev:' + VERSION,
sha1 = 'c2c3dd5baf648a0bb199047a818be5e560f48982',
license = 'Apache2.0',
- exported_deps = [
- ':javax-validation',
- ':javax-validation_src',
- '//lib/ow2:ow2-asm',
- '//lib/ow2:ow2-asm-analysis',
- '//lib/ow2:ow2-asm-commons',
- '//lib/ow2:ow2-asm-tree',
- '//lib/ow2:ow2-asm-util',
- ],
attach_source = False,
exclude = ['org/eclipse/jetty/*'],
)
@@ -34,7 +25,7 @@
bin_sha1 = 'b6bd7f9d78f6fdaa3c37dae18a4bd298915f328e',
src_sha1 = '7a561191db2203550fbfa40d534d4997624cd369',
license = 'Apache2.0',
- visibility = [],
+ visibility = ['PUBLIC'],
)
maven_jar(
@@ -54,5 +45,5 @@
id = 'org.javassist:javassist:3.18.1-GA',
sha1 = 'd9a09f7732226af26bf99f19e2cffe0ae219db5b',
license = 'Apache2.0',
- visibility = [],
+ visibility = ['PUBLIC'],
)
diff --git a/tools/default.defs b/tools/default.defs
index 543bf98..22cf388 100644
--- a/tools/default.defs
+++ b/tools/default.defs
@@ -193,7 +193,7 @@
gwt_binary(
name = name + '__gwt_application',
modules = [gwt_module],
- deps = GWT_PLUGIN_DEPS + ['//lib/gwt:dev'],
+ deps = GWT_PLUGIN_DEPS + GWT_TRANSITIVE_DEPS + ['//lib/gwt:dev'],
module_deps = [':%s__gwt_module' % name],
local_workers = cpu_count(),
strict = True,
diff --git a/tools/gwt-constants.defs b/tools/gwt-constants.defs
index 2584f2d..8bafddb 100644
--- a/tools/gwt-constants.defs
+++ b/tools/gwt-constants.defs
@@ -12,3 +12,13 @@
'//gerrit-plugin-gwtui:gwtui-api-lib',
'//lib/gwt:user',
]
+
+GWT_TRANSITIVE_DEPS = [
+ '//lib/gwt:javax-validation',
+ '//lib/gwt:javax-validation_src',
+ '//lib/ow2:ow2-asm',
+ '//lib/ow2:ow2-asm-analysis',
+ '//lib/ow2:ow2-asm-commons',
+ '//lib/ow2:ow2-asm-tree',
+ '//lib/ow2:ow2-asm-util',
+]