Skip to content

Commit b954a8f

Browse files
committed
restore the test-doesn't-build DX
1 parent 3edb00c commit b954a8f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

examples/proto/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ js_test(
2525
name = "test",
2626
data = [
2727
":foo_js_proto",
28-
# TODO: ensure the types are up-to-date in the source folder
28+
":foo_js_proto.diff", # ensure the types are up-to-date in the source folder
2929
],
3030
entry_point = "test_proto.js",
3131
)

js/proto.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,15 @@ def js_proto_library(name, proto, copy_types = []):
116116
js_proto_library_rule(name = name, proto = proto)
117117
if len(copy_types) > 0:
118118
native.filegroup(name = "_{}.types".format(name), srcs = [name], output_group = "types")
119+
diff_targets = []
119120
for i, src_file in enumerate(copy_types):
120121
gen_file = "_{}.gen_{}.d.ts".format(name, i)
122+
diff_target = "{}.diff_{}".format(name, i)
121123
select_file(name = gen_file, srcs = "_{}.types".format(name), subpath = src_file)
122124
diff(
123-
name = "{}.diff_{}".format(name, i),
125+
name = diff_target,
124126
file1 = src_file,
125127
file2 = gen_file,
126128
)
129+
diff_targets.append(diff_target)
130+
native.filegroup(name = "{}.diff".format(name), srcs = diff_targets)

0 commit comments

Comments
 (0)