Skip to content

Commit 96bf49e

Browse files
rebello95MrMage
authored andcommitted
Update SwiftProtobuf to 1.3.1 (#367)
* Update SwiftProtobuf to 1.3.1 This fixes several warnings with Xcode 10.2. * Update Echo generated code Update the generated code that's checked in for this example. * Update Carthage project with SwiftProtobuf 1.3.1 Ran `make project-carthage` and built the project to ensure it works correctly.
1 parent fcb8ab3 commit 96bf49e

File tree

9 files changed

+5166
-5171
lines changed

9 files changed

+5166
-5171
lines changed

Examples/Google/Datastore/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let package = Package(
2121
name: "Datastore",
2222
dependencies: [
2323
.package(url: "../../..", .branch("HEAD")),
24-
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.1.1")),
24+
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.3.1")),
2525
.package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
2626
.package(url: "https://github.com/google/auth-library-swift.git", from: "0.3.6")
2727
],

Examples/Google/Spanner/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let package = Package(
2121
name: "Spanner",
2222
dependencies: [
2323
.package(url: "../../..", .branch("HEAD")),
24-
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.1.1")),
24+
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.3.1")),
2525
.package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
2626
.package(url: "https://github.com/google/auth-library-swift.git", from: "0.3.6")
2727
],

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import PackageDescription
1818
import Foundation
1919

2020
var packageDependencies: [Package.Dependency] = [
21-
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.1.1")),
21+
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.3.1")),
2222
.package(url: "https://github.com/kylef/Commander.git", .upToNextMinor(from: "0.8.0")),
2323
.package(url: "https://github.com/apple/swift-nio-zlib-support.git", .upToNextMinor(from: "1.0.0")),
2424
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMinor(from: "1.12.0")),

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ testing with the following versions:
140140

141141
- Xcode 9.1
142142
- Swift 4.0
143-
- swift-protobuf 1.1.1
143+
- swift-protobuf 1.3.1
144144

145145
## `SwiftGRPCNIO` package
146146

Sources/Examples/Echo/Generated/echo.pb.swift

Lines changed: 41 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,42 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
3333
typealias Version = _2
3434
}
3535

36-
struct Echo_EchoRequest: SwiftProtobuf.Message {
37-
static let protoMessageName: String = _protobuf_package + ".EchoRequest"
36+
struct Echo_EchoRequest {
37+
// SwiftProtobuf.Message conformance is added in an extension below. See the
38+
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
39+
// methods supported on all messages.
3840

3941
/// The text of a message to be echoed.
4042
var text: String = String()
4143

4244
var unknownFields = SwiftProtobuf.UnknownStorage()
4345

4446
init() {}
47+
}
48+
49+
struct Echo_EchoResponse {
50+
// SwiftProtobuf.Message conformance is added in an extension below. See the
51+
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
52+
// methods supported on all messages.
53+
54+
/// The text of an echo response.
55+
var text: String = String()
56+
57+
var unknownFields = SwiftProtobuf.UnknownStorage()
58+
59+
init() {}
60+
}
61+
62+
// MARK: - Code below here is support for the SwiftProtobuf runtime.
63+
64+
fileprivate let _protobuf_package = "echo"
65+
66+
extension Echo_EchoRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
67+
static let protoMessageName: String = _protobuf_package + ".EchoRequest"
68+
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
69+
1: .same(proto: "text"),
70+
]
4571

46-
/// Used by the decoding initializers in the SwiftProtobuf library, not generally
47-
/// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
48-
/// initializers are defined in the SwiftProtobuf library. See the Message and
49-
/// Message+*Additions` files.
5072
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
5173
while let fieldNumber = try decoder.nextFieldNumber() {
5274
switch fieldNumber {
@@ -56,32 +78,26 @@ struct Echo_EchoRequest: SwiftProtobuf.Message {
5678
}
5779
}
5880

59-
/// Used by the encoding methods of the SwiftProtobuf library, not generally
60-
/// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
61-
/// other serializer methods are defined in the SwiftProtobuf library. See the
62-
/// `Message` and `Message+*Additions` files.
6381
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
6482
if !self.text.isEmpty {
6583
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
6684
}
6785
try unknownFields.traverse(visitor: &visitor)
6886
}
87+
88+
static func ==(lhs: Echo_EchoRequest, rhs: Echo_EchoRequest) -> Bool {
89+
if lhs.text != rhs.text {return false}
90+
if lhs.unknownFields != rhs.unknownFields {return false}
91+
return true
92+
}
6993
}
7094

71-
struct Echo_EchoResponse: SwiftProtobuf.Message {
95+
extension Echo_EchoResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
7296
static let protoMessageName: String = _protobuf_package + ".EchoResponse"
97+
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
98+
1: .same(proto: "text"),
99+
]
73100

74-
/// The text of an echo response.
75-
var text: String = String()
76-
77-
var unknownFields = SwiftProtobuf.UnknownStorage()
78-
79-
init() {}
80-
81-
/// Used by the decoding initializers in the SwiftProtobuf library, not generally
82-
/// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
83-
/// initializers are defined in the SwiftProtobuf library. See the Message and
84-
/// Message+*Additions` files.
85101
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
86102
while let fieldNumber = try decoder.nextFieldNumber() {
87103
switch fieldNumber {
@@ -91,42 +107,16 @@ struct Echo_EchoResponse: SwiftProtobuf.Message {
91107
}
92108
}
93109

94-
/// Used by the encoding methods of the SwiftProtobuf library, not generally
95-
/// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
96-
/// other serializer methods are defined in the SwiftProtobuf library. See the
97-
/// `Message` and `Message+*Additions` files.
98110
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
99111
if !self.text.isEmpty {
100112
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
101113
}
102114
try unknownFields.traverse(visitor: &visitor)
103115
}
104-
}
105-
106-
// MARK: - Code below here is support for the SwiftProtobuf runtime.
107-
108-
fileprivate let _protobuf_package = "echo"
109-
110-
extension Echo_EchoRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
111-
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
112-
1: .same(proto: "text"),
113-
]
114-
115-
func _protobuf_generated_isEqualTo(other: Echo_EchoRequest) -> Bool {
116-
if self.text != other.text {return false}
117-
if unknownFields != other.unknownFields {return false}
118-
return true
119-
}
120-
}
121-
122-
extension Echo_EchoResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
123-
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
124-
1: .same(proto: "text"),
125-
]
126116

127-
func _protobuf_generated_isEqualTo(other: Echo_EchoResponse) -> Bool {
128-
if self.text != other.text {return false}
129-
if unknownFields != other.unknownFields {return false}
117+
static func ==(lhs: Echo_EchoResponse, rhs: Echo_EchoResponse) -> Bool {
118+
if lhs.text != rhs.text {return false}
119+
if lhs.unknownFields != rhs.unknownFields {return false}
130120
return true
131121
}
132122
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module CNIONghttp2 {
2-
umbrella "/Users/dima/Work/grpc-swift/.build/checkouts/swift-nio-http2.git--32668518585670434/Sources/CNIONghttp2/include"
2+
umbrella "/Users/mrebello/Development/grpc-swift/.build/checkouts/swift-nio-http2.git-1684232237084789971/Sources/CNIONghttp2/include"
33
export *
44
}

0 commit comments

Comments
 (0)