|
| 1 | +// swift-tools-version:5.10 |
| 2 | + |
| 3 | +// Package.swift |
| 4 | +// |
| 5 | +// Copyright (c) 2014 - 2018 Apple Inc. and the project authors |
| 6 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 7 | +// |
| 8 | +// See LICENSE.txt for license information: |
| 9 | +// https://github.com/apple/swift-protobuf/blob/main/LICENSE.txt |
| 10 | +// |
| 11 | + |
| 12 | +import PackageDescription |
| 13 | + |
| 14 | +let package = Package( |
| 15 | + name: "SwiftProtobuf", |
| 16 | + products: [ |
| 17 | + .executable( |
| 18 | + name: "protoc-gen-swift", |
| 19 | + targets: ["protoc-gen-swift"] |
| 20 | + ), |
| 21 | + .library( |
| 22 | + name: "SwiftProtobuf", |
| 23 | + targets: ["SwiftProtobuf"] |
| 24 | + ), |
| 25 | + .library( |
| 26 | + name: "SwiftProtobufPluginLibrary", |
| 27 | + targets: ["SwiftProtobufPluginLibrary"] |
| 28 | + ), |
| 29 | + .plugin( |
| 30 | + name: "SwiftProtobufPlugin", |
| 31 | + targets: ["SwiftProtobufPlugin"] |
| 32 | + ), |
| 33 | + ], |
| 34 | + targets: [ |
| 35 | + .target( |
| 36 | + name: "SwiftProtobuf", |
| 37 | + exclude: ["CMakeLists.txt"], |
| 38 | + resources: [.copy("PrivacyInfo.xcprivacy")], |
| 39 | + swiftSettings: .packageSettings |
| 40 | + ), |
| 41 | + .target( |
| 42 | + name: "SwiftProtobufPluginLibrary", |
| 43 | + dependencies: ["SwiftProtobuf"], |
| 44 | + exclude: ["CMakeLists.txt"], |
| 45 | + resources: [.copy("PrivacyInfo.xcprivacy")], |
| 46 | + swiftSettings: .packageSettings |
| 47 | + ), |
| 48 | + .target( |
| 49 | + name: "SwiftProtobufTestHelpers", |
| 50 | + dependencies: ["SwiftProtobuf"], |
| 51 | + swiftSettings: .packageSettings |
| 52 | + ), |
| 53 | + .executableTarget( |
| 54 | + name: "protoc-gen-swift", |
| 55 | + dependencies: ["SwiftProtobufPluginLibrary", "SwiftProtobuf"], |
| 56 | + exclude: ["CMakeLists.txt"], |
| 57 | + swiftSettings: .packageSettings |
| 58 | + ), |
| 59 | + .executableTarget( |
| 60 | + name: "Conformance", |
| 61 | + dependencies: ["SwiftProtobuf"], |
| 62 | + exclude: ["failure_list_swift.txt", "text_format_failure_list_swift.txt"], |
| 63 | + swiftSettings: .packageSettings |
| 64 | + ), |
| 65 | + .plugin( |
| 66 | + name: "SwiftProtobufPlugin", |
| 67 | + capability: .buildTool(), |
| 68 | + dependencies: ["protoc-gen-swift"] |
| 69 | + ), |
| 70 | + .testTarget( |
| 71 | + name: "SwiftProtobufTests", |
| 72 | + dependencies: ["SwiftProtobuf"], |
| 73 | + swiftSettings: .packageSettings |
| 74 | + ), |
| 75 | + .testTarget( |
| 76 | + name: "SwiftProtobufPluginLibraryTests", |
| 77 | + dependencies: ["SwiftProtobufPluginLibrary", "SwiftProtobufTestHelpers"], |
| 78 | + swiftSettings: .packageSettings |
| 79 | + ), |
| 80 | + .testTarget( |
| 81 | + name: "protoc-gen-swiftTests", |
| 82 | + dependencies: ["protoc-gen-swift", "SwiftProtobufTestHelpers"], |
| 83 | + swiftSettings: .packageSettings |
| 84 | + ), |
| 85 | + ], |
| 86 | + swiftLanguageVersions: [.v5] |
| 87 | +) |
| 88 | + |
| 89 | +// Settings for every Swift target in this package, like project-level settings |
| 90 | +// in an Xcode project. |
| 91 | +extension Array where Element == PackageDescription.SwiftSetting { |
| 92 | + static var packageSettings: Self { |
| 93 | + [ |
| 94 | + .enableExperimentalFeature("StrictConcurrency=complete"), |
| 95 | + .enableUpcomingFeature("ExistentialAny"), |
| 96 | + ] |
| 97 | + } |
| 98 | +} |
0 commit comments