소스 검색

Merge pull request #176 from MrMage/move-examples-into-main-package

Move the Echo and Simple PackageManager examples into the main package
Tim Burks 7 년 전
부모
커밋
0795386b25
83개의 변경된 파일68개의 추가작업 그리고 130개의 파일을 삭제
  1. 3 3
      .gitignore
  2. 1 1
      .travis.yml
  3. 0 35
      Examples/Echo/PackageManager/Package.swift
  4. 0 1
      Examples/Echo/PackageManager/Sources/EchoProvider.swift
  5. 0 1
      Examples/Echo/PackageManager/Sources/echo.grpc.swift
  6. 0 1
      Examples/Echo/PackageManager/Sources/echo.pb.swift
  7. 5 5
      Examples/EchoXcode/Echo.xcodeproj/project.pbxproj
  8. 0 0
      Examples/EchoXcode/Echo/AppDelegate.swift
  9. 0 0
      Examples/EchoXcode/Echo/Assets.xcassets/AppIcon.appiconset/Contents.json
  10. 0 0
      Examples/EchoXcode/Echo/Base.lproj/MainMenu.xib
  11. 1 1
      Examples/EchoXcode/Echo/EchoViewController.swift
  12. 0 0
      Examples/EchoXcode/Echo/Info.plist
  13. 0 0
      Examples/EchoXcode/Echo/ssl.crt
  14. 0 0
      Examples/EchoXcode/Echo/ssl.key
  15. 1 1
      Examples/EchoXcode/README.md
  16. 1 1
      Examples/Google/Datastore/Package.swift
  17. 1 1
      Examples/Google/Datastore/Sources/main.swift
  18. 1 1
      Examples/Google/NaturalLanguage/Package.swift
  19. 1 1
      Examples/Google/NaturalLanguage/Sources/main.swift
  20. 1 1
      Examples/Google/Spanner/Package.swift
  21. 1 1
      Examples/Google/Spanner/Sources/main.swift
  22. 0 8
      Examples/Simple/PackageManager/Makefile
  23. 0 33
      Examples/Simple/PackageManager/Package.swift
  24. 0 0
      Examples/SimpleXcode/README.md
  25. 0 0
      Examples/SimpleXcode/Simple.xcodeproj/project.pbxproj
  26. 1 1
      Examples/SimpleXcode/Simple/AppDelegate.swift
  27. 0 0
      Examples/SimpleXcode/Simple/Assets.xcassets/AppIcon.appiconset/Contents.json
  28. 0 0
      Examples/SimpleXcode/Simple/Base.lproj/Document.xib
  29. 0 0
      Examples/SimpleXcode/Simple/Base.lproj/MainMenu.xib
  30. 1 1
      Examples/SimpleXcode/Simple/Document.swift
  31. 0 0
      Examples/SimpleXcode/Simple/Info.plist
  32. 12 6
      Makefile
  33. 15 4
      Package.swift
  34. 1 1
      Sources/EchoExample/EchoProvider.swift
  35. 1 1
      Sources/EchoExample/Generated/echo.grpc.swift
  36. 0 0
      Sources/EchoExample/Generated/echo.pb.swift
  37. 1 1
      Sources/EchoExample/Makefile
  38. 2 2
      Sources/EchoExample/README.md
  39. 0 0
      Sources/EchoExample/RUNME
  40. 4 4
      Sources/EchoExample/echo.proto
  41. 5 5
      Sources/EchoExample/main.swift
  42. 0 0
      Sources/EchoExample/ssl.crt
  43. 0 0
      Sources/EchoExample/ssl.key
  44. 0 0
      Sources/EchoExample/test.gold
  45. 0 0
      Sources/SimpleExample/README.md
  46. 1 1
      Sources/SimpleExample/main.swift
  47. 0 0
      Sources/SwiftGRPC/ByteBuffer.swift
  48. 0 0
      Sources/SwiftGRPC/Call.swift
  49. 0 0
      Sources/SwiftGRPC/Channel.swift
  50. 0 0
      Sources/SwiftGRPC/CompletionQueue.swift
  51. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ClientCall.swift
  52. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ClientCallBidirectionalStreaming.swift
  53. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ClientCallClientStreaming.swift
  54. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ClientCallServerStreaming.swift
  55. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ClientCallUnary.swift
  56. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ClientError.swift
  57. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ServerError.swift
  58. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ServerSession.swift
  59. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ServerSessionBidirectionalStreaming.swift
  60. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ServerSessionClientStreaming.swift
  61. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ServerSessionServerStreaming.swift
  62. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ServerSessionUnary.swift
  63. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ServiceClient.swift
  64. 0 0
      Sources/SwiftGRPC/GenCodeSupport/ServiceServer.swift
  65. 0 0
      Sources/SwiftGRPC/Handler.swift
  66. 0 0
      Sources/SwiftGRPC/Metadata.swift
  67. 0 0
      Sources/SwiftGRPC/Mutex.swift
  68. 0 0
      Sources/SwiftGRPC/Operation.swift
  69. 0 0
      Sources/SwiftGRPC/OperationGroup.swift
  70. 0 0
      Sources/SwiftGRPC/Roots.swift
  71. 0 0
      Sources/SwiftGRPC/Server.swift
  72. 0 0
      Sources/SwiftGRPC/gRPC.swift
  73. 1 1
      Sources/protoc-gen-swiftgrpc/Generator.swift
  74. 1 1
      Tests/LinuxMain.swift
  75. 1 0
      Tests/SwiftGRPCTests/EchoProvider.swift
  76. 1 1
      Tests/SwiftGRPCTests/EchoTests.swift
  77. 1 1
      Tests/SwiftGRPCTests/GRPCTests.swift
  78. 0 0
      Tests/SwiftGRPCTests/TestKeys.swift
  79. 1 0
      Tests/SwiftGRPCTests/echo.grpc.swift
  80. 1 0
      Tests/SwiftGRPCTests/echo.pb.swift
  81. 0 1
      Tests/gRPCTests/EchoProvider.swift
  82. 0 1
      Tests/gRPCTests/echo.grpc.swift
  83. 0 1
      Tests/gRPCTests/echo.pb.swift

