Skip to content

Commit

Permalink
Import SwiftProtobuf in generated code (#952)
Browse files Browse the repository at this point in the history
Motivation:

Generated code may rely on messages which ship with SwiftProtobuf, as
such we should always import SwiftProtobuf.

Modifications:

- Import SwiftProtobuf in codegen

Result:

Resolves #951
  • Loading branch information
glbrntt authored Aug 24, 2020
1 parent 24b71cb commit 24d36a0
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Examples/Echo/Model/echo.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate Echo_EchoClient, then call methods of this protocol to make API calls.
Expand Down
1 change: 1 addition & 0 deletions Sources/Examples/HelloWorld/Model/helloworld.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate Helloworld_GreeterClient, then call methods of this protocol to make API calls.
Expand Down
1 change: 1 addition & 0 deletions Sources/Examples/RouteGuide/Model/route_guide.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate Routeguide_RouteGuideClient, then call methods of this protocol to make API calls.
Expand Down
1 change: 1 addition & 0 deletions Sources/protoc-gen-grpc-swift/Generator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class Generator {
let moduleNames = [
self.options.gRPCModuleName,
"NIO",
"SwiftProtobuf",
]

for moduleName in (moduleNames + self.options.extraModuleImports).sorted() {
Expand Down
1 change: 1 addition & 0 deletions dev/codegen-tests/01-echo/golden/echo.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate Echo_EchoClient, then call methods of this protocol to make API calls.
Expand Down
1 change: 1 addition & 0 deletions dev/codegen-tests/02-multifile/golden/a.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate A_ServiceAClient, then call methods of this protocol to make API calls.
Expand Down
1 change: 1 addition & 0 deletions dev/codegen-tests/02-multifile/golden/b.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate B_ServiceBClient, then call methods of this protocol to make API calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf
import ModuleB


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate B_ServiceBClient, then call methods of this protocol to make API calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate Codegentest_FooClient, then call methods of this protocol to make API calls.
Expand Down
1 change: 1 addition & 0 deletions dev/codegen-tests/05-service-only/golden/test.grpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


/// Usage: instantiate Codegentest_FooClient, then call methods of this protocol to make API calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//
import GRPC
import NIO
import SwiftProtobuf


internal final class Codegentest_FooTestClient: Codegentest_FooClientProtocol {
Expand Down

0 comments on commit 24d36a0

Please sign in to comment.