From 1f0e48a7278c8ef15d345f5eb84625c509a19034 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Tue, 15 May 2018 09:18:22 -0700 Subject: [PATCH] Truth: Move export to runtime_deps There is no good reason why depending on //lib/truth should free downstream libraries from needing a direct dep on //lib/guava or //lib/junit. Exporting the deps was probably just oversight, since the distinction between exports and runtime_deps in WORKSPACE is not obvious, and there are probably other bad examples. Change-Id: I1530106d642167eaa25222cc95c3996478728e15 --- java/com/google/gerrit/acceptance/BUILD | 1 + java/com/google/gerrit/server/group/testing/BUILD | 1 + java/com/google/gerrit/testing/BUILD | 2 ++ java/com/google/gerrit/truth/BUILD | 1 + javatests/com/google/gerrit/acceptance/rest/project/BUILD | 2 ++ javatests/com/google/gerrit/index/BUILD | 1 + javatests/com/google/gerrit/reviewdb/BUILD | 1 + javatests/com/google/gerrit/server/BUILD | 3 +++ javatests/com/google/gerrit/server/group/db/BUILD | 1 + javatests/com/google/gerrit/server/query/account/BUILD | 1 + javatests/com/google/gerrit/server/query/change/BUILD | 2 ++ javatests/com/google/gerrit/server/query/group/BUILD | 1 + javatests/com/google/gerrit/server/query/project/BUILD | 1 + javatests/com/google/gwtexpui/safehtml/BUILD | 1 + lib/truth/BUILD | 8 ++++---- 15 files changed, 23 insertions(+), 4 deletions(-) diff --git a/java/com/google/gerrit/acceptance/BUILD b/java/com/google/gerrit/acceptance/BUILD index abfdcea561..9587860fb5 100644 --- a/java/com/google/gerrit/acceptance/BUILD +++ b/java/com/google/gerrit/acceptance/BUILD @@ -76,6 +76,7 @@ java_library2( "//java/com/google/gerrit/server/group/testing", "//java/com/google/gerrit/server/project/testing:project-test-util", "//java/com/google/gerrit/testing:gerrit-test-util", + "//lib:guava", "//lib:jimfs", "//lib/auto:auto-value", "//lib/auto:auto-value-annotations", diff --git a/java/com/google/gerrit/server/group/testing/BUILD b/java/com/google/gerrit/server/group/testing/BUILD index 605a239fd0..8b8cd00804 100644 --- a/java/com/google/gerrit/server/group/testing/BUILD +++ b/java/com/google/gerrit/server/group/testing/BUILD @@ -8,6 +8,7 @@ java_library( "//java/com/google/gerrit/common:server", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", + "//lib:guava", "//lib/jgit/org.eclipse.jgit:jgit", "//lib/truth", ], diff --git a/java/com/google/gerrit/testing/BUILD b/java/com/google/gerrit/testing/BUILD index 4ee81751fa..875d636921 100644 --- a/java/com/google/gerrit/testing/BUILD +++ b/java/com/google/gerrit/testing/BUILD @@ -29,8 +29,10 @@ java_library( "//java/com/google/gerrit/server/cache/mem", "//java/com/google/gerrit/server/restapi", "//java/com/google/gerrit/server/schema", + "//lib:guava", "//lib:gwtorm", "//lib:h2", + "//lib:junit", "//lib/auto:auto-value", "//lib/auto:auto-value-annotations", "//lib/guice", diff --git a/java/com/google/gerrit/truth/BUILD b/java/com/google/gerrit/truth/BUILD index 9f7c1d6902..719ddce440 100644 --- a/java/com/google/gerrit/truth/BUILD +++ b/java/com/google/gerrit/truth/BUILD @@ -4,6 +4,7 @@ java_library( srcs = glob(["**/*.java"]), visibility = ["//visibility:public"], deps = [ + "//lib:guava", "//lib/truth", ], ) diff --git a/javatests/com/google/gerrit/acceptance/rest/project/BUILD b/javatests/com/google/gerrit/acceptance/rest/project/BUILD index 4513e1f5ad..dad3ca944e 100644 --- a/javatests/com/google/gerrit/acceptance/rest/project/BUILD +++ b/javatests/com/google/gerrit/acceptance/rest/project/BUILD @@ -18,6 +18,7 @@ java_library( ], deps = [ "//java/com/google/gerrit/extensions:api", + "//lib:guava", "//lib/truth", ], ) @@ -31,6 +32,7 @@ java_library( "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", + "//lib:guava", "//lib:gwtorm", "//lib/truth", ], diff --git a/javatests/com/google/gerrit/index/BUILD b/javatests/com/google/gerrit/index/BUILD index 57f8feaa3e..d905188467 100644 --- a/javatests/com/google/gerrit/index/BUILD +++ b/javatests/com/google/gerrit/index/BUILD @@ -9,6 +9,7 @@ junit_tests( "//java/com/google/gerrit/index", "//java/com/google/gerrit/index:query_exception", "//java/com/google/gerrit/index:query_parser", + "//lib:guava", "//lib:junit", "//lib/antlr:java_runtime", "//lib/jgit/org.eclipse.jgit:jgit", diff --git a/javatests/com/google/gerrit/reviewdb/BUILD b/javatests/com/google/gerrit/reviewdb/BUILD index c15acd8aa4..0fd140e91a 100644 --- a/javatests/com/google/gerrit/reviewdb/BUILD +++ b/javatests/com/google/gerrit/reviewdb/BUILD @@ -7,6 +7,7 @@ junit_tests( "//java/com/google/gerrit/reviewdb:client", "//java/com/google/gerrit/server/project/testing:project-test-util", "//java/com/google/gerrit/testing:gerrit-test-util", + "//lib:guava", "//lib:gwtorm", "//lib/truth", ], diff --git a/javatests/com/google/gerrit/server/BUILD b/javatests/com/google/gerrit/server/BUILD index 81703bfe80..1b11dd65ba 100644 --- a/javatests/com/google/gerrit/server/BUILD +++ b/javatests/com/google/gerrit/server/BUILD @@ -12,6 +12,7 @@ java_library( "//java/com/google/gerrit/extensions:api", "//java/com/google/gerrit/server", "//java/com/google/gerrit/truth", + "//lib:guava", "//lib/truth", ], ) @@ -52,6 +53,7 @@ junit_tests( "//java/org/eclipse/jgit:server", "//lib:grappa", "//lib:gson", + "//lib:guava", "//lib:guava-retrying", "//lib:gwtorm", "//lib:protobuf", @@ -61,6 +63,7 @@ junit_tests( "//lib/guice", "//lib/jgit/org.eclipse.jgit:jgit", "//lib/jgit/org.eclipse.jgit.junit:junit", + "//lib/truth", "//lib/truth:truth-java8-extension", "//proto:cache_java_proto", ], diff --git a/javatests/com/google/gerrit/server/group/db/BUILD b/javatests/com/google/gerrit/server/group/db/BUILD index b364ca3535..eee552999f 100644 --- a/javatests/com/google/gerrit/server/group/db/BUILD +++ b/javatests/com/google/gerrit/server/group/db/BUILD @@ -16,6 +16,7 @@ junit_tests( "//java/com/google/gerrit/server/group/testing", "//java/com/google/gerrit/testing:gerrit-test-util", "//java/com/google/gerrit/truth", + "//lib:guava", "//lib:gwtorm", "//lib/jgit/org.eclipse.jgit:jgit", "//lib/jgit/org.eclipse.jgit.junit:junit", diff --git a/javatests/com/google/gerrit/server/query/account/BUILD b/javatests/com/google/gerrit/server/query/account/BUILD index 61c82dea01..e6c631b044 100644 --- a/javatests/com/google/gerrit/server/query/account/BUILD +++ b/javatests/com/google/gerrit/server/query/account/BUILD @@ -15,6 +15,7 @@ java_library( "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/testing:gerrit-test-util", + "//lib:guava", "//lib/guice", "//lib/jgit/org.eclipse.jgit:jgit", "//lib/truth", diff --git a/javatests/com/google/gerrit/server/query/change/BUILD b/javatests/com/google/gerrit/server/query/change/BUILD index f2f8cf07f3..78ec176ebf 100644 --- a/javatests/com/google/gerrit/server/query/change/BUILD +++ b/javatests/com/google/gerrit/server/query/change/BUILD @@ -19,6 +19,7 @@ java_library( "//java/com/google/gerrit/server/project/testing:project-test-util", "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/testing:gerrit-test-util", + "//lib:guava", "//lib:gwtorm", "//lib/guice", "//lib/jgit/org.eclipse.jgit:jgit", @@ -41,6 +42,7 @@ junit_tests( "//java/com/google/gerrit/reviewdb:server", "//java/com/google/gerrit/server", "//java/com/google/gerrit/testing:gerrit-test-util", + "//lib:guava", "//lib:gwtorm", "//lib/guice", "//lib/jgit/org.eclipse.jgit:jgit", diff --git a/javatests/com/google/gerrit/server/query/group/BUILD b/javatests/com/google/gerrit/server/query/group/BUILD index 7fc04d8342..0dd16cdac2 100644 --- a/javatests/com/google/gerrit/server/query/group/BUILD +++ b/javatests/com/google/gerrit/server/query/group/BUILD @@ -15,6 +15,7 @@ java_library( "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/testing:gerrit-test-util", + "//lib:guava", "//lib/guice", "//lib/jgit/org.eclipse.jgit:jgit", "//lib/truth", diff --git a/javatests/com/google/gerrit/server/query/project/BUILD b/javatests/com/google/gerrit/server/query/project/BUILD index 3f53d2bb51..eaa3df3330 100644 --- a/javatests/com/google/gerrit/server/query/project/BUILD +++ b/javatests/com/google/gerrit/server/query/project/BUILD @@ -14,6 +14,7 @@ java_library( "//java/com/google/gerrit/server", "//java/com/google/gerrit/server/schema", "//java/com/google/gerrit/testing:gerrit-test-util", + "//lib:guava", "//lib/guice", "//lib/jgit/org.eclipse.jgit:jgit", "//lib/truth", diff --git a/javatests/com/google/gwtexpui/safehtml/BUILD b/javatests/com/google/gwtexpui/safehtml/BUILD index ed8e494af9..694f4220e7 100644 --- a/javatests/com/google/gwtexpui/safehtml/BUILD +++ b/javatests/com/google/gwtexpui/safehtml/BUILD @@ -5,6 +5,7 @@ junit_tests( srcs = glob(["client/**/*.java"]), deps = [ "//java/com/google/gwtexpui/safehtml", + "//lib:guava", "//lib/gwt:dev", "//lib/gwt:user", "//lib/truth", diff --git a/lib/truth/BUILD b/lib/truth/BUILD index c14f4f59af..cb17269b01 100644 --- a/lib/truth/BUILD +++ b/lib/truth/BUILD @@ -2,10 +2,10 @@ java_library( name = "truth", data = ["//lib:LICENSE-DO_NOT_DISTRIBUTE"], visibility = ["//visibility:public"], - exports = [ + exports = ["@truth//jar"], + runtime_deps = [ "//lib:guava", "//lib:junit", - "@truth//jar", ], ) @@ -13,9 +13,9 @@ java_library( name = "truth-java8-extension", data = ["//lib:LICENSE-DO_NOT_DISTRIBUTE"], visibility = ["//visibility:public"], - exports = [ + exports = ["@truth-java8-extension//jar"], + runtime_deps = [ ":truth", "//lib:guava", - "@truth-java8-extension//jar", ], )