+ 3 - 3
.gitignore

@@ -10,8 +10,8 @@ Plugin/Sources/protoc-gen-swiftgrpc/templates.swift
 Plugin/protoc-*
 Plugin/swiftgrpc.log
 Plugin/echo.*.swift
-Examples/Echo/PackageManager/Echo
-Examples/Echo/PackageManager/test.out
-Examples/Echo/PackageManager/echo.pid
+Echo
+test.out
+echo.pid
 SwiftGRPC.xcodeproj
 Package.resolved

+ 1 - 1
.travis.yml

@@ -42,4 +42,4 @@ script:
   - export LD_LIBRARY_PATH=$HOME/local/lib
   - make test
   - make test-plugin
-  - make test-examples
+  - make test-echo

+ 0 - 35
Examples/Echo/PackageManager/Package.swift

@@ -1,35 +0,0 @@
-// swift-tools-version:4.0
-
-/*
- * Copyright 2017, gRPC Authors All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import PackageDescription
-
-let package = Package(
-  name: "Echo",
-  dependencies: [
-    .package(url: "../../..", .branch("HEAD")),
-    .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2"),
-    .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0")
-  ],
-  targets: [
-    .target(name: "Echo",
-            dependencies: [
-              "gRPC",
-              "SwiftProtobuf",
-              "Commander"
-            ],
-	    path: "Sources")
-  ])

+ 0 - 1
Examples/Echo/PackageManager/Sources/EchoProvider.swift

@@ -1 +0,0 @@
-../../EchoProvider.swift

+ 0 - 1
Examples/Echo/PackageManager/Sources/echo.grpc.swift

@@ -1 +0,0 @@
-../../Generated/echo.grpc.swift

+ 0 - 1
Examples/Echo/PackageManager/Sources/echo.pb.swift

@@ -1 +0,0 @@
-../../Generated/echo.pb.swift

+ 5 - 5
Examples/Echo/Xcode/Echo.xcodeproj/project.pbxproj → Examples/EchoXcode/Echo.xcodeproj/project.pbxproj

@@ -17,7 +17,7 @@
 		D36AB73D1F58DF10007D7184 /* BoringSSL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D36AB7281F58DEDB007D7184 /* BoringSSL.framework */; };
 		D36AB73E1F58DF10007D7184 /* CgRPC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D36AB7261F58DEDB007D7184 /* CgRPC.framework */; };
 		D36AB73F1F58DF10007D7184 /* Czlib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D36AB7241F58DEDB007D7184 /* Czlib.framework */; };
