Package.swift 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. // Command line argument parser for our auxiliary command line tools.
  41. .package(url: "https://github.com/kylef/Commander.git", from: "0.8.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. ]
  56. ), // and its tests.
  57. .testTarget(
  58. name: "GRPCTests",
  59. dependencies: [
  60. "GRPC",
  61. "GRPCSampleData",
  62. "GRPCInteroperabilityTests"
  63. ]
  64. ),
  65. // The `protoc` plugin.
  66. .target(
  67. name: "protoc-gen-swiftgrpc",
  68. dependencies: [
  69. "SwiftProtobuf",
  70. "SwiftProtobufPluginLibrary",
  71. "protoc-gen-swift"
  72. ]
  73. ),
  74. // Interoperability tests, this target doesn't contain the CLI as the
  75. // interoperability tests are reused in the main test suite.
  76. .target(
  77. name: "GRPCInteroperabilityTests",
  78. dependencies: ["GRPC"]
  79. ),
  80. // The CLI for the interoperability tests.
  81. .target(
  82. name: "GRPCInteroperabilityTestsCLI",
  83. dependencies: [
  84. "GRPCInteroperabilityTests",
  85. "Commander"
  86. ]
  87. ),
  88. // Performance tests and CLI.
  89. .target(
  90. name: "GRPCPerformanceTests",
  91. dependencies: [
  92. "GRPC",
  93. "NIO",
  94. "NIOSSL",
  95. "Commander",
  96. ]
  97. ),
  98. // Sample data, used in examples and tests.
  99. .target(
  100. name: "GRPCSampleData",
  101. dependencies: ["NIOSSL"]
  102. ),
  103. // Echo example.
  104. .target(
  105. name: "Echo",
  106. dependencies: [
  107. "GRPC",
  108. "GRPCSampleData",
  109. "SwiftProtobuf",
  110. "Commander"
  111. ],
  112. path: "Sources/Examples/Echo"
  113. ),
  114. ]
  115. )