Merge pull request #18355 from JunTaoLuo/vs-errors

Update tools to ensure error details appear in VS
reviewable/pr18052/r7^2
Jan Tattermusch 6 years ago committed by GitHub
commit 0ca6cad901
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/csharp/Grpc.Tools.Tests/ProtoCompileCommandLineGeneratorTest.cs
  2. 1
      src/csharp/Grpc.Tools/ProtoCompile.cs
  3. 1
      src/csharp/Grpc.Tools/build/_protobuf/Google.Protobuf.Tools.targets

@ -49,7 +49,7 @@ namespace Grpc.Tools.Tests
ExecuteExpectSuccess();
Assert.That(_task.LastPathToTool, Does.Match(@"protoc(.exe)?$"));
Assert.That(_task.LastResponseFile, Is.EqualTo(new[] {
"--csharp_out=outdir", "a.proto" }));
"--csharp_out=outdir", "--error_format=msvs", "a.proto" }));
}
[Test]
@ -58,7 +58,7 @@ namespace Grpc.Tools.Tests
_task.ProtoBuf = Utils.MakeSimpleItems("a.proto", "foo/b.proto");
ExecuteExpectSuccess();
Assert.That(_task.LastResponseFile, Is.EqualTo(new[] {
"--csharp_out=outdir", "a.proto", "foo/b.proto" }));
"--csharp_out=outdir", "--error_format=msvs", "a.proto", "foo/b.proto" }));
}
[Test]
@ -68,7 +68,7 @@ namespace Grpc.Tools.Tests
ExecuteExpectSuccess();
Assert.That(_task.LastResponseFile, Is.EqualTo(new[] {
"--csharp_out=outdir", "--proto_path=/path1",
"--proto_path=/path2", "a.proto" }));
"--proto_path=/path2", "--error_format=msvs", "a.proto" }));
}
[TestCase("Cpp")]
@ -87,7 +87,7 @@ namespace Grpc.Tools.Tests
ExecuteExpectSuccess();
gen = gen.ToLowerInvariant();
Assert.That(_task.LastResponseFile, Is.EqualTo(new[] {
$"--{gen}_out=outdir", $"--{gen}_opt=foo,bar", "a.proto" }));
$"--{gen}_out=outdir", $"--{gen}_opt=foo,bar", "--error_format=msvs", "a.proto" }));
}
[Test]

@ -318,6 +318,7 @@ namespace Grpc.Tools
cmd.AddSwitchMaybe("proto_path", TrimEndSlash(path));
}
cmd.AddSwitchMaybe("dependency_out", DependencyOut);
cmd.AddSwitchMaybe("error_format", "msvs");
foreach (var proto in ProtoBuf)
{
cmd.AddArg(proto.ItemSpec);

@ -271,6 +271,7 @@
GrpcPluginExe="%(_Protobuf_OutOfDateProto.GrpcPluginExe)"
GrpcOutputDir="%(_Protobuf_OutOfDateProto.GrpcOutputDir)"
GrpcOutputOptions="%(_Protobuf_OutOfDateProto._GrpcOutputOptions)"
LogStandardErrorAsError="true"
>
<Output TaskParameter="GeneratedFiles" ItemName="_Protobuf_GeneratedFiles"/>
</ProtoCompile>

Loading…
Cancel
Save