Package.swift 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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.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. // Command line argument parser for our auxiliary command line tools.
  43. .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
  44. ],
  45. targets: [
  46. // The main GRPC module.
  47. .target(
  48. name: "GRPC",
  49. dependencies: [
  50. "NIO",
  51. "NIOFoundationCompat",
  52. "NIOTransportServices",
  53. "NIOHTTP1",
  54. "NIOHTTP2",
  55. "NIOSSL",
  56. "SwiftProtobuf",
  57. "Logging"
  58. ]
  59. ), // and its tests.
  60. .testTarget(
  61. name: "GRPCTests",
  62. dependencies: [
  63. "GRPC",
  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. "Commander"
  101. ]
  102. ),
  103. // The connection backoff interoperability test.
  104. .target(
  105. name: "GRPCConnectionBackoffInteropTest",
  106. dependencies: [
  107. "GRPC",
  108. "GRPCInteroperabilityTestModels",
  109. ]
  110. ),
  111. // Performance tests implementation and CLI.
  112. .target(
  113. name: "GRPCPerformanceTests",
  114. dependencies: [
  115. "GRPC",
  116. "NIO",
  117. "NIOSSL",
  118. "Commander",
  119. ]
  120. ),
  121. // Sample data, used in examples and tests.
  122. .target(
  123. name: "GRPCSampleData",
  124. dependencies: ["NIOSSL"]
  125. ),
  126. // Echo example.
  127. .target(
  128. name: "Echo",
  129. dependencies: [
  130. "GRPC",
  131. "GRPCSampleData",
  132. "SwiftProtobuf",
  133. "Commander"
  134. ],
  135. path: "Sources/Examples/Echo"
  136. ),
  137. ]
  138. )