generated from bazel-contrib/rules-template
-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: join
--descriptor_set_in
with host path separator (#671)
Fixes #670. As described in #670, protoc splits the arguments to `--proto_path` and `--descriptor_set_in` using an OS-specific path-separator. On posix, this is `:`, but on Windows this is `;`. The protobuf library takes the approach for its bazel rules to join on `ctx.configuration.host_path_separator`, so I've taken the same approach here as well.
- Loading branch information
1 parent
70e6ba9
commit 105f294
Showing
6 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"Proto libraries for ts_proto_library tests." | ||
# These are a concrete package rather than using `write_file` in the test file, | ||
# since protoc would otherwise not find the proto files in the descriptor | ||
# database. | ||
|
||
proto_library( | ||
name = "bar_proto", | ||
srcs = [ | ||
":bar.proto", | ||
], | ||
tags = ["manual"], | ||
visibility = ["//ts/test:__subpackages__"], | ||
) | ||
|
||
proto_library( | ||
name = "foo_proto", | ||
srcs = [ | ||
":foo.proto", | ||
], | ||
tags = ["manual"], | ||
visibility = ["//ts/test:__subpackages__"], | ||
deps = [ | ||
":bar_proto", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
syntax = "proto3"; | ||
package bar; | ||
|
||
message Bar {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
syntax = "proto3"; | ||
package foo; | ||
|
||
import "ts/test/ts_proto_library/bar.proto"; | ||
|
||
message Foo { | ||
bar.Bar bar = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"UnitTest for ts_proto_library" | ||
|
||
load("@bazel_skylib//rules:build_test.bzl", "build_test") | ||
load("//ts:proto.bzl", "ts_proto_library") | ||
|
||
def ts_proto_library_test_suite(name): | ||
"""Test suite including all tests and data. | ||
Args: | ||
name: The name of the test suite. | ||
""" | ||
|
||
ts_proto_library( | ||
name = "ts_proto_library_with_dep", | ||
# The //examples package is the root pnpm package for the repo, so we | ||
# borrow from the proto/grpc example to provide the required | ||
# ts_proto_library npm dependencies. | ||
node_modules = "//examples/proto_grpc:node_modules", | ||
proto = "//ts/test/ts_proto_library:foo_proto", | ||
proto_srcs = ["//ts/test/ts_proto_library:foo.proto"], | ||
# This is disabled to avoid checking in the output files, which are | ||
# implicitly inputs for the copy_file tests. | ||
copy_files = False, | ||
tags = ["manual"], | ||
) | ||
|
||
build_test( | ||
name = "ts_proto_library_with_dep_test", | ||
targets = [":ts_proto_library_with_dep"], | ||
) |