Browse Source

Update Echo Mac app and command-line sample to use the latest generated code.

Tim Burks 9 years ago
parent
commit
dc1b53253b

+ 20 - 20
Examples/Echo/Swift/Echo.xcodeproj/project.pbxproj

@@ -7,13 +7,13 @@
 	objects = {
 	objects = {
 
 
 /* Begin PBXBuildFile section */
 /* Begin PBXBuildFile section */
-		D30DACF01DB6FC2D00886B20 /* echo.client.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = D30DACEF1DB6FC2D00886B20 /* echo.client.pb.swift */; };
-		D324A6021D81CF8F00421B59 /* echo.server.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = D324A6011D81CF8F00421B59 /* echo.server.pb.swift */; };
-		D359A6271DBAD11C00FE6282 /* echo.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = D359A6261DBAD11C00FE6282 /* echo.pb.swift */; };
 		D35C9FAC1D74B079000443CD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D35C9FAB1D74B079000443CD /* AppDelegate.swift */; };
 		D35C9FAC1D74B079000443CD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D35C9FAB1D74B079000443CD /* AppDelegate.swift */; };
 		D35C9FAE1D74B079000443CD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D35C9FAD1D74B079000443CD /* Assets.xcassets */; };
 		D35C9FAE1D74B079000443CD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D35C9FAD1D74B079000443CD /* Assets.xcassets */; };
 		D35C9FB11D74B079000443CD /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = D35C9FAF1D74B079000443CD /* MainMenu.xib */; };
 		D35C9FB11D74B079000443CD /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = D35C9FAF1D74B079000443CD /* MainMenu.xib */; };
 		D35C9FC81D74B0C1000443CD /* EchoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D35C9FC71D74B0C1000443CD /* EchoViewController.swift */; };
 		D35C9FC81D74B0C1000443CD /* EchoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D35C9FC71D74B0C1000443CD /* EchoViewController.swift */; };
+		D36483D81E209D780044E0B7 /* echo.client.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = D36483D51E209D780044E0B7 /* echo.client.pb.swift */; };
+		D36483D91E209D780044E0B7 /* echo.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = D36483D61E209D780044E0B7 /* echo.pb.swift */; };
+		D36483DA1E209D780044E0B7 /* echo.server.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = D36483D71E209D780044E0B7 /* echo.server.pb.swift */; };
 		D38F9C401E1F0D2C003DECA4 /* EchoProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D38F9C3F1E1F0D2C003DECA4 /* EchoProvider.swift */; };
 		D38F9C401E1F0D2C003DECA4 /* EchoProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = D38F9C3F1E1F0D2C003DECA4 /* EchoProvider.swift */; };
 		D3971E211D89132E001A0B3F /* ssl.key in Resources */ = {isa = PBXBuildFile; fileRef = D3971E201D89132E001A0B3F /* ssl.key */; };
 		D3971E211D89132E001A0B3F /* ssl.key in Resources */ = {isa = PBXBuildFile; fileRef = D3971E201D89132E001A0B3F /* ssl.key */; };
 		D3BFE28C1D87A45D00A648D8 /* ssl.crt in Resources */ = {isa = PBXBuildFile; fileRef = D3BFE28B1D87A45D00A648D8 /* ssl.crt */; };
 		D3BFE28C1D87A45D00A648D8 /* ssl.crt in Resources */ = {isa = PBXBuildFile; fileRef = D3BFE28B1D87A45D00A648D8 /* ssl.crt */; };
@@ -73,15 +73,15 @@
 /* End PBXContainerItemProxy section */
 /* End PBXContainerItemProxy section */
 
 
 /* Begin PBXFileReference section */
 /* Begin PBXFileReference section */
