{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc/issues/13207","repository_url":"https://api.github.com/repos/grpc/grpc","labels_url":"https://api.github.com/repos/grpc/grpc/issues/13207/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/13207/comments","events_url":"https://api.github.com/repos/grpc/grpc/issues/13207/events","html_url":"https://github.com/grpc/grpc/pull/13207","id":270172893,"number":13207,"title":"Integrate Grpc.Tools into msbuild system (C# only)","user":{"login":"kkm000","id":8228229,"avatar_url":"https://avatars3.githubusercontent.com/u/8228229?v=4","gravatar_id":"","url":"https://api.github.com/users/kkm000","html_url":"https://github.com/kkm000","followers_url":"https://api.github.com/users/kkm000/followers","following_url":"https://api.github.com/users/kkm000/following{/other_user}","gists_url":"https://api.github.com/users/kkm000/gists{/gist_id}","starred_url":"https://api.github.com/users/kkm000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkm000/subscriptions","organizations_url":"https://api.github.com/users/kkm000/orgs","repos_url":"https://api.github.com/users/kkm000/repos","events_url":"https://api.github.com/users/kkm000/events{/privacy}","received_events_url":"https://api.github.com/users/kkm000/received_events","type":"User","site_admin":false},"labels":[{"id":170781264,"url":"https://api.github.com/repos/grpc/grpc/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false},{"id":168238370,"url":"https://api.github.com/repos/grpc/grpc/labels/lang/C%23","name":"lang/C#","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":{"login":"jtattermusch","id":9939684,"avatar_url":"https://avatars1.githubusercontent.com/u/9939684?v=4","gravatar_id":"","url":"https://api.github.com/users/jtattermusch","html_url":"https://github.com/jtattermusch","followers_url":"https://api.github.com/users/jtattermusch/followers","following_url":"https://api.github.com/users/jtattermusch/following{/other_user}","gists_url":"https://api.github.com/users/jtattermusch/gists{/gist_id}","starred_url":"https://api.github.com/users/jtattermusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtattermusch/subscriptions","organizations_url":"https://api.github.com/users/jtattermusch/orgs","repos_url":"https://api.github.com/users/jtattermusch/repos","events_url":"https://api.github.com/users/jtattermusch/events{/privacy}","received_events_url":"https://api.github.com/users/jtattermusch/received_events","type":"User","site_admin":false},"assignees":[{"login":"jtattermusch","id":9939684,"avatar_url":"https://avatars1.githubusercontent.com/u/9939684?v=4","gravatar_id":"","url":"https://api.github.com/users/jtattermusch","html_url":"https://github.com/jtattermusch","followers_url":"https://api.github.com/users/jtattermusch/followers","following_url":"https://api.github.com/users/jtattermusch/following{/other_user}","gists_url":"https://api.github.com/users/jtattermusch/gists{/gist_id}","starred_url":"https://api.github.com/users/jtattermusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtattermusch/subscriptions","organizations_url":"https://api.github.com/users/jtattermusch/orgs","repos_url":"https://api.github.com/users/jtattermusch/repos","events_url":"https://api.github.com/users/jtattermusch/events{/privacy}","received_events_url":"https://api.github.com/users/jtattermusch/received_events","type":"User","site_admin":false}],"milestone":null,"comments":46,"created_at":"2017-11-01T02:16:04Z","updated_at":"2018-02-07T14:42:09Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/grpc/grpc/pulls/13207","html_url":"https://github.com/grpc/grpc/pull/13207","diff_url":"https://github.com/grpc/grpc/pull/13207.diff","patch_url":"https://github.com/grpc/grpc/pull/13207.patch"},"body":"When Grpc.Tools is added to a C# project, the project recognizes .proto files. These .proto are compiled into .cs files placed in the object directory (under obj/...), and are not shown in Visual Studio, but are available to Intellisense nevertheless.\r\n\r\nThe scripts support both \"classic\" projects and the new dotnet style projects. In line with the latter ones (when .cs files are just dropped into the directory are picked up and compiled), .proto files are handled the same way, so just placing a .proto file into the folder is enough to compile it, and compile its protoc outputs into the project target assembly.\r\n\r\nThe \"classic\" project requires adding .proto files by one, and they are assigned a correct build action automatically. To manually add proto files to msbuild script, use 'ProtoBuf' item type.\r\n\r\nFor native code C++ projects, there is no added support beyond just dropping the compiler as before. For all other project types, an error message is generated on an attempted build. More C++ support is on the way.\r\n\r\nDependency change: the package now adds a dependency on Grpc.Tools of a matching version for managed projects only. This is naturally skipped for native C++, as the managed runtime is not required.\r\n\r\nAlso packaged are proto includes for well-known types.\r\n\r\n----\r\nValidated and confirmed working:\r\n * Windows (VS, classic C#, dotnet C#, C++)\r\n * Linux/Mono (both classic C# and dotnet C#)\r\n * Linux/dotnet  (dotnet C# project only)\r\n----\r\nThere are quite a few questions I wanted to discuss. If anyone could help me with proper decicions, I would appreciate it.\r\n\r\n1. The captialization of generated .cs files. When I compile `fooBar.proto`, the resulting .cs file is called `FooBar.proto`. Is there a way around that? This does not seem to make sense in the build like this, when the .cs files are treated at best as temporary. I can certainly script around the issue in msbuild scripts, but why have it in the first place?\r\n\r\n2. If `x.proto` does not contain any RPC services. the corresponding `xGrpc.cs` is not generated (FWIW, the cpp plugin does not do that). This is not good for the build. While it is certainly possible to see if the file *is* there after compilation, it is impossible to learn if it was *actually* produced by it. In other words, if I take a service definition out of x.proto after having previously compiled it, I end up with a stale `xGrpc.cs` that is added to compilation. Of course, it is possible to write some msbuild incantations about this issue as well, but it would be much cleaner just to create a nearly empty xGrpc.cs stub even if no services are defined. So options I am asking about here are \r\n - a) Leave it as is and script some very ugly transformations around it.\r\n - b) Add a plugin option to do always generate the stub.\r\n - c) In fact, forget the option and just always generate the stub.\r\n\r\n3. I want to package cpp plugins also, and support to integrate gRPC into the build process. (I already have it packaged internally). This will cover the build process in Visual Studio. Should we do that?\r\n\r\n4. I am adding a bunch of files to the root of `src/chsarp` that only go into the nuget package. Is it better to place them into a subdirectory? Is `Grpc.Tools` subdirectory good?\r\n\r\n----\r\n/cc @jskeet @hcoona  \r\nCloses #4805  \r\nCloses #13098\r\n"},"comment":{"url":"https://api.github.com/repos/grpc/grpc/issues/comments/363789581","html_url":"https://github.com/grpc/grpc/pull/13207#issuecomment-363789581","issue_url":"https://api.github.com/repos/grpc/grpc/issues/13207","id":363789581,"user":{"login":"kkm000","id":8228229,"avatar_url":"https://avatars3.githubusercontent.com/u/8228229?v=4","gravatar_id":"","url":"https://api.github.com/users/kkm000","html_url":"https://github.com/kkm000","followers_url":"https://api.github.com/users/kkm000/followers","following_url":"https://api.github.com/users/kkm000/following{/other_user}","gists_url":"https://api.github.com/users/kkm000/gists{/gist_id}","starred_url":"https://api.github.com/users/kkm000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkm000/subscriptions","organizations_url":"https://api.github.com/users/kkm000/orgs","repos_url":"https://api.github.com/users/kkm000/repos","events_url":"https://api.github.com/users/kkm000/events{/privacy}","received_events_url":"https://api.github.com/users/kkm000/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T14:42:09Z","updated_at":"2018-02-07T14:42:09Z","author_association":"CONTRIBUTOR","body":"Thanks!\r\n"}}
{"actor":{"display_login":"kkm000"}}