Skip to content

Avoid collisions in cs files generated by Grpc.Tools#22852

Closed
jtattermusch wants to merge 1 commit intogrpc:masterfrom
jtattermusch:grpc_tools_fixes
Closed

Avoid collisions in cs files generated by Grpc.Tools#22852
jtattermusch wants to merge 1 commit intogrpc:masterfrom
jtattermusch:grpc_tools_fixes

Conversation

@jtattermusch
Copy link
Copy Markdown
Contributor

Just an experiment for now.

@jtattermusch
Copy link
Copy Markdown
Contributor Author

jtattermusch commented May 4, 2020

@jtattermusch
Copy link
Copy Markdown
Contributor Author

CC @Falco20019 this is my first experiment to fix #17672 (haven't tested it yet).

@jtattermusch
Copy link
Copy Markdown
Contributor Author

Current version gives obj/Debug/net45/da39a3ee5e6b4b0d/ : error : No such file or directory [/var/local/git/grpc/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj] because --csharp_out and --grpc_out don't create the subdirectories automatically.

Copy link
Copy Markdown
Contributor

@Falco20019 Falco20019 left a comment

Choose a reason for hiding this comment

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

I just fixed all of the problems and did some cleanup. Will create a PR for it.

string grpcdir = DepFileUtil.GetOutputDirWithHash(protoItem.GetMetadata(Metadata.GrpcOutputDir), protoItem.ItemSpec);
filename = LowerUnderscoreToUpperCamelGrpcWay(basename);
outputs[1] = Path.Combine(
grpcdir != "" ? grpcdir : outdir, filename) + "Grpc.cs";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This won't be string.Empty anymore as it always includes the hash.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch.

@jtattermusch
Copy link
Copy Markdown
Contributor Author

Superseded by #22869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants