Skip to content

Commit de1541a

Browse files
authored
gRPC JSON transcoding - msbuild includes proto dependencies (#44999)
1 parent 2c0b763 commit de1541a

File tree

5 files changed

+473
-1
lines changed

5 files changed

+473
-1
lines changed

THIRD-PARTY-NOTICES.txt

+33
Original file line numberDiff line numberDiff line change
@@ -343,3 +343,36 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
343343
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
344344
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
345345
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
346+
347+
License notice for gRPC
348+
===================================
349+
350+
Copyright 2019 The gRPC Authors
351+
352+
Licensed under the Apache License, Version 2.0 (the "License");
353+
you may not use this file except in compliance with the License.
354+
You may obtain a copy of the License at
355+
356+
http://www.apache.org/licenses/LICENSE-2.0
357+
358+
Unless required by applicable law or agreed to in writing, software
359+
distributed under the License is distributed on an "AS IS" BASIS,
360+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
361+
See the License for the specific language governing permissions and
362+
limitations under the License.
363+
364+
---
365+
366+
Copyright (c) 2015, Google Inc.
367+
368+
Licensed under the Apache License, Version 2.0 (the "License");
369+
you may not use this file except in compliance with the License.
370+
You may obtain a copy of the License at
371+
372+
http://www.apache.org/licenses/LICENSE-2.0
373+
374+
Unless required by applicable law or agreed to in writing, software
375+
distributed under the License is distributed on an "AS IS" BASIS,
376+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
377+
See the License for the specific language governing permissions and
378+
limitations under the License.

src/Grpc/JsonTranscoding/src/Microsoft.AspNetCore.Grpc.JsonTranscoding/Microsoft.AspNetCore.Grpc.JsonTranscoding.csproj

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Description>HTTP API for gRPC ASP.NET Core</Description>
44
<PackageTags>gRPC RPC HTTP/2 REST</PackageTags>
@@ -28,5 +28,14 @@
2828
<Reference Include="Google.Api.CommonProtos" />
2929
<Reference Include="Google.Protobuf" />
3030
<Reference Include="Grpc.AspNetCore.Server" />
31+
32+
<None Update="protos\google\api\*.proto">
33+
<Pack>true</Pack>
34+
<PackagePath>content</PackagePath>
35+
</None>
36+
<None Include="build\*.targets">
37+
<Pack>true</Pack>
38+
<PackagePath>build</PackagePath>
39+
</None>
3140
</ItemGroup>
3241
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!-- This targets file allows annotations.proto and http.proto, which are bundled in package, to be included in Grpc.Tools compilation. -->
4+
<!-- This saves the developer having to find and copy these files to the right location when doing gRPC JSON transcoding. -->
5+
<PropertyGroup>
6+
<!-- The path of the proto files. Content from the nupkg. -->
7+
<GrpcJsonTranscoding_ProtosPath>$( [System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)../content/protos) )</GrpcJsonTranscoding_ProtosPath>
8+
</PropertyGroup>
9+
10+
<!-- Run immediately before the Protobuf_BeforeCompile extension point. -->
11+
<!-- Only include protos if project has set <IncludeHttpRuleProtos> property to true. -->
12+
<Target Name="GrpcJsonTranscoding_BeforeCompile"
13+
BeforeTargets="Protobuf_BeforeCompile"
14+
Condition=" '$(IncludeHttpRuleProtos)' == 'true' ">
15+
<PropertyGroup>
16+
<!-- Add nupkg proto files by including path in Protobuf_StandardImportsPath. -->
17+
<!-- See more info about Grpc.Tools build integration at https://github.com/grpc/grpc/blob/master/src/csharp/BUILD-INTEGRATION.md. -->
18+
<Protobuf_StandardImportsPath>$(Protobuf_StandardImportsPath);$(GrpcJsonTranscoding_ProtosPath)</Protobuf_StandardImportsPath>
19+
</PropertyGroup>
20+
<Message Text="Included proto files at $(GrpcJsonTranscoding_ProtosPath) in import path." Importance="high" />
21+
<Message Text="Updated proto imports path: $(Protobuf_StandardImportsPath)" Importance="high" />
22+
</Target>
23+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) 2015, Google Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.api;
18+
19+
import "google/api/http.proto";
20+
import "google/protobuf/descriptor.proto";
21+
22+
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "AnnotationsProto";
25+
option java_package = "com.google.api";
26+
option objc_class_prefix = "GAPI";
27+
28+
extend google.protobuf.MethodOptions {
29+
// See `HttpRule`.
30+
HttpRule http = 72295728;
31+
}

0 commit comments

Comments
 (0)