2
0

Package.swift 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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: ["GRPCInteroperabilityTestsCLI"]),
  24. .executable(name: "PerformanceTestRunner", targets: ["GRPCPerformanceTests"]),
  25. .executable(name: "Echo", targets: ["Echo"]),
  26. ],
  27. dependencies: [
  28. // GRPC dependencies:
  29. // Main SwiftNIO package
  30. .package(url: "https://github.com/apple/swift-nio.git", from: "2.2.0"),
  31. // HTTP2 via SwiftNIO
  32. .package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.2.1"),
  33. // TLS via SwiftNIO
  34. .package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.0.0"),
  35. // Support for Network.framework where possible. Note: from 1.0.2 the package
  36. // is essentially an empty import on platforms where it isn't supported.
  37. .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.0.2"),
  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. "GRPCInteroperabilityTests"
  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, this target doesn't contain the CLI as the
  78. // interoperability tests are reused in the main test suite.
  79. .target(
  80. name: "GRPCInteroperabilityTests",
  81. dependencies: ["GRPC"]
  82. ),
  83. // The CLI for the interoperability tests.
  84. .target(
  85. name: "GRPCInteroperabilityTestsCLI",
  86. dependencies: [
  87. "GRPCInteroperabilityTests",
  88. "Commander"
  89. ]
  90. ),
  91. // Performance tests and CLI.
  92. .target(
  93. name: "GRPCPerformanceTests",
  94. dependencies: [
  95. "GRPC",
  96. "NIO",
  97. "NIOSSL",
  98. "Commander",
  99. ]
  100. ),
  101. // Sample data, used in examples and tests.
  102. .target(
  103. name: "GRPCSampleData",
  104. dependencies: ["NIOSSL"]
  105. ),
  106. // Echo example.
  107. .target(
  108. name: "Echo",
  109. dependencies: [
  110. "GRPC",
  111. "GRPCSampleData",
  112. "SwiftProtobuf",
  113. "Commander"
  114. ],
  115. path: "Sources/Examples/Echo"
  116. ),
  117. ]
  118. )