-		D30DACEF1DB6FC2D00886B20 /* echo.client.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = echo.client.pb.swift; sourceTree = "<group>"; };
-		D324A6011D81CF8F00421B59 /* echo.server.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = echo.server.pb.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
-		D359A6261DBAD11C00FE6282 /* echo.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = echo.pb.swift; path = Protobuf/echo.pb.swift; sourceTree = "<group>"; };
 		D35C9FA81D74B079000443CD /* Echo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Echo.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		D35C9FA81D74B079000443CD /* Echo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Echo.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		D35C9FAB1D74B079000443CD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		D35C9FAB1D74B079000443CD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		D35C9FAD1D74B079000443CD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		D35C9FAD1D74B079000443CD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		D35C9FB01D74B079000443CD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
 		D35C9FB01D74B079000443CD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
 		D35C9FB21D74B079000443CD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		D35C9FB21D74B079000443CD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		D35C9FC71D74B0C1000443CD /* EchoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EchoViewController.swift; sourceTree = "<group>"; };
 		D35C9FC71D74B0C1000443CD /* EchoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EchoViewController.swift; sourceTree = "<group>"; };
+		D36483D51E209D780044E0B7 /* echo.client.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = echo.client.pb.swift; path = Generated/echo.client.pb.swift; sourceTree = "<group>"; };
+		D36483D61E209D780044E0B7 /* echo.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = echo.pb.swift; path = Generated/echo.pb.swift; sourceTree = "<group>"; };
+		D36483D71E209D780044E0B7 /* echo.server.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = echo.server.pb.swift; path = Generated/echo.server.pb.swift; sourceTree = "<group>"; };
 		D36C3EF81E145A2200BF4EB3 /* SwiftProtobufRuntime.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftProtobufRuntime.xcodeproj; path = "../../../third_party/swift-protobuf/SwiftProtobufRuntime.xcodeproj"; sourceTree = "<group>"; };
 		D36C3EF81E145A2200BF4EB3 /* SwiftProtobufRuntime.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftProtobufRuntime.xcodeproj; path = "../../../third_party/swift-protobuf/SwiftProtobufRuntime.xcodeproj"; sourceTree = "<group>"; };
 		D38F9C3F1E1F0D2C003DECA4 /* EchoProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = EchoProvider.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
 		D38F9C3F1E1F0D2C003DECA4 /* EchoProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = EchoProvider.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
 		D3971E201D89132E001A0B3F /* ssl.key */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ssl.key; sourceTree = "<group>"; };
 		D3971E201D89132E001A0B3F /* ssl.key */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ssl.key; sourceTree = "<group>"; };
@@ -101,21 +101,13 @@
 /* End PBXFrameworksBuildPhase section */
 /* End PBXFrameworksBuildPhase section */
 
 
 /* Begin PBXGroup section */
 /* Begin PBXGroup section */
