Package.swift 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. var packageDependencies: [Package.Dependency] = [
  20. // Official SwiftProtobuf library, for [de]serializing data to send on the wire.
  21. .package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.3.1")),
  22. // Command line argument parser for our auxiliary command line tools.
  23. .package(url: "https://github.com/kylef/Commander.git", .upToNextMinor(from: "0.8.0")),
  24. // SwiftGRPCNIO dependencies:
  25. // Main SwiftNIO package
  26. .package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),
  27. // HTTP2 via SwiftNIO
  28. .package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.2.0"),
  29. // TLS via SwiftNIO
  30. .package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.0.0"),
  31. ]
  32. let package = Package(
  33. name: "SwiftGRPC",
  34. products: [
  35. .library(name: "SwiftGRPCNIO", targets: ["SwiftGRPCNIO"]),
  36. ],
  37. dependencies: packageDependencies,
  38. targets: [
  39. .target(name: "SwiftGRPCNIO",
  40. dependencies: [
  41. "NIO",
  42. "NIOFoundationCompat",
  43. "NIOHTTP1",
  44. "NIOHTTP2",
  45. "NIOSSL",
  46. "SwiftProtobuf"]),
  47. .target(name: "protoc-gen-swiftgrpc",
  48. dependencies: [
  49. "SwiftProtobuf",
  50. "SwiftProtobufPluginLibrary",
  51. "protoc-gen-swift"]),
  52. .target(name: "EchoNIO",
  53. dependencies: [
  54. "SwiftGRPCNIO",
  55. "SwiftGRPCNIOSampleData",
  56. "SwiftProtobuf",
  57. "Commander"],
  58. path: "Sources/Examples/EchoNIO"),
  59. .target(name: "SwiftGRPCNIOInteroperabilityTests",
  60. dependencies: ["SwiftGRPCNIO"]),
  61. .target(name: "SwiftGRPCNIOInteroperabilityTestsCLI",
  62. dependencies: [
  63. "SwiftGRPCNIOInteroperabilityTests",
  64. "Commander"]),
  65. .target(name: "SwiftGRPCNIOSampleData",
  66. dependencies: ["NIOSSL"]),
  67. .testTarget(name: "SwiftGRPCNIOTests",
  68. dependencies: [
  69. "SwiftGRPCNIO",
  70. "SwiftGRPCNIOSampleData",
  71. "SwiftGRPCNIOInteroperabilityTests"]),
  72. .target(name: "SwiftGRPCNIOPerformanceTests",
  73. dependencies: [
  74. "SwiftGRPCNIO",
  75. "NIO",
  76. "NIOSSL",
  77. "Commander",
  78. ]),
  79. ])