big-xylophone-43403
04/26/2023, 5:15 PM.proto
file dependencies
to protobuf_sources
target? Basically, I want to compile some proto files, but not their import dependencies which live in a different directory.protobuf_sources(
name="test-protos",
sources=["test/protos/v1/*.proto"],
dependencies=[":proto-deps"]
)
file(
name="proto-deps",
source="test-dep/protos/v1/options.proto"
)
happy-kitchen-89482
04/26/2023, 6:12 PMbig-xylophone-43403
04/26/2023, 6:49 PMprotoc -I={dep.proto,src.proto} --python_out=. src.proto
enough-analyst-54434
04/26/2023, 7:12 PMbig-xylophone-43403
04/26/2023, 7:21 PMhttp_source
with protobuf_sources
?http_source
and include it in the proto-pathenough-analyst-54434
04/26/2023, 7:40 PMhappy-kitchen-89482
04/29/2023, 2:22 AM-I
is a solution here, unless you're willing to construct that flag value manually. So I understand the problem better, what is the downside of generating the dependencies?big-xylophone-43403
05/03/2023, 6:08 PMprotobuf_sources
to compile the local protos. Which means the common protos get compiled as well. And since we already have a import dependency on the precompiled python package, the grpc runtime will complain about a conflict. This may be an edge case, but I think it is a valid one.protobuf_remote_dependencies(
name="remote-deps",
remote_packages=["some-archive", "some-other-archive"]
)
protobuf_sources(
sources=["**/*.proto"],
dependencies=[":remote-deps"]
)
test
or export-codegen
on the protobuf target, the engine recognizes the remote-deps
dependency and executes my plugin..proto
files and make them available as dependencies to the protobuf_sources
target.SomeSourceField
-> ProtobufSourceField
?