bazel: Mark junit targets testonly
Only testonly targets (such as tests) need to use junit.
In particular this involves making the toplevel :all rule testonly.
It's not clear to me what that rule is for --- "bazel build //..."
already works to build all targets. In any case it appears to be for
testing, so marking it as testonly shouldn't be harmful.
Change-Id: I28ff508ab8ce2ec0a0111109110aa9680d30600e
diff --git a/BUILD b/BUILD
index f94a952..683ef9e 100644
--- a/BUILD
+++ b/BUILD
@@ -2,6 +2,7 @@
genrule(
name = "all",
+ testonly = 1,
srcs = [
"//org.eclipse.jgit:jgit",
"//org.eclipse.jgit.archive:jgit-archive",
diff --git a/lib/BUILD b/lib/BUILD
index 2a1d910..40dfcf6 100644
--- a/lib/BUILD
+++ b/lib/BUILD
@@ -39,7 +39,8 @@
java_library(
name = "junit",
- visibility = ["//org.eclipse.jgit.junit:__pkg__"],
+ testonly = 1,
+ visibility = ["//visibility:public"],
exports = ["@junit//jar"],
)
diff --git a/org.eclipse.jgit.junit/BUILD b/org.eclipse.jgit.junit/BUILD
index 15a39c7..350b25f 100644
--- a/org.eclipse.jgit.junit/BUILD
+++ b/org.eclipse.jgit.junit/BUILD
@@ -2,6 +2,7 @@
java_library(
name = "junit",
+ testonly = 1,
srcs = glob(["src/**"]),
resource_strip_prefix = "org.eclipse.jgit.junit/resources",
resources = glob(["resources/**"]),