Package.swift 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // swift-tools-version: 6.0
  2. /*
  3. * Copyright 2024, 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. let products: [Product] = [
  19. .library(
  20. name: "GRPCProtobuf",
  21. targets: ["GRPCProtobuf"]
  22. ),
  23. .executable(
  24. name: "protoc-gen-grpc-swift",
  25. targets: ["protoc-gen-grpc-swift"]
  26. ),
  27. ]
  28. let dependencies: [Package.Dependency] = [
  29. .package(
  30. path: "/Users/georgebarnett/workspace/scratch/grpc-swift-project/grpc-swift"
  31. ),
  32. .package(
  33. url: "https://github.com/apple/swift-protobuf.git",
  34. from: "1.28.1"
  35. ),
  36. ]
  37. let defaultSwiftSettings: [SwiftSetting] = [
  38. .swiftLanguageMode(.v6),
  39. .enableUpcomingFeature("ExistentialAny"),
  40. .enableUpcomingFeature("InternalImportsByDefault")
  41. ]
  42. let targets: [Target] = [
  43. // protoc plugin for grpc-swift
  44. .executableTarget(
  45. name: "protoc-gen-grpc-swift",
  46. dependencies: [
  47. .target(name: "GRPCProtobufCodeGen"),
  48. .product(name: "GRPCCodeGen", package: "grpc-swift"),
  49. .product(name: "SwiftProtobuf", package: "swift-protobuf"),
  50. .product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"),
  51. ]
  52. ),
  53. // Runtime serialization components
  54. .target(
  55. name: "GRPCProtobuf",
  56. dependencies: [
  57. .product(name: "GRPCCore", package: "grpc-swift"),
  58. .product(name: "SwiftProtobuf", package: "swift-protobuf"),
  59. ],
  60. swiftSettings: defaultSwiftSettings
  61. ),
  62. .testTarget(
  63. name: "GRPCProtobufTests",
  64. dependencies: [
  65. .target(name: "GRPCProtobuf"),
  66. .product(name: "GRPCCore", package: "grpc-swift"),
  67. .product(name: "SwiftProtobuf", package: "swift-protobuf"),
  68. ]
  69. ),
  70. // Code generator library for protoc-gen-grpc-swift
  71. .target(
  72. name: "GRPCProtobufCodeGen",
  73. dependencies: [
  74. .product(name: "GRPCCodeGen", package: "grpc-swift"),
  75. .product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"),
  76. ],
  77. swiftSettings: defaultSwiftSettings
  78. ),
  79. .testTarget(
  80. name: "GRPCProtobufCodeGenTests",
  81. dependencies: [
  82. .target(name: "GRPCProtobufCodeGen"),
  83. .product(name: "GRPCCodeGen", package: "grpc-swift"),
  84. .product(name: "SwiftProtobuf", package: "swift-protobuf"),
  85. .product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"),
  86. ]
  87. )
  88. ]
  89. let package = Package(
  90. name: "grpc-swift-protobuf",
  91. products: products,
  92. dependencies: dependencies,
  93. targets: targets
  94. )