Skip to content

Commit f1b8171

Browse files
committed
Properly handle special characters in singlejar resource files
1 parent 9cca507 commit f1b8171

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

rules/common/private/utils.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def _short_path(file):
175175

176176
def _format_resources_item(item):
177177
key, value = item
178-
return "{}:{}".format(value.path, key)
178+
return "\"{}\":\"{}\"".format(value.path, key)
179179

180180
def action_singlejar(
181181
ctx,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
load("@rules_scala_annex//rules:scala.bzl", "scala_library")
2+
3+
scala_library(
4+
name = "special_characters",
5+
resources = glob(["**/*.txt"]),
6+
scala_toolchain_name = "test_zinc_2_13",
7+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
example
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash -e
2+
. "$(dirname "$0")"/../../common.sh
3+
4+
bazel build :special_characters

0 commit comments

Comments
 (0)