From 02fe1e0b5b237b090e91c4a5d1ab1ac7b938d0f6 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sun, 19 Mar 2017 18:52:55 -0700 Subject: [PATCH] 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 --- BUILD | 1 + lib/BUILD | 3 ++- org.eclipse.jgit.junit/BUILD | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index f94a95228..683ef9e25 100644 --- a/BUILD +++ b/BUILD @@ -2,6 +2,7 @@ package(default_visibility = ["//visibility:public"]) 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 2a1d9104a..40dfcf686 100644 --- a/lib/BUILD +++ b/lib/BUILD @@ -39,7 +39,8 @@ java_library( 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 15a39c7cd..350b25f97 100644 --- a/org.eclipse.jgit.junit/BUILD +++ b/org.eclipse.jgit.junit/BUILD @@ -2,6 +2,7 @@ package(default_visibility = ["//visibility:public"]) java_library( name = "junit", + testonly = 1, srcs = glob(["src/**"]), resource_strip_prefix = "org.eclipse.jgit.junit/resources", resources = glob(["resources/**"]),