Package.swift 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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: "protoc-gen-grpc-swift", targets: ["protoc-gen-grpc-swift"]),
  24. ],
  25. dependencies: [
  26. // GRPC dependencies:
  27. // Main SwiftNIO package
  28. .package(url: "https://github.com/apple/swift-nio.git", from: "2.7.1"),
  29. // HTTP2 via SwiftNIO
  30. .package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.5.0"),
  31. // TLS via SwiftNIO
  32. .package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.4.0"),
  33. // Support for Network.framework where possible.
  34. .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.1.0"),
  35. // Official SwiftProtobuf library, for [de]serializing data to send on the wire.
  36. .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.5.0"),
  37. // Logging API.
  38. .package(url: "https://github.com/apple/swift-log", from: "1.0.0"),
  39. ],
  40. targets: [
  41. // The main GRPC module.
  42. .target(
  43. name: "GRPC",
  44. dependencies: [
  45. "NIO",
  46. "NIOFoundationCompat",
  47. "NIOTransportServices",
  48. "NIOHTTP1",
  49. "NIOHTTP2",
  50. "NIOSSL",
  51. "SwiftProtobuf",
  52. "Logging"
  53. ]
  54. ), // and its tests.
  55. .testTarget(
  56. name: "GRPCTests",
  57. dependencies: [
  58. "GRPC",
  59. "EchoModel",
  60. "EchoImplementation",
  61. "GRPCSampleData",
  62. "GRPCInteroperabilityTestsImplementation"
  63. ]
  64. ),
  65. // The `protoc` plugin.
  66. .target(
  67. name: "protoc-gen-grpc-swift",
  68. dependencies: [
  69. "SwiftProtobuf",
  70. "SwiftProtobufPluginLibrary",
  71. "protoc-gen-swift"
  72. ]
  73. ),
  74. // Interoperability tests implementation.
  75. .target(
  76. name: "GRPCInteroperabilityTestsImplementation",
  77. dependencies: [
  78. "GRPC",
  79. "GRPCInteroperabilityTestModels"
  80. ]
  81. ),
  82. // Generated interoperability test models.
  83. .target(
  84. name: "GRPCInteroperabilityTestModels",
  85. dependencies: [
  86. "GRPC",
  87. "NIO",
  88. "NIOHTTP1",
  89. "SwiftProtobuf"
  90. ]
  91. ),
  92. // The CLI for the interoperability tests.
  93. .target(
  94. name: "GRPCInteroperabilityTests",
  95. dependencies: [
  96. "GRPCInteroperabilityTestsImplementation",
  97. "Logging",
  98. ]
  99. ),
  100. // The connection backoff interoperability test.
  101. .target(
  102. name: "GRPCConnectionBackoffInteropTest",
  103. dependencies: [
  104. "GRPC",
  105. "GRPCInteroperabilityTestModels",
  106. "Logging",
  107. ]
  108. ),
  109. // Performance tests implementation and CLI.
  110. .target(
  111. name: "GRPCPerformanceTests",
  112. dependencies: [
  113. "GRPC",
  114. "EchoModel",
  115. "EchoImplementation",
  116. "NIO",
  117. "NIOSSL",
  118. ]
  119. ),
  120. // Sample data, used in examples and tests.
  121. .target(
  122. name: "GRPCSampleData",
  123. dependencies: ["NIOSSL"]
  124. ),
  125. // Echo example CLI.
  126. .target(
  127. name: "Echo",
  128. dependencies: [
  129. "EchoModel",
  130. "EchoImplementation",
  131. "GRPC",
  132. "GRPCSampleData",
  133. "SwiftProtobuf",
  134. ],
  135. path: "Sources/Examples/Echo/Runtime"
  136. ),
  137. // Echo example service implementation.
  138. .target(
  139. name: "EchoImplementation",
  140. dependencies: [
  141. "EchoModel",
  142. "GRPC",
  143. "SwiftProtobuf"
  144. ],
  145. path: "Sources/Examples/Echo/Implementation"
  146. ),
  147. // Model for Echo example.
  148. .target(
  149. name: "EchoModel",
  150. dependencies: [
  151. "GRPC",
  152. "NIO",
  153. "NIOHTTP1",
  154. "SwiftProtobuf"
  155. ],
  156. path: "Sources/Examples/Echo/Model"
  157. ),
  158. ]
  159. )