Skip to content

Add C# plugin "file_suffix" option defaulting to "Grpc.cs"#26162

Merged
jtattermusch merged 3 commits intogrpc:masterfrom
jtattermusch:csharp_codegen_file_extension
May 12, 2021
Merged

Add C# plugin "file_suffix" option defaulting to "Grpc.cs"#26162
jtattermusch merged 3 commits intogrpc:masterfrom
jtattermusch:csharp_codegen_file_extension

Conversation

@jtattermusch
Copy link
Copy Markdown
Contributor

@jtattermusch jtattermusch commented May 4, 2021

Fixes #26056

note that in the current version of this PR, the file_suffix option's default value is actually "Grpc.cs" (but I thought that configuring the "Grpc" suffix might be useful as well).

IMPORTANT: This option should only be used with "manual" invocations of protoc from a shell script. The Grpc.Tools integration won't support this option since it relies on "guessing" the exact name of the generated files produced by protoc.

@jtattermusch
Copy link
Copy Markdown
Contributor Author

@jskeet

@jtattermusch jtattermusch added release notes: yes Indicates if PR needs to be in release notes lang/C# labels May 4, 2021
Copy link
Copy Markdown
Contributor

@jskeet jskeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks.

So just to check, if I want to just change the extension to .g.cs, I'd set --grpc_opts=file_extension=Grpc.g.cs, yes?

@jskeet
Copy link
Copy Markdown
Contributor

jskeet commented May 4, 2021

(Would it possibly make sense to call it file_suffix instead of file_extension, given that it's not really the extension? I don't mind much though.)

@jtattermusch
Copy link
Copy Markdown
Contributor Author

This is great, thanks.

So just to check, if I want to just change the extension to .g.cs, I'd set --grpc_opts=file_extension=Grpc.g.cs, yes?

Yes.

@jtattermusch
Copy link
Copy Markdown
Contributor Author

(Would it possibly make sense to call it file_suffix instead of file_extension, given that it's not really the extension? I don't mind much though.)

Yes, I was thinking that as well. On the other hand, then protoc and grpc_csharp_ext would have different names for an analogous option (but one that isn't quite identical). I'm not sure which one's better.

@jtattermusch
Copy link
Copy Markdown
Contributor Author

I updated the option name to "file_suffix" to avoid confusion.

@jtattermusch jtattermusch changed the title Add C# plugin "file_extension" option defaulting to "Grpc.cs" Add C# plugin "file_suffix" option defaulting to "Grpc.cs" May 10, 2021
@jtattermusch jtattermusch requested a review from apolcyn May 10, 2021 12:58
Copy link
Copy Markdown
Contributor

@apolcyn apolcyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments

@jtattermusch jtattermusch enabled auto-merge (squash) May 12, 2021 13:05
@jtattermusch jtattermusch merged commit 98ccb7f into grpc:master May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang/C# release notes: yes Indicates if PR needs to be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request for file_extension option in C# protoc plugin

3 participants