Package.swift 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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", 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. // GRPC dependencies:
  25. // Main SwiftNIO package
  26. .package(url: "https://github.com/apple/swift-nio.git", from: "2.2.0"),
  27. // HTTP2 via SwiftNIO
  28. .package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.2.1"),
  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: "GRPC",
  34. products: [
  35. .library(name: "GRPC", targets: ["GRPC"]),
  36. .executable(name: "InteroperabilityTestRunner", targets: ["GRPCInteroperabilityTestsCLI"]),
  37. .executable(name: "PerformanceTestRunner", targets: ["GRPCPerformanceTests"]),
  38. .executable(name: "Echo", targets: ["Echo"]),
  39. ],
  40. dependencies: packageDependencies,
  41. targets: [
  42. .target(name: "GRPC",
  43. dependencies: [
  44. "NIO",
  45. "NIOFoundationCompat",
  46. "NIOHTTP1",
  47. "NIOHTTP2",
  48. "NIOSSL",
  49. "SwiftProtobuf"]),
  50. .target(name: "protoc-gen-swiftgrpc",
  51. dependencies: [
  52. "SwiftProtobuf",
  53. "SwiftProtobufPluginLibrary",
  54. "protoc-gen-swift"]),
  55. .target(name: "Echo",
  56. dependencies: [
  57. "GRPC",
  58. "GRPCSampleData",
  59. "SwiftProtobuf",
  60. "Commander"],
  61. path: "Sources/Examples/Echo"),
  62. .target(name: "GRPCInteroperabilityTests",
  63. dependencies: ["GRPC"]),
  64. .target(name: "GRPCInteroperabilityTestsCLI",
  65. dependencies: [
  66. "GRPCInteroperabilityTests",
  67. "Commander"]),
  68. .target(name: "GRPCSampleData",
  69. dependencies: ["NIOSSL"]),
  70. .testTarget(name: "GRPCTests",
  71. dependencies: [
  72. "GRPC",
  73. "GRPCSampleData",
  74. "GRPCInteroperabilityTests"]),
  75. .target(name: "GRPCPerformanceTests",
  76. dependencies: [
  77. "GRPC",
  78. "NIO",
  79. "NIOSSL",
  80. "Commander",
  81. ]),
  82. ])