Skip to content

Commit a5acc5a

Browse files
committed
fix the bug
1 parent 903ad21 commit a5acc5a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

scala/scala.bzl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ def _adjust_resources_path(path):
2626
return dir_1 + dir_2, rel_path
2727
return "", path
2828

29-
def _build_nosrc_jar(ctx, buildijar):
29+
def _add_resources_cmd(ctx):
3030
res_cmd = ""
3131
for f in ctx.files.resources:
3232
c_dir, res_path = _adjust_resources_path(f.path)
3333
change_dir = "-C " + c_dir if c_dir else ""
34-
res_cmd = "\n{jar} uf {out} " + change_dir + " " + res_path
34+
res_cmd += "\n{jar} uf {out} " + change_dir + " " + res_path
35+
return res_cmd
36+
37+
def _build_nosrc_jar(ctx, buildijar):
38+
res_cmd = _add_resources_cmd(ctx)
3539
ijar_cmd = ""
3640
if buildijar:
3741
ijar_cmd = "\ncp {out} {ijar_out}".format(
@@ -61,11 +65,7 @@ touch -t 198001010000 {manifest}
6165
arguments=[])
6266

6367
def _compile(ctx, jars, buildijar):
64-
res_cmd = ""
65-
for f in ctx.files.resources:
66-
c_dir, res_path = _adjust_resources_path(f.path)
67-
change_dir = "-C " + c_dir if c_dir else ""
68-
res_cmd = "\n{jar} uf {out} " + change_dir + " " + res_path
68+
res_cmd = _add_resources_cmd(ctx)
6969
ijar_cmd = ""
7070
if buildijar:
7171
ijar_cmd = "\n{ijar} {out} {ijar_out}".format(

0 commit comments

Comments
 (0)