2
0

Package.swift 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. // swift-tools-version:5.0
  2. /*
  3. * Copyright 2017, gRPC Authors All rights reserved.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. import PackageDescription
  18. import Foundation
  19. let package = Package(
  20. name: "GRPC",
  21. products: [
  22. .library(name: "GRPC", targets: ["GRPC"]),
  23. .executable(name: "InteroperabilityTestRunner", targets: ["GRPCInteroperabilityTests"]),
  24. .executable(name: "ConnectionBackoffInteropTestRunner", targets: ["GRPCConnectionBackoffInteropTest"]),
  25. .executable(name: "PerformanceTestRunner", targets: ["GRPCPerformanceTests"]),
  26. .executable(name: "Echo", targets: ["Echo"]),
  27. ],
  28. dependencies: [
  29. // GRPC dependencies:
  30. // Main SwiftNIO package
  31. .package(url: "https://github.com/apple/swift-nio.git", from: "2.7.1"),
  32. // HTTP2 via SwiftNIO
  33. .package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.5.0"),
  34. // TLS via SwiftNIO
  35. .package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.4.0"),
  36. // Support for Network.framework where possible.
  37. .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.1.0"),
  38. // Official SwiftProtobuf library, for [de]serializing data to send on the wire.
  39. .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.5.0"),
  40. // Logging API.
  41. .package(url: "https://github.com/apple/swift-log", from: "1.0.0"),
  42. ],
  43. targets: [
  44. // The main GRPC module.
  45. .target(
  46. name: "GRPC",
  47. dependencies: [
  48. "NIO",
  49. "NIOFoundationCompat",
  50. "NIOTransportServices",
  51. "NIOHTTP1",
  52. "NIOHTTP2",
  53. "NIOSSL",
  54. "SwiftProtobuf",
  55. "Logging"
  56. ]
  57. ), // and its tests.
  58. .testTarget(
  59. name: "GRPCTests",
  60. dependencies: [
  61. "GRPC",
  62. "EchoModel",
  63. "EchoImplementation",
  64. "GRPCSampleData",
  65. "GRPCInteroperabilityTestsImplementation"
  66. ]
  67. ),
  68. // The `protoc` plugin.
  69. .target(
  70. name: "protoc-gen-swiftgrpc",
  71. dependencies: [
  72. "SwiftProtobuf",
  73. "SwiftProtobufPluginLibrary",
  74. "protoc-gen-swift"
  75. ]
  76. ),
  77. // Interoperability tests implementation.
  78. .target(
  79. name: "GRPCInteroperabilityTestsImplementation",
  80. dependencies: [
  81. "GRPC",
  82. "GRPCInteroperabilityTestModels"
  83. ]
  84. ),
  85. // Generated interoperability test models.
  86. .target(
  87. name: "GRPCInteroperabilityTestModels",
  88. dependencies: [
  89. "GRPC",
  90. "NIO",
  91. "NIOHTTP1",
  92. "SwiftProtobuf"
  93. ]
  94. ),
  95. // The CLI for the interoperability tests.
  96. .target(
  97. name: "GRPCInteroperabilityTests",
  98. dependencies: [
  99. "GRPCInteroperabilityTestsImplementation",
  100. "Logging",
  101. ]
  102. ),
  103. // The connection backoff interoperability test.
  104. .target(
  105. name: "GRPCConnectionBackoffInteropTest",
  106. dependencies: [
  107. "GRPC",
  108. "GRPCInteroperabilityTestModels",
  109. "Logging",
  110. ]
  111. ),
  112. // Performance tests implementation and CLI.
  113. .target(
  114. name: "GRPCPerformanceTests",
  115. dependencies: [
  116. "GRPC",
  117. "EchoModel",
  118. "EchoImplementation",
  119. "NIO",
  120. "NIOSSL",
  121. ]
  122. ),
  123. // Sample data, used in examples and tests.
  124. .target(
  125. name: "GRPCSampleData",
  126. dependencies: ["NIOSSL"]
  127. ),
  128. // Echo example CLI.
  129. .target(
  130. name: "Echo",
  131. dependencies: [
  132. "EchoModel",
  133. "EchoImplementation",
  134. "GRPC",
  135. "GRPCSampleData",
  136. "SwiftProtobuf",
  137. ],
  138. path: "Sources/Examples/Echo/Runtime"
  139. ),
  140. // Echo example service implementation.
  141. .target(
  142. name: "EchoImplementation",
  143. dependencies: [
  144. "EchoModel",
  145. "GRPC",
  146. "SwiftProtobuf"
  147. ],
  148. path: "Sources/Examples/Echo/Implementation"
  149. ),
  150. // Model for Echo example.
  151. .target(
  152. name: "EchoModel",
  153. dependencies: [
  154. "GRPC",
  155. "NIO",
  156. "NIOHTTP1",
  157. "SwiftProtobuf"
  158. ],
  159. path: "Sources/Examples/Echo/Model"
  160. ),
  161. ]
  162. )