-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Consider populating a directory hierarchy for C# based on namespace #773
Copy link
Copy link
Closed
Labels
Description
Currently we don't do this because in .NET projects there tends to be a "base" namespace, but I think we'll want to address this with another flag, based on a bit of experience of trying to use the current approach.
Proposal:
- Add a new flag of
csharp_base_package - When working out where to generate code, generate a directory name based on the namespace from the base package onwards. For example, if the base package is
a.band the declared package for the .proto file isa.b.c.d, create a directory ofC.Dand put the code in there, in a namespace of A.B.C.D - If
csharp_base_packageisn't specified, treat it as empty (e.g. create a directory ofA.B.C.Din the above example) - If
csharp_base_packageis specified but the .proto package doesn't start with that, fail
Alternatives to consider:
- Specify the base namespace instead of base package (e.g.
A.Binstead ofa.b) - Have yet another flag to allow the existing behaviour of not creating directories
The GRPC plugin should do the same thing.
Thoughts?
Reactions are currently unavailable