-		D36AB7401F58DF10007D7184 /* gRPC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D36AB72A1F58DEDB007D7184 /* gRPC.framework */; };
+		D36AB7401F58DF10007D7184 /* SwiftGRPC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D36AB72A1F58DEDB007D7184 /* SwiftGRPC.framework */; };
 		D36AB7411F58DF10007D7184 /* SwiftProtobuf.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D36AB7341F58DEDB007D7184 /* SwiftProtobuf.framework */; };
 		D3971E211D89132E001A0B3F /* ssl.key in Resources */ = {isa = PBXBuildFile; fileRef = D3971E201D89132E001A0B3F /* ssl.key */; };
 		D3BFE28C1D87A45D00A648D8 /* ssl.crt in Resources */ = {isa = PBXBuildFile; fileRef = D3BFE28B1D87A45D00A648D8 /* ssl.crt */; };
@@ -83,10 +83,10 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
-		D315DEDF1EE8B29A007670CE /* SwiftProtobuf.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftProtobuf.xcodeproj; path = "../../../third_party/swift-protobuf/SwiftProtobuf.xcodeproj"; sourceTree = "<group>"; };
-		D353581D1E219963007FA223 /* echo.grpc.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = echo.grpc.swift; path = ../Generated/echo.grpc.swift; sourceTree = "<group>"; };
-		D353581E1E219963007FA223 /* echo.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = echo.pb.swift; path = ../Generated/echo.pb.swift; sourceTree = "<group>"; };
-		D35358241E219980007FA223 /* EchoProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EchoProvider.swift; path = ../EchoProvider.swift; sourceTree = "<group>"; };
+		D315DEDF1EE8B29A007670CE /* SwiftProtobuf.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftProtobuf.xcodeproj; path = "../../third_party/swift-protobuf/SwiftProtobuf.xcodeproj"; sourceTree = "<group>"; };
+		D353581D1E219963007FA223 /* echo.grpc.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = echo.grpc.swift; path = ../../Sources/EchoExample/Generated/echo.grpc.swift; sourceTree = "<group>"; };
+		D353581E1E219963007FA223 /* echo.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = echo.pb.swift; path = ../../Sources/EchoExample/Generated/echo.pb.swift; sourceTree = "<group>"; };
+		D35358241E219980007FA223 /* EchoProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EchoProvider.swift; path = ../../Sources/EchoExample/EchoProvider.swift; sourceTree = "<group>"; };
 		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>"; };
 		D35C9FAD1D74B079000443CD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };

+ 0 - 0
Examples/Echo/Xcode/Echo/AppDelegate.swift → Examples/EchoXcode/Echo/AppDelegate.swift


+ 0 - 0
Examples/Echo/Xcode/Echo/Assets.xcassets/AppIcon.appiconset/Contents.json → Examples/EchoXcode/Echo/Assets.xcassets/AppIcon.appiconset/Contents.json


+ 0 - 0
Examples/Echo/Xcode/Echo/Base.lproj/MainMenu.xib → Examples/EchoXcode/Echo/Base.lproj/MainMenu.xib


+ 1 - 1
Examples/Echo/Xcode/Echo/EchoViewController.swift → Examples/EchoXcode/Echo/EchoViewController.swift

@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 import AppKit
-import gRPC
+import SwiftGRPC
 
 class EchoViewController: NSViewController, NSTextFieldDelegate {
   @IBOutlet var messageField: NSTextField!

+ 0 - 0
Examples/Echo/Xcode/Echo/Info.plist → Examples/EchoXcode/Echo/Info.plist


+ 0 - 0
Examples/Echo/Xcode/Echo/ssl.crt → Examples/EchoXcode/Echo/ssl.crt


+ 0 - 0
Examples/Echo/Xcode/Echo/ssl.key → Examples/EchoXcode/Echo/ssl.key


+ 1 - 1
Examples/Echo/Xcode/README.md → Examples/EchoXcode/README.md

@@ -1,6 +1,6 @@
 # Echo gRPC Sample App
 
-The Echo Xcode project contains a Mac app that can be used to 
+The Echo Xcode project contains a Mac app that can be used to
 instantiate and run local gRPC clients and servers. It depends
 on the gRPC Xcode project, which requires a local build of the
 gRPC Core C library. To build that, please run "make" in the

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

@@ -28,7 +28,7 @@ let package = Package(
   targets: [
     .target(name: "Datastore",
             dependencies: [
-              "gRPC",
+              "SwiftGRPC",
               "SwiftProtobuf",
               "Commander",
 	            "OAuth2"

+ 1 - 1
Examples/Google/Datastore/Sources/main.swift

@@ -16,7 +16,7 @@
 import Commander
 import Dispatch
 import Foundation
-import gRPC
+import SwiftGRPC
 import OAuth2
 
 // Convert Encodable objects to dictionaries of property-value pairs.

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

@@ -28,7 +28,7 @@ let package = Package(
   targets: [
     .target(name: "NaturalLanguage",
             dependencies: [
-              "gRPC",
+              "SwiftGRPC",
               "SwiftProtobuf",
               "Commander",
 	            "OAuth2"

+ 1 - 1
Examples/Google/NaturalLanguage/Sources/main.swift

@@ -15,7 +15,7 @@
  */
 import Dispatch
 import Foundation
