Replies: 1 comment
-
I think a better solution would be to provide a way to have the codegen use custom names for the crates. I would accept a PR for this if you're interested in the work. We also want to route the crates to pull from tonic-prost::prost rather than requiring the use to also import that library. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following
Cargo.toml
in my project:I am doing this because I need the users to be able to use tonic in different versions. (Some use tonic 0.12, some use tonic 0.13, and they are legacy applications so its difficult to update the dependencies)
The problem is that when generating the code, it doesn't compile because the generated code has references to
tonic::
andprost_types::
but those dependencies don't exist anymore, they are renamed totonic_0_x
,prost-types_0_x
This could be solved by injecting a
use tonic_0_14 as tonic
in every module.Is there a way to customize the code generation this way?
Beta Was this translation helpful? Give feedback.
All reactions