-		D359A6281DBAD12100FE6282 /* Protobuf */ = {
-			isa = PBXGroup;
-			children = (
-				D359A6261DBAD11C00FE6282 /* echo.pb.swift */,
-			);
-			name = Protobuf;
-			sourceTree = "<group>";
-		};
 		D35C9F9F1D74B079000443CD = {
 		D35C9F9F1D74B079000443CD = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
 				D36C3EF81E145A2200BF4EB3 /* SwiftProtobufRuntime.xcodeproj */,
 				D36C3EF81E145A2200BF4EB3 /* SwiftProtobufRuntime.xcodeproj */,
 				D3D2EA391D75FB56002EF89C /* gRPC.xcodeproj */,
 				D3D2EA391D75FB56002EF89C /* gRPC.xcodeproj */,
 				D35C9FAA1D74B079000443CD /* Echo */,
 				D35C9FAA1D74B079000443CD /* Echo */,
-				D359A6281DBAD12100FE6282 /* Protobuf */,
+				D36483DB1E209D7F0044E0B7 /* Generated */,
 				D35C9FA91D74B079000443CD /* Products */,
 				D35C9FA91D74B079000443CD /* Products */,
 			);
 			);
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -133,8 +125,6 @@
 			children = (
 			children = (
 				D35C9FAB1D74B079000443CD /* AppDelegate.swift */,
 				D35C9FAB1D74B079000443CD /* AppDelegate.swift */,
 				D35C9FAD1D74B079000443CD /* Assets.xcassets */,
 				D35C9FAD1D74B079000443CD /* Assets.xcassets */,
-				D30DACEF1DB6FC2D00886B20 /* echo.client.pb.swift */,
-				D324A6011D81CF8F00421B59 /* echo.server.pb.swift */,
 				D38F9C3F1E1F0D2C003DECA4 /* EchoProvider.swift */,
 				D38F9C3F1E1F0D2C003DECA4 /* EchoProvider.swift */,
 				D35C9FC71D74B0C1000443CD /* EchoViewController.swift */,
 				D35C9FC71D74B0C1000443CD /* EchoViewController.swift */,
 				D35C9FB21D74B079000443CD /* Info.plist */,
 				D35C9FB21D74B079000443CD /* Info.plist */,
@@ -145,6 +135,16 @@
 			path = Echo;
 			path = Echo;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		D36483DB1E209D7F0044E0B7 /* Generated */ = {
+			isa = PBXGroup;
+			children = (
+				D36483D51E209D780044E0B7 /* echo.client.pb.swift */,
+				D36483D61E209D780044E0B7 /* echo.pb.swift */,
+				D36483D71E209D780044E0B7 /* echo.server.pb.swift */,
+			);
+			name = Generated;
+			sourceTree = "<group>";
+		};
 		D36C3EF91E145A2200BF4EB3 /* Products */ = {
 		D36C3EF91E145A2200BF4EB3 /* Products */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -288,12 +288,12 @@
 			isa = PBXSourcesBuildPhase;
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
-				D30DACF01DB6FC2D00886B20 /* echo.client.pb.swift in Sources */,
-				D324A6021D81CF8F00421B59 /* echo.server.pb.swift in Sources */,
 				D35C9FC81D74B0C1000443CD /* EchoViewController.swift in Sources */,
 				D35C9FC81D74B0C1000443CD /* EchoViewController.swift in Sources */,
 				D38F9C401E1F0D2C003DECA4 /* EchoProvider.swift in Sources */,
 				D38F9C401E1F0D2C003DECA4 /* EchoProvider.swift in Sources */,
-				D359A6271DBAD11C00FE6282 /* echo.pb.swift in Sources */,
 				D35C9FAC1D74B079000443CD /* AppDelegate.swift in Sources */,
 				D35C9FAC1D74B079000443CD /* AppDelegate.swift in Sources */,
+				D36483DA1E209D780044E0B7 /* echo.server.pb.swift in Sources */,
+				D36483D91E209D780044E0B7 /* echo.pb.swift in Sources */,
+				D36483D81E209D780044E0B7 /* echo.client.pb.swift in Sources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};

+ 0 - 0
Examples/Echo/Swift/Echo/echo.client.pb.swift → Examples/Echo/Swift/Generated/echo.client.pb.swift


+ 0 - 0
Examples/Echo/Swift/Protobuf/echo.pb.swift → Examples/Echo/Swift/Generated/echo.pb.swift


+ 0 - 0
Examples/Echo/Swift/Echo/echo.server.pb.swift → Examples/Echo/Swift/Generated/echo.server.pb.swift


+ 4 - 4
Plugin/Makefile

@@ -9,12 +9,12 @@ build:
 
 
 test:	build
 test:	build
 	protoc echo.proto --swiftgrpc_out=.
 	protoc echo.proto --swiftgrpc_out=.
-	diff echo.client.pb.swift ../Examples/Echo/Swift/Echo/echo.client.pb.swift
-	diff echo.server.pb.swift ../Examples/Echo/Swift/Echo/echo.server.pb.swift
+	diff echo.client.pb.swift ../Examples/Echo/Swift/Generated/echo.client.pb.swift
+	diff echo.server.pb.swift ../Examples/Echo/Swift/Generated/echo.server.pb.swift
 
 
 deploy:
 deploy:
-	cp echo.client.pb.swift ../Examples/Echo/Swift/Echo/echo.client.pb.swift 
-	cp echo.server.pb.swift ../Examples/Echo/Swift/Echo/echo.server.pb.swift 
+	cp echo.client.pb.swift ../Examples/Echo/Swift/Generated/echo.client.pb.swift 
+	cp echo.server.pb.swift ../Examples/Echo/Swift/Generated/echo.server.pb.swift 
 
 
 clean :
 clean :
 	rm -f protoc-gen-swiftgrpc 
 	rm -f protoc-gen-swiftgrpc 

+ 13 - 14
Samples/Echo/Sources/echo.client.pb.swift

@@ -1,3 +1,11 @@
+/*
+ * DO NOT EDIT.
+ *
+ * Generated by the protocol buffer compiler.
+ * Source: echo.proto
+ *
+ */
+
 /*
 /*
  *
  *
  * Copyright 2016, Google Inc.
  * Copyright 2016, Google Inc.
@@ -31,8 +39,6 @@
  *
  *
  */
  */
 
 
-// all code that follows is to-be-generated
-
 import Foundation
 import Foundation
 import gRPC
 import gRPC
 
 
@@ -41,9 +47,8 @@ public enum Echo_EchoClientError : Error {
   case invalidMessageReceived
   case invalidMessageReceived
   case error(c: CallResult)
   case error(c: CallResult)
 }
 }
-
 //
 //
-// Unary GET
+// Get (Unary)
 //
 //
 public class Echo_EchoGetCall {
 public class Echo_EchoGetCall {
   var call : Call
   var call : Call
@@ -79,9 +84,8 @@ public class Echo_EchoGetCall {
     }
     }
   }
   }
 }
 }
