Skip to content

Commit

Permalink
Update SwiftProtobuf to 1.3.1 (#367)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
rebello95 authored and MrMage committed Feb 15, 2019
1 parent fcb8ab3 commit 96bf49e
Show file tree
Hide file tree
Showing 9 changed files with 5,166 additions and 5,171 deletions.
2 changes: 1 addition & 1 deletion Examples/Google/Datastore/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let package = Package(
name: "Datastore",
dependencies: [
.package(url: "../../..", .branch("HEAD")),
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.1.1")),
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.3.1")),
.package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
.package(url: "https://github.com/google/auth-library-swift.git", from: "0.3.6")
],
Expand Down
2 changes: 1 addition & 1 deletion Examples/Google/Spanner/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let package = Package(
name: "Spanner",
dependencies: [
.package(url: "../../..", .branch("HEAD")),
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.1.1")),
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.3.1")),
.package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
.package(url: "https://github.com/google/auth-library-swift.git", from: "0.3.6")
],
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import PackageDescription
import Foundation

var packageDependencies: [Package.Dependency] = [
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.1.1")),
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMinor(from: "1.3.1")),
.package(url: "https://github.com/kylef/Commander.git", .upToNextMinor(from: "0.8.0")),
.package(url: "https://github.com/apple/swift-nio-zlib-support.git", .upToNextMinor(from: "1.0.0")),
.package(url: "https://github.com/apple/swift-nio.git", .upToNextMinor(from: "1.12.0")),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ testing with the following versions:

- Xcode 9.1
- Swift 4.0
- swift-protobuf 1.1.1
- swift-protobuf 1.3.1

## `SwiftGRPCNIO` package

Expand Down
92 changes: 41 additions & 51 deletions Sources/Examples/Echo/Generated/echo.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,42 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
typealias Version = _2
}

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

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

var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}
}

struct Echo_EchoResponse {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

/// The text of an echo response.
var text: String = String()

var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}
}

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "echo"

extension Echo_EchoRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".EchoRequest"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "text"),
]

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

/// Used by the encoding methods of the SwiftProtobuf library, not generally
/// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
/// other serializer methods are defined in the SwiftProtobuf library. See the
/// `Message` and `Message+*Additions` files.
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.text.isEmpty {
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}

static func ==(lhs: Echo_EchoRequest, rhs: Echo_EchoRequest) -> Bool {
if lhs.text != rhs.text {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

struct Echo_EchoResponse: SwiftProtobuf.Message {
extension Echo_EchoResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".EchoResponse"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "text"),
]

/// The text of an echo response.
var text: String = String()

var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}

/// Used by the decoding initializers in the SwiftProtobuf library, not generally
/// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
/// initializers are defined in the SwiftProtobuf library. See the Message and
/// Message+*Additions` files.
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
switch fieldNumber {
Expand All @@ -91,42 +107,16 @@ struct Echo_EchoResponse: SwiftProtobuf.Message {
}
}

/// Used by the encoding methods of the SwiftProtobuf library, not generally
/// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
/// other serializer methods are defined in the SwiftProtobuf library. See the
/// `Message` and `Message+*Additions` files.
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.text.isEmpty {
try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
}
try unknownFields.traverse(visitor: &visitor)
}
}

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "echo"

extension Echo_EchoRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "text"),
]

func _protobuf_generated_isEqualTo(other: Echo_EchoRequest) -> Bool {
if self.text != other.text {return false}
if unknownFields != other.unknownFields {return false}
return true
}
}

extension Echo_EchoResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "text"),
]

func _protobuf_generated_isEqualTo(other: Echo_EchoResponse) -> Bool {
if self.text != other.text {return false}
if unknownFields != other.unknownFields {return false}
static func ==(lhs: Echo_EchoResponse, rhs: Echo_EchoResponse) -> Bool {
if lhs.text != rhs.text {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module CNIONghttp2 {
umbrella "/Users/dima/Work/grpc-swift/.build/checkouts/swift-nio-http2.git--32668518585670434/Sources/CNIONghttp2/include"
umbrella "/Users/mrebello/Development/grpc-swift/.build/checkouts/swift-nio-http2.git-1684232237084789971/Sources/CNIONghttp2/include"
export *
}
Loading

0 comments on commit 96bf49e

Please sign in to comment.