-import gRPC
+import SwiftGRPC
 import OAuth2
 
 let scopes = ["https://www.googleapis.com/auth/cloud-language"]

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

@@ -28,7 +28,7 @@ let package = Package(
   targets: [
     .target(name: "Spanner",
             dependencies: [
-              "gRPC",
+              "SwiftGRPC",
               "SwiftProtobuf",
               "Commander",
 	            "OAuth2"

+ 1 - 1
Examples/Google/Spanner/Sources/main.swift

@@ -15,7 +15,7 @@
  */
 import Commander
 import Foundation
-import gRPC
+import SwiftGRPC
 import OAuth2
 
 Group {

+ 0 - 8
Examples/Simple/PackageManager/Makefile

@@ -1,8 +0,0 @@
-
-all:
-	swift build
-
-clean :
-	rm -rf Packages
-	rm -rf .build
-	rm -rf Package.pins Package.resolved

+ 0 - 33
Examples/Simple/PackageManager/Package.swift

@@ -1,33 +0,0 @@
-// swift-tools-version:4.0
-
-/*
- * Copyright 2017, gRPC Authors All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import PackageDescription
-
-let package = Package(
-  name: "Simple",
-  dependencies: [
-    .package(url: "../../..", .branch("HEAD")),
-    .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0")
-  ],
-  targets: [
-    .target(name: "Simple",
-            dependencies: [
-              "gRPC",
-              "Commander"
-            ],
-	    path: ".")
-  ])

+ 0 - 0
Examples/Simple/Xcode/README.md → Examples/SimpleXcode/README.md


+ 0 - 0
Examples/Simple/Xcode/Simple.xcodeproj/project.pbxproj → Examples/SimpleXcode/Simple.xcodeproj/project.pbxproj


+ 1 - 1
Examples/Simple/Xcode/Simple/AppDelegate.swift → Examples/SimpleXcode/Simple/AppDelegate.swift

@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 import Cocoa
-import gRPC
+import SwiftGRPC
 
 @NSApplicationMain
 class AppDelegate: NSObject, NSApplicationDelegate {

+ 0 - 0
Examples/Simple/Xcode/Simple/Assets.xcassets/AppIcon.appiconset/Contents.json → Examples/SimpleXcode/Simple/Assets.xcassets/AppIcon.appiconset/Contents.json


+ 0 - 0
Examples/Simple/Xcode/Simple/Base.lproj/Document.xib → Examples/SimpleXcode/Simple/Base.lproj/Document.xib


+ 0 - 0
Examples/Simple/Xcode/Simple/Base.lproj/MainMenu.xib → Examples/SimpleXcode/Simple/Base.lproj/MainMenu.xib


+ 1 - 1
Examples/Simple/Xcode/Simple/Document.swift → Examples/SimpleXcode/Simple/Document.swift

@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 import Cocoa
-import gRPC
+import SwiftGRPC
 
 // https://gist.github.com/rickw/cc198001f5f3aa59ae9f
 extension NSTextView {

+ 0 - 0
Examples/Simple/Xcode/Simple/Info.plist → Examples/SimpleXcode/Simple/Info.plist


+ 12 - 6
Makefile

@@ -12,13 +12,19 @@ project:
 test:	all
 	swift test -v $(CFLAGS)
 
-test-examples:
-	cd Examples/Echo/PackageManager; make test
-	cd Examples/Simple/PackageManager; make
+test-echo:	all
+	cp .build/debug/Echo .
+	./Echo serve & /bin/echo $$! > echo.pid
+	./Echo get | tee test.out
+	./Echo expand | tee -a test.out
+	./Echo collect | tee -a test.out
+	./Echo update | tee -a test.out
+	kill -9 `cat echo.pid`
+	diff -u test.out Sources/EchoExample/test.gold
 
-test-plugin:
-	protoc Examples/Echo/echo.proto --proto_path=Examples/Echo --plugin=.build/debug/protoc-gen-swiftgrpc --swiftgrpc_out=/tmp --swiftgrpc_opt=TestStubs=true
-	diff /tmp/echo.grpc.swift Examples/Echo/Generated/echo.grpc.swift
+test-plugin: all
+	protoc Sources/EchoExample/echo.proto --proto_path=Sources/EchoExample --plugin=.build/debug/protoc-gen-swift --plugin=.build/debug/protoc-gen-swiftgrpc --swiftgrpc_out=/tmp --swiftgrpc_opt=TestStubs=true
+	diff -u /tmp/echo.grpc.swift Sources/EchoExample/Generated/echo.grpc.swift
 
 clean:
 	rm -rf Packages

+ 15 - 4
Package.swift

@@ -20,14 +20,15 @@ import PackageDescription
 let package = Package(
   name: "SwiftGRPC",
   products: [
-    .library(name: "gRPC", targets: ["gRPC"]),
+    .library(name: "SwiftGRPC", targets: ["SwiftGRPC"]),
   ],
   dependencies: [
     .package(url: "https://github.com/Zewo/zlib.git", from: "0.4.0"),
-    .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2")
+    .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2"),
+    .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0")
   ],
   targets: [
-    .target(name: "gRPC",
+    .target(name: "SwiftGRPC",
             dependencies: ["CgRPC", "SwiftProtobuf"]),
     .target(name: "CgRPC",
             dependencies: ["BoringSSL", "zlib"]),
@@ -38,5 +39,15 @@ let package = Package(
               "SwiftProtobufPluginLibrary",
               "protoc-gen-swift"]),
     .target(name: "BoringSSL"),
-    .testTarget(name: "gRPCTests", dependencies: ["gRPC"])
+    .target(name: "Echo",
+            dependencies: [
+              "SwiftGRPC",
+              "SwiftProtobuf",
+              "Commander"
+            ],
+            path: "Sources/EchoExample"),
+    .target(name: "Simple",
+            dependencies: ["SwiftGRPC", "Commander"],
+            path: "Sources/SimpleExample"),
+    .testTarget(name: "SwiftGRPCTests", dependencies: ["SwiftGRPC"])
   ])

+ 1 - 1
Examples/Echo/EchoProvider.swift → Sources/EchoExample/EchoProvider.swift

@@ -15,7 +15,7 @@
  */
 import Dispatch
 import Foundation
-import gRPC
+import SwiftGRPC
 
 class EchoProvider: Echo_EchoProvider {
   // get returns requests as they were received.

+ 1 - 1
Examples/Echo/Generated/echo.grpc.swift → Sources/EchoExample/Generated/echo.grpc.swift

@@ -22,7 +22,7 @@
 //
 import Foundation
 import Dispatch
-import gRPC
+import SwiftGRPC
 import SwiftProtobuf
 
 internal protocol Echo_EchoGetCall: ClientCallUnary {}

+ 0 - 0
Examples/Echo/Generated/echo.pb.swift → Sources/EchoExample/Generated/echo.pb.swift


+ 1 - 1
Examples/Echo/PackageManager/Makefile → Sources/EchoExample/Makefile

@@ -11,7 +11,7 @@ test:	all
 	./Echo update | tee -a test.out
 	kill -9 `cat echo.pid`
 	diff -u test.out test.gold
-	
+
 project:
 	swift package generate-xcodeproj
 

+ 2 - 2
Examples/Echo/README.md → Sources/EchoExample/README.md

@@ -1,10 +1,10 @@
 # Echo, a gRPC Sample App
 
 This directory contains a simple echo server and client
-that demonstrates all four gRPC API styles (Unary, Server 
+that demonstrates all four gRPC API styles (Unary, Server
 Streaming, Client Streaming, and Bidirectional Streaming).
 
-The [Xcode](Xcode) directory contains a Mac app and 
+The [Xcode](Xcode) directory contains a Mac app and
 [PackageManager](PackageManager) contains a command-line tool
 that can be built with the Swift Package Manager. Both contain
 a Swift client and server.

+ 0 - 0
Examples/Echo/RUNME → Sources/EchoExample/RUNME


+ 4 - 4
Examples/Echo/echo.proto → Sources/EchoExample/echo.proto

@@ -19,13 +19,13 @@ package echo;
 service Echo {
   // Immediately returns an echo of a request.
   rpc Get(EchoRequest) returns (EchoResponse) {}
-  
+
   // Splits a request into words and returns each word in a stream of messages.
-  rpc Expand(EchoRequest) returns (stream EchoResponse) {}  
-  
+  rpc Expand(EchoRequest) returns (stream EchoResponse) {}
+
   // Collects a stream of messages and returns them concatenated when the caller closes.
   rpc Collect(stream EchoRequest) returns (EchoResponse) {}
-  
+
   // Streams back messages as they are received in an input stream.
   rpc Update(stream EchoRequest) returns (stream EchoResponse) {}
 }

+ 5 - 5
Examples/Echo/PackageManager/Sources/main.swift → Sources/EchoExample/main.swift

@@ -16,7 +16,7 @@
 import Commander
 import Dispatch
 import Foundation
-import gRPC
+import SwiftGRPC
 
 // Common flags and options
 let sslFlag = Flag("ssl", description: "if true, use SSL for connections")
@@ -141,7 +141,7 @@ Group {
       requestMessage.text = part
       print("collect sending: " + part)
       try collectCall.send(requestMessage) { error in
-        if let error = error {	
+        if let error = error {
           print("collect send error \(error)")
         }
       }
@@ -172,15 +172,15 @@ Group {
       requestMessage.text = part
       print("update sending: " + requestMessage.text)
       try updateCall.send(requestMessage) { error in
-        if let error = error {	
+        if let error = error {
           print("update send error \(error)")
         }
       }
     }
     updateCall.waitForSendOperationsToFinish()
-    
+
     try updateCall.closeSend()
-    
+
     while true {
       do {
         let responseMessage = try updateCall.receive()

+ 0 - 0
Examples/Echo/PackageManager/ssl.crt → Sources/EchoExample/ssl.crt


+ 0 - 0
Examples/Echo/PackageManager/ssl.key → Sources/EchoExample/ssl.key


+ 0 - 0
Examples/Echo/PackageManager/test.gold → Sources/EchoExample/test.gold


+ 0 - 0
Examples/Simple/PackageManager/README.md → Sources/SimpleExample/README.md


+ 1 - 1
Examples/Simple/PackageManager/main.swift → Sources/SimpleExample/main.swift

@@ -16,7 +16,7 @@
 import Commander
 import Dispatch
 import Foundation
-import gRPC
+import SwiftGRPC
 
 let address = "localhost:8001"
 let host = "foo.test.google.fr"

+ 0 - 0
Sources/gRPC/ByteBuffer.swift → Sources/SwiftGRPC/ByteBuffer.swift


+ 0 - 0
Sources/gRPC/Call.swift → Sources/SwiftGRPC/Call.swift


+ 0 - 0
Sources/gRPC/Channel.swift → Sources/SwiftGRPC/Channel.swift


+ 0 - 0
Sources/gRPC/CompletionQueue.swift → Sources/SwiftGRPC/CompletionQueue.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ClientCall.swift → Sources/SwiftGRPC/GenCodeSupport/ClientCall.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ClientCallBidirectionalStreaming.swift → Sources/SwiftGRPC/GenCodeSupport/ClientCallBidirectionalStreaming.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ClientCallClientStreaming.swift → Sources/SwiftGRPC/GenCodeSupport/ClientCallClientStreaming.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ClientCallServerStreaming.swift → Sources/SwiftGRPC/GenCodeSupport/ClientCallServerStreaming.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ClientCallUnary.swift → Sources/SwiftGRPC/GenCodeSupport/ClientCallUnary.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ClientError.swift → Sources/SwiftGRPC/GenCodeSupport/ClientError.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ServerError.swift → Sources/SwiftGRPC/GenCodeSupport/ServerError.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ServerSession.swift → Sources/SwiftGRPC/GenCodeSupport/ServerSession.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ServerSessionBidirectionalStreaming.swift → Sources/SwiftGRPC/GenCodeSupport/ServerSessionBidirectionalStreaming.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ServerSessionClientStreaming.swift → Sources/SwiftGRPC/GenCodeSupport/ServerSessionClientStreaming.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ServerSessionServerStreaming.swift → Sources/SwiftGRPC/GenCodeSupport/ServerSessionServerStreaming.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ServerSessionUnary.swift → Sources/SwiftGRPC/GenCodeSupport/ServerSessionUnary.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ServiceClient.swift → Sources/SwiftGRPC/GenCodeSupport/ServiceClient.swift


+ 0 - 0
Sources/gRPC/GenCodeSupport/ServiceServer.swift → Sources/SwiftGRPC/GenCodeSupport/ServiceServer.swift


+ 0 - 0
Sources/gRPC/Handler.swift → Sources/SwiftGRPC/Handler.swift


+ 0 - 0
Sources/gRPC/Metadata.swift → Sources/SwiftGRPC/Metadata.swift


+ 0 - 0
Sources/gRPC/Mutex.swift → Sources/SwiftGRPC/Mutex.swift


+ 0 - 0
Sources/gRPC/Operation.swift → Sources/SwiftGRPC/Operation.swift


+ 0 - 0
Sources/gRPC/OperationGroup.swift → Sources/SwiftGRPC/OperationGroup.swift


+ 0 - 0
Sources/gRPC/Roots.swift → Sources/SwiftGRPC/Roots.swift


+ 0 - 0
Sources/gRPC/Server.swift → Sources/SwiftGRPC/Server.swift


+ 0 - 0
Sources/gRPC/gRPC.swift → Sources/SwiftGRPC/gRPC.swift


+ 1 - 1
Sources/protoc-gen-swiftgrpc/Generator.swift

@@ -73,7 +73,7 @@ class Generator {
       //\n
       """)
     
-    for moduleName in ["Foundation", "Dispatch", "gRPC", "SwiftProtobuf"] {
+    for moduleName in ["Foundation", "Dispatch", "SwiftGRPC", "SwiftProtobuf"] {
       println("import \(moduleName)")
     }
     println()

+ 1 - 1
Tests/LinuxMain.swift

@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 import XCTest
-@testable import gRPCTests
+@testable import SwiftGRPCTests
 
 XCTMain([
   testCase(gRPCTests.allTests),

+ 1 - 0
Tests/SwiftGRPCTests/EchoProvider.swift

@@ -0,0 +1 @@
+../../Sources/EchoExample/EchoProvider.swift

+ 1 - 1
Tests/gRPCTests/EchoTests.swift → Tests/SwiftGRPCTests/EchoTests.swift

@@ -15,7 +15,7 @@
  */
 import Dispatch
 import Foundation
-@testable import gRPC
+@testable import SwiftGRPC
 import XCTest
 
 extension Echo_EchoRequest {

+ 1 - 1
Tests/gRPCTests/GRPCTests.swift → Tests/SwiftGRPCTests/GRPCTests.swift

@@ -15,7 +15,7 @@
  */
 import Dispatch
 import Foundation
-@testable import gRPC
+@testable import SwiftGRPC
 import XCTest
 
 class gRPCTests: XCTestCase {

+ 0 - 0
Tests/gRPCTests/TestKeys.swift → Tests/SwiftGRPCTests/TestKeys.swift


+ 1 - 0
Tests/SwiftGRPCTests/echo.grpc.swift

@@ -0,0 +1 @@
+../../Sources/EchoExample/Generated/echo.grpc.swift

+ 1 - 0
Tests/SwiftGRPCTests/echo.pb.swift

@@ -0,0 +1 @@
+../../Sources/EchoExample/Generated/echo.pb.swift

+ 0 - 1
Tests/gRPCTests/EchoProvider.swift

@@ -1 +0,0 @@
-../../Examples/Echo/EchoProvider.swift

+ 0 - 1
Tests/gRPCTests/echo.grpc.swift

@@ -1 +0,0 @@
-../../Examples/Echo/Generated/echo.grpc.swift

+ 0 - 1
Tests/gRPCTests/echo.pb.swift

@@ -1 +0,0 @@
-../../Examples/Echo/Generated/echo.pb.swift