Browse Source

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.
Michael Rebello 7 years ago
parent
commit
96bf49ee8f

+ 1 - 1
Examples/Google/Datastore/Package.swift

@@ -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")
   ],

+ 1 - 1
Examples/Google/Spanner/Package.swift

@@ -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")
   ],

+ 1 - 1
Package.swift

@@ -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")),

+ 1 - 1
README.md

@@ -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
 

+ 41 - 51
Sources/Examples/Echo/Generated/echo.pb.swift

@@ -33,8 +33,10 @@ 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()
@@ -42,11 +44,31 @@ struct Echo_EchoRequest: SwiftProtobuf.Message {
   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 {
@@ -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 {
@@ -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
   }
 }

+ 1 - 1
SwiftGRPC-Carthage.xcodeproj/GeneratedModuleMap/CNIONghttp2/module.modulemap

@@ -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 *
 }

File diff suppressed because it is too large
+ 2205 - 2202
SwiftGRPC-Carthage.xcodeproj/project.pbxproj


+ 19 - 20
SwiftGRPC-Carthage.xcodeproj/xcshareddata/xcschemes/SwiftGRPC-Package.xcscheme

@@ -32,9 +32,8 @@
             buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
-               BlueprintIdentifier = "SwiftGRPC::CgRPC"
-               BuildableName = "CgRPC.framework"
-               BlueprintName = "CgRPC"
+               BuildableName = "&apos;$(TARGET_NAME)&apos;"
+               BlueprintName = "Echo"
                ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
@@ -46,8 +45,9 @@
             buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
-               BuildableName = "&apos;$(TARGET_NAME)&apos;"
-               BlueprintName = "Simple"
+               BlueprintIdentifier = "SwiftGRPC::SwiftGRPC"
+               BuildableName = "SwiftGRPC.framework"
+               BlueprintName = "SwiftGRPC"
                ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
@@ -60,7 +60,7 @@
             <BuildableReference
                BuildableIdentifier = "primary"
                BuildableName = "&apos;$(TARGET_NAME)&apos;"
-               BlueprintName = "Echo"
+               BlueprintName = "RootsEncoder"
                ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
@@ -72,9 +72,8 @@
             buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
-               BlueprintIdentifier = "SwiftGRPC::SwiftGRPC"
-               BuildableName = "SwiftGRPC.framework"
-               BlueprintName = "SwiftGRPC"
+               BuildableName = "&apos;lib$(TARGET_NAME)&apos;"
+               BlueprintName = "SwiftGRPCNIO"
                ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
@@ -87,7 +86,7 @@
             <BuildableReference
                BuildableIdentifier = "primary"
                BuildableName = "&apos;$(TARGET_NAME)&apos;"
-               BlueprintName = "RootsEncoder"
+               BlueprintName = "Simple"
                ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
@@ -99,8 +98,9 @@
             buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
-               BuildableName = "&apos;$(TARGET_NAME)&apos;"
-               BlueprintName = "protoc-gen-swiftgrpc"
+               BlueprintIdentifier = "SwiftGRPC::BoringSSL"
+               BuildableName = "BoringSSL.framework"
+               BlueprintName = "BoringSSL"
                ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
@@ -112,9 +112,8 @@
             buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
-               BlueprintIdentifier = "SwiftGRPC::BoringSSL"
-               BuildableName = "BoringSSL.framework"
-               BlueprintName = "BoringSSL"
+               BuildableName = "&apos;$(TARGET_NAME)&apos;"
+               BlueprintName = "protoc-gen-swiftgrpc"
                ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
@@ -126,8 +125,9 @@
             buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
-               BuildableName = "&apos;lib$(TARGET_NAME)&apos;"
-               BlueprintName = "SwiftGRPCNIO"
+               BlueprintIdentifier = "SwiftGRPC::CgRPC"
+               BuildableName = "CgRPC.framework"
+               BlueprintName = "CgRPC"
                ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
@@ -188,9 +188,8 @@
       <MacroExpansion>
          <BuildableReference
             BuildableIdentifier = "primary"
-            BlueprintIdentifier = "SwiftGRPC::CgRPC"
-            BuildableName = "CgRPC.framework"
-            BlueprintName = "CgRPC"
+            BuildableName = "&apos;$(TARGET_NAME)&apos;"
+            BlueprintName = "Echo"
             ReferencedContainer = "container:SwiftGRPC-Carthage.xcodeproj">
          </BuildableReference>
       </MacroExpansion>

+ 1 - 1
SwiftGRPC.podspec

@@ -41,5 +41,5 @@ Pod::Spec.new do |s|
 
   s.dependency 'gRPC-Core', '~> 1.12.0'
   s.dependency 'BoringSSL', '~> 10.0'
-  s.dependency 'SwiftProtobuf', '~> 1.1.1'
+  s.dependency 'SwiftProtobuf', '~> 1.3.1'
 end

Some files were not shown because too many files changed in this diff