Experiment with generating code from proto files using Roslyn source generator
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 836
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 7
Description
`Grpc.Tools` uses msbuild to integrate protoc into .NET projects. Using protoc has pros and cons:
* Pros: Works today, handles all versions of Protobuf, well tested, maintained by Protobuf team
* Cons: Native files aren't always portable, large NuGet package size, hard to change, external dependency
We could use the approach of `Grpc.Tools` to integrate into the .NET project file, but use a source generator to parse and produce generated files instead of protoc.
I think this would be a significant amount of work to handle all the vageries of parsing proto files, handling dependencies, imports, proto2, proto3, etc. If work is done here it should start with a small spike.
Contributor guide
Research direction
Start by reviewing how Grpc.Tools integrates protoc into .NET project files, then assess a small source-generator spike for parsing proto files and producing generated files. Consider dependencies, imports, proto2, and proto3; done means documenting whether this approach is feasible and what limitations remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100