Package.swift 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // swift-tools-version:4.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. var dependencies: [Package.Dependency] = [
  19. .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2"),
  20. .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0")
  21. ]
  22. /*
  23. * `swift-nio-zlib-support` uses `pkgConfig` to find `zlib` on
  24. * non-Apple platforms. Details here:
  25. * https://github.com/apple/swift-nio-zlib-support/issues/2#issuecomment-384681975
  26. *
  27. * This doesn't play well with Macports, so require it only for non-Apple
  28. * platforms, until there is a better solution.
  29. * Issue: https://github.com/grpc/grpc-swift/issues/220
  30. */
  31. #if !os(macOS)
  32. dependencies.append(.package(url: "https://github.com/apple/swift-nio-zlib-support.git", from: "1.0.0"))
  33. #endif
  34. let package = Package(
  35. name: "SwiftGRPC",
  36. products: [
  37. .library(name: "SwiftGRPC", targets: ["SwiftGRPC"]),
  38. ],
  39. dependencies: dependencies,
  40. targets: [
  41. .target(name: "SwiftGRPC",
  42. dependencies: ["CgRPC", "SwiftProtobuf"]),
  43. .target(name: "CgRPC",
  44. dependencies: ["BoringSSL"]),
  45. .target(name: "RootsEncoder"),
  46. .target(name: "protoc-gen-swiftgrpc",
  47. dependencies: [
  48. "SwiftProtobuf",
  49. "SwiftProtobufPluginLibrary",
  50. "protoc-gen-swift"]),
  51. .target(name: "BoringSSL"),
  52. .target(name: "Echo",
  53. dependencies: [
  54. "SwiftGRPC",
  55. "SwiftProtobuf",
  56. "Commander"],
  57. path: "Sources/Examples/Echo"),
  58. .target(name: "Simple",
  59. dependencies: ["SwiftGRPC", "Commander"],
  60. path: "Sources/Examples/Simple"),
  61. .testTarget(name: "SwiftGRPCTests", dependencies: ["SwiftGRPC"])
  62. ])