Package.swift 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.2.0"),
  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.0.0"),
  36. // Support for Network.framework where possible. Note: from 1.0.2 the package
  37. // is essentially an empty import on platforms where it isn't supported.
  38. .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.0.2"),
  39. // Official SwiftProtobuf library, for [de]serializing data to send on the wire.
  40. .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.5.0"),
  41. // Logging API.
  42. .package(url: "https://github.com/apple/swift-log", from: "1.0.0"),
  43. // Command line argument parser for our auxiliary command line tools.
  44. .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
  45. ],
  46. targets: [
  47. // The main GRPC module.
  48. .target(
  49. name: "GRPC",
  50. dependencies: [
  51. "NIO",
  52. "NIOFoundationCompat",
  53. "NIOTransportServices",
  54. "NIOHTTP1",
  55. "NIOHTTP2",
  56. "NIOSSL",
  57. "SwiftProtobuf",
  58. "Logging"
  59. ]
  60. ), // and its tests.
  61. .testTarget(
  62. name: "GRPCTests",
  63. dependencies: [
  64. "GRPC",
  65. "GRPCSampleData",
  66. "GRPCInteroperabilityTestsImplementation"
  67. ]
  68. ),
  69. // The `protoc` plugin.
  70. .target(
  71. name: "protoc-gen-swiftgrpc",
  72. dependencies: [
  73. "SwiftProtobuf",
  74. "SwiftProtobufPluginLibrary",
  75. "protoc-gen-swift"
  76. ]
  77. ),
  78. // Interoperability tests implementation.
  79. .target(
  80. name: "GRPCInteroperabilityTestsImplementation",
  81. dependencies: [
  82. "GRPC",
  83. "GRPCInteroperabilityTestModels"
  84. ]
  85. ),
  86. // Generated interoperability test models.
  87. .target(
  88. name: "GRPCInteroperabilityTestModels",
  89. dependencies: [
  90. "GRPC",
  91. "NIO",
  92. "NIOHTTP1",
  93. "SwiftProtobuf"
  94. ]
  95. ),
  96. // The CLI for the interoperability tests.
  97. .target(
  98. name: "GRPCInteroperabilityTests",
  99. dependencies: [
  100. "GRPCInteroperabilityTestsImplementation",
  101. "Commander"
  102. ]
  103. ),
  104. // The connection backoff interoperability test.
  105. .target(
  106. name: "GRPCConnectionBackoffInteropTest",
  107. dependencies: [
  108. "GRPC",
  109. "GRPCInteroperabilityTestModels",
  110. ]
  111. ),
  112. // Performance tests implementation and CLI.
  113. .target(
  114. name: "GRPCPerformanceTests",
  115. dependencies: [
  116. "GRPC",
  117. "NIO",
  118. "NIOSSL",
  119. "Commander",
  120. ]
  121. ),
  122. // Sample data, used in examples and tests.
  123. .target(
  124. name: "GRPCSampleData",
  125. dependencies: ["NIOSSL"]
  126. ),
  127. // Echo example.
  128. .target(
  129. name: "Echo",
  130. dependencies: [
  131. "GRPC",
  132. "GRPCSampleData",
  133. "SwiftProtobuf",
  134. "Commander"
  135. ],
  136. path: "Sources/Examples/Echo"
  137. ),
  138. ]
  139. )