Browse Source

Bazel: Restrict src globs to Java source files

Generating the src list with an unrestricted wildcard causes all
files in the source tree to be included. This results in junk files
such as .orig (generated during merge conflict resolution) to be
included, which causes in a build error:

  in srcs attribute of java_library rule //org.eclipse.jgit:jgit:
  file '//org.eclipse.jgit:src/org/eclipse/jgit/gitrepo/RepoCommand.java.orig'
  is misplaced here (expected .java, .srcjar or .properties).

Modify the globs to only include Java source files.

Change-Id: Iaef3db33ac71d71047cd28acb0378e15cb09ece9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.8
David Pursehouse 8 years ago
parent
commit
c80d8c5901
  1. 2
      org.eclipse.jgit.archive/BUILD
  2. 2
      org.eclipse.jgit.http.apache/BUILD
  3. 2
      org.eclipse.jgit.http.server/BUILD
  4. 2
      org.eclipse.jgit.junit.http/BUILD
  5. 2
      org.eclipse.jgit.junit/BUILD
  6. 2
      org.eclipse.jgit.lfs.server/BUILD
  7. 2
      org.eclipse.jgit.lfs/BUILD
  8. 2
      org.eclipse.jgit.pgm/BUILD
  9. 2
      org.eclipse.jgit.ui/BUILD
  10. 2
      org.eclipse.jgit/BUILD

2
org.eclipse.jgit.archive/BUILD

@ -3,7 +3,7 @@ package(default_visibility = ["//visibility:public"])
java_library(
name = "jgit-archive",
srcs = glob(
["src/**"],
["src/**/*.java"],
exclude = ["src/org/eclipse/jgit/archive/FormatActivator.java"],
),
resource_strip_prefix = "org.eclipse.jgit.archive/resources",

2
org.eclipse.jgit.http.apache/BUILD

@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"])
java_library(
name = "http-apache",
srcs = glob(["src/**"]),
srcs = glob(["src/**/*.java"]),
resource_strip_prefix = "org.eclipse.jgit.http.apache/resources",
resources = glob(["resources/**"]),
deps = [

2
org.eclipse.jgit.http.server/BUILD

@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"])
java_library(
name = "jgit-servlet",
srcs = glob(["src/**"]),
srcs = glob(["src/**/*.java"]),
resource_strip_prefix = "org.eclipse.jgit.http.server/resources",
resources = glob(["resources/**"]),
deps = [

2
org.eclipse.jgit.junit.http/BUILD

@ -3,7 +3,7 @@ package(default_visibility = ["//visibility:public"])
java_library(
name = "junit-http",
testonly = 1,
srcs = glob(["src/**"]),
srcs = glob(["src/**/*.java"]),
resources = glob(["resources/**"]),
# TODO(davido): we want here provided deps
deps = [

2
org.eclipse.jgit.junit/BUILD

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

2
org.eclipse.jgit.lfs.server/BUILD

@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"])
java_library(
name = "jgit-lfs-server",
srcs = glob(["src/**"]),
srcs = glob(["src/**/*.java"]),
resource_strip_prefix = "org.eclipse.jgit.lfs.server/resources",
resources = glob(["resources/**"]),
deps = [

2
org.eclipse.jgit.lfs/BUILD

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

2
org.eclipse.jgit.pgm/BUILD

@ -1,6 +1,6 @@
java_library(
name = "pgm",
srcs = glob(["src/**"]),
srcs = glob(["src/**/*.java"]),
resource_strip_prefix = "org.eclipse.jgit.pgm/resources",
resources = glob(["resources/**"]),
visibility = ["//visibility:public"],

2
org.eclipse.jgit.ui/BUILD

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

2
org.eclipse.jgit/BUILD

@ -5,7 +5,7 @@ INSECURE_CIPHER_FACTORY = [
]
SRCS = glob(
["src/**"],
["src/**/*.java"],
exclude = INSECURE_CIPHER_FACTORY,
)

Loading…
Cancel
Save