-
A common workflow is to pull Protobuf definitions from external repositories, either as a Git submodule or part of some automated workflow, and then generate code based on a combination of local and "remote" Protobuf definitions. This is currently difficult to do with Buf, especially if dependencies are involved (for example, see #1103). How should these use cases be handled? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If the external Protobuf definitions do not have any dependencies, the most simple solution is to use the Example:
If the external Protobuf definitions do have dependencies, then we'll need to use a workaround involving Buf Workspaces. In your
Then you can use
|
Beta Was this translation helpful? Give feedback.
If the external Protobuf definitions do not have any dependencies, the most simple solution is to use the
--config
flag and target the external Protobuf definitions:Example:
If the external Protobuf definitions do have dependencies, then we'll need to use a workaround involving Buf Workspaces.
In your
buf.work.yaml
, add your external Protobuf definition target and their dependencies. As an example, the let's say you're adding external Protobuf definitions that haveprotoc-gen-validate
andgoogleapis
as dependencies: