Skip to content

Commit c1d892a

Browse files
committed
Import SwiftProtobuf in generated code
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
1 parent 4ee6305 commit c1d892a

File tree

12 files changed

+12
-0
lines changed

12 files changed

+12
-0
lines changed

Sources/Examples/Echo/Model/echo.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526

2627

2728
/// Usage: instantiate Echo_EchoClient, then call methods of this protocol to make API calls.

Sources/Examples/HelloWorld/Model/helloworld.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526

2627

2728
/// Usage: instantiate Helloworld_GreeterClient, then call methods of this protocol to make API calls.

Sources/Examples/RouteGuide/Model/route_guide.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526

2627

2728
/// Usage: instantiate Routeguide_RouteGuideClient, then call methods of this protocol to make API calls.

Sources/protoc-gen-grpc-swift/Generator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class Generator {
9090
let moduleNames = [
9191
self.options.gRPCModuleName,
9292
"NIO",
93+
"SwiftProtobuf",
9394
]
9495

9596
for moduleName in (moduleNames + self.options.extraModuleImports).sorted() {

dev/codegen-tests/01-echo/golden/echo.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526

2627

2728
/// Usage: instantiate Echo_EchoClient, then call methods of this protocol to make API calls.

dev/codegen-tests/02-multifile/golden/a.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526

2627

2728
/// Usage: instantiate A_ServiceAClient, then call methods of this protocol to make API calls.

dev/codegen-tests/02-multifile/golden/b.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526

2627

2728
/// Usage: instantiate B_ServiceBClient, then call methods of this protocol to make API calls.

dev/codegen-tests/03-multifile-with-module-map/golden/a.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526
import ModuleB
2627

2728

dev/codegen-tests/03-multifile-with-module-map/golden/b.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526

2627

2728
/// Usage: instantiate B_ServiceBClient, then call methods of this protocol to make API calls.

dev/codegen-tests/04-service-with-message-import/golden/service.grpc.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323
import GRPC
2424
import NIO
25+
import SwiftProtobuf
2526

2627

2728
/// Usage: instantiate Codegentest_FooClient, then call methods of this protocol to make API calls.

0 commit comments

Comments
 (0)