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
This commit is contained in:
Jonathan Nieder 2017-03-19 18:52:55 -07:00
parent bc5014faec
commit 02fe1e0b5b
3 changed files with 4 additions and 1 deletions

1
BUILD
View File

@ -2,6 +2,7 @@ package(default_visibility = ["//visibility:public"])
genrule( genrule(
name = "all", name = "all",
testonly = 1,
srcs = [ srcs = [
"//org.eclipse.jgit:jgit", "//org.eclipse.jgit:jgit",
"//org.eclipse.jgit.archive:jgit-archive", "//org.eclipse.jgit.archive:jgit-archive",

View File

@ -39,7 +39,8 @@ java_library(
java_library( java_library(
name = "junit", name = "junit",
visibility = ["//org.eclipse.jgit.junit:__pkg__"], testonly = 1,
visibility = ["//visibility:public"],
exports = ["@junit//jar"], exports = ["@junit//jar"],
) )

View File

@ -2,6 +2,7 @@ package(default_visibility = ["//visibility:public"])
java_library( java_library(
name = "junit", name = "junit",
testonly = 1,
srcs = glob(["src/**"]), srcs = glob(["src/**"]),
resource_strip_prefix = "org.eclipse.jgit.junit/resources", resource_strip_prefix = "org.eclipse.jgit.junit/resources",
resources = glob(["resources/**"]), resources = glob(["resources/**"]),