-
 //
 //
-// Server-streaming EXPAND
+// Expand (Server streaming)
 //
 //
 public class Echo_EchoExpandCall {
 public class Echo_EchoExpandCall {
   var call : Call
   var call : Call
@@ -128,9 +132,8 @@ public class Echo_EchoExpandCall {
     return returnMessage
     return returnMessage
   }
   }
 }
 }
-
 //
 //
-// Client-streaming COLLECT
+// Collect (Client streaming)
 //
 //
 public class Echo_EchoCollectCall {
 public class Echo_EchoCollectCall {
   var call : Call
   var call : Call
@@ -204,9 +207,8 @@ public class Echo_EchoCollectCall {
   }
   }
 
 
 }
 }
-
 //
 //
-// Bidirectional-streaming UPDATE
+// Update (Bidirectional streaming)
 //
 //
 public class Echo_EchoUpdateCall {
 public class Echo_EchoUpdateCall {
   var call : Call
   var call : Call
@@ -311,25 +313,22 @@ public class Echo_EchoService {
   public func get(_ request: Echo_EchoRequest) throws -> Echo_EchoResponse {
   public func get(_ request: Echo_EchoRequest) throws -> Echo_EchoResponse {
     return try Echo_EchoGetCall(channel).run(request:request, metadata:metadata)
     return try Echo_EchoGetCall(channel).run(request:request, metadata:metadata)
   }
   }
-
   // Asynchronous. Server-streaming.
   // Asynchronous. Server-streaming.
   // Send the initial message.
   // Send the initial message.
   // Use methods on the returned object to get streamed responses.
   // Use methods on the returned object to get streamed responses.
   public func expand(_ request: Echo_EchoRequest) throws -> Echo_EchoExpandCall {
   public func expand(_ request: Echo_EchoRequest) throws -> Echo_EchoExpandCall {
     return try Echo_EchoExpandCall(channel).run(request:request, metadata:metadata)
     return try Echo_EchoExpandCall(channel).run(request:request, metadata:metadata)
   }
   }
-
   // Asynchronous. Client-streaming.
   // Asynchronous. Client-streaming.
   // Use methods on the returned object to stream messages and
   // Use methods on the returned object to stream messages and
   // to close the connection and wait for a final response.
   // to close the connection and wait for a final response.
   public func collect() throws -> Echo_EchoCollectCall {
   public func collect() throws -> Echo_EchoCollectCall {
     return try Echo_EchoCollectCall(channel).run(metadata:metadata)
     return try Echo_EchoCollectCall(channel).run(metadata:metadata)
   }
   }
-
   // Asynchronous. Bidirectional-streaming.
   // Asynchronous. Bidirectional-streaming.
   // Use methods on the returned object to stream messages,
   // Use methods on the returned object to stream messages,
   // to wait for replies, and to close the connection.
   // to wait for replies, and to close the connection.
   public func update() throws -> Echo_EchoUpdateCall {
   public func update() throws -> Echo_EchoUpdateCall {
     return try Echo_EchoUpdateCall(channel).run(metadata:metadata)
     return try Echo_EchoUpdateCall(channel).run(metadata:metadata)
   }
   }
-}
+}

+ 10 - 11
Samples/Echo/Sources/echo.server.pb.swift

@@ -1,3 +1,11 @@
+/*
+ * DO NOT EDIT.
+ *
+ * Generated by the protocol buffer compiler.
+ * Source: echo.proto
+ *
+ */
+
 /*
 /*
  *
  *
  * Copyright 2016, Google Inc.
  * Copyright 2016, Google Inc.
@@ -31,8 +39,6 @@
  *
  *
  */
  */
 
 
-// all code that follows is to-be-generated
-
 import Foundation
 import Foundation
 import gRPC
 import gRPC
 
 
@@ -42,11 +48,10 @@ public enum Echo_EchoServerError : Error {
 
 
 public protocol Echo_EchoProvider {
 public protocol Echo_EchoProvider {
   func get(request : Echo_EchoRequest) throws -> Echo_EchoResponse
   func get(request : Echo_EchoRequest) throws -> Echo_EchoResponse
-  func collect(session : Echo_EchoCollectSession) throws
   func expand(request : Echo_EchoRequest, session : Echo_EchoExpandSession) throws
   func expand(request : Echo_EchoRequest, session : Echo_EchoExpandSession) throws
+  func collect(session : Echo_EchoCollectSession) throws
   func update(session : Echo_EchoUpdateSession) throws
   func update(session : Echo_EchoUpdateSession) throws
 }
 }
-
 // unary
 // unary
 public class Echo_EchoGetSession {
 public class Echo_EchoGetSession {
   var handler : gRPC.Handler
   var handler : gRPC.Handler
@@ -75,7 +80,6 @@ public class Echo_EchoGetSession {
     }
     }
   }
   }
 }
 }
