File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
examples/bazel-example/src/main/java/srcjar_example
scip-java/src/main/resources/scip-java Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,18 @@ genrule(
4
4
cmd = "echo 'package com.testing; public class Bar {};' > Bar.java && jar cf $(@) Bar.java" ,
5
5
)
6
6
7
+ genrule (
8
+ name = "empty-srcjar" ,
9
+ outs = ["empty.srcjar" ],
10
+ cmd = "touch test.txt && zip $(@) test.txt && zip -d $(@) test.txt" ,
11
+ )
12
+
7
13
java_library (
8
14
name = "testing" ,
9
15
srcs = [
10
16
"Foo.java" ,
11
17
":generated-srcjar" ,
18
+ ":empty-srcjar"
12
19
],
13
20
)
14
21
@@ -19,4 +26,3 @@ java_library(
19
26
":generated-srcjar" ,
20
27
],
21
28
)
22
-
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def _scip_java(target, ctx):
78
78
outputs = [dir ],
79
79
mnemonic = "ExtractSourceJars" ,
80
80
command = """
81
- unzip {input_file} -d {output_dir}
81
+ [ "$(unzip -q -l {input_file} | wc -l)" -eq 0 ] || unzip {input_file} -d {output_dir}
82
82
""" .format (
83
83
output_dir = dir .path ,
84
84
input_file = source_jar .path ,
You can’t perform that action at this time.
0 commit comments