Package.swift 3.2 KB

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