-
 // server streaming
 // server streaming
 public class Echo_EchoExpandSession {
 public class Echo_EchoExpandSession {
   var handler : gRPC.Handler
   var handler : gRPC.Handler
@@ -111,7 +115,6 @@ public class Echo_EchoExpandSession {
     }
     }
   }
   }
 }
 }
-
 // client streaming
 // client streaming
 public class Echo_EchoCollectSession {
 public class Echo_EchoCollectSession {
   var handler : gRPC.Handler
   var handler : gRPC.Handler
@@ -151,7 +154,6 @@ public class Echo_EchoCollectSession {
 
 
   fileprivate func run(queue:DispatchQueue) {
   fileprivate func run(queue:DispatchQueue) {
     do {
     do {
-      print("EchoCollectSession run")
       try self.handler.sendMetadata(initialMetadata:Metadata()) {
       try self.handler.sendMetadata(initialMetadata:Metadata()) {
         queue.async {
         queue.async {
           try! self.provider.collect(session:self)
           try! self.provider.collect(session:self)
@@ -162,7 +164,6 @@ public class Echo_EchoCollectSession {
     }
     }
   }
   }
 }
 }
-
 // fully streaming
 // fully streaming
 public class Echo_EchoUpdateSession {
 public class Echo_EchoUpdateSession {
   var handler : gRPC.Handler
   var handler : gRPC.Handler
@@ -223,7 +224,6 @@ public class Echo_EchoUpdateSession {
     }
     }
   }
   }
 }
 }
-
 //
 //
 // main server for generated service
 // main server for generated service
 //
 //
@@ -279,5 +279,4 @@ public class Echo_EchoServer {
       }
       }
     }
     }
   }
   }
-}
-
+}