]> source.dussan.org Git - jgit.git/commitdiff
Bazel: Restrict src globs to Java source files 62/94962/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Thu, 13 Apr 2017 05:14:55 +0000 (14:14 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Thu, 13 Apr 2017 05:14:55 +0000 (14:14 +0900)
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>
org.eclipse.jgit.archive/BUILD
org.eclipse.jgit.http.apache/BUILD
org.eclipse.jgit.http.server/BUILD
org.eclipse.jgit.junit.http/BUILD
org.eclipse.jgit.junit/BUILD
org.eclipse.jgit.lfs.server/BUILD
org.eclipse.jgit.lfs/BUILD
org.eclipse.jgit.pgm/BUILD
org.eclipse.jgit.ui/BUILD
org.eclipse.jgit/BUILD

index dfdbfdccba3342eb186df5f9167299d641cb90c0..8c65fc018164d153e51a3f8521180e69310ae4cc 100644 (file)
@@ -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",
index c1538ab1c6fb5ca7fb05ed206f5b9d8ce3f35e6c..5ea118c732dd0ee00987fd338e083016a48411f6 100644 (file)
@@ -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 = [
index 876c5fa85f4382fcbc19071c913212b2f5187ece..9d5673b14ae072e4da9701b71a66633cf5da6ec7 100644 (file)
@@ -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 = [
index be6e1ae3ba90eeb1eea585c101e6f204306941d4..2a29accd1bf1b2a88ade9dbe9742e04d47f440e3 100644 (file)
@@ -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 = [
index 350b25f97dc701d46dfeea1f9f0c2b50b3020bc2..74498fdf62bdcd2578fecf678a07ada7770e7544 100644 (file)
@@ -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 = [
index fa14e8a206a18b32d535399bf5301f7b7fac204b..f3b9005f940c70f890a83c0dd94c5bf91bf8af53 100644 (file)
@@ -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 = [
index c4c9f8aad3e43316c8ab4679c76207ef57f2e7c9..0c7b1b2c4c0e1e68aeb3eda6e6c05bd6001a88a2 100644 (file)
@@ -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 = [
index 6d3279031e93014ff53a47896d515bccd03c2ffb..07922687e3710e2c7591c017b3c53c5fb4b1b261 100644 (file)
@@ -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"],
index 85ae5c084730e60eef2735b1bc1425704430c182..eec4a384dbdc3d56e3ec89df3a85999c0a4447cf 100644 (file)
@@ -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"],
index 75f4fe69c151972988c9afce6b9fa1ac84200e0b..a8a53f27427e81b183c2ce6d789674580550ac0d 100644 (file)
@@ -5,7 +5,7 @@ INSECURE_CIPHER_FACTORY = [
 ]
 
 SRCS = glob(
-    ["src/**"],
+    ["src/**/*.java"],
     exclude = INSECURE_CIPHER_FACTORY,
 )