|
| 1 | +// swift-tools-version:6.0 |
| 2 | + |
| 3 | +import PackageDescription |
| 4 | +import CompilerPluginSupport |
| 5 | + |
| 6 | +let package = Package( |
| 7 | + name: "swift-interception", |
| 8 | + platforms: [ |
| 9 | + .iOS(.v13), |
| 10 | + .macOS(.v10_15), |
| 11 | + .tvOS(.v13), |
| 12 | + .macCatalyst(.v13), |
| 13 | + .watchOS(.v6), |
| 14 | + ], |
| 15 | + products: [ |
| 16 | + .library( |
| 17 | + name: "_InterceptionCustomSelectors", |
| 18 | + type: .static, |
| 19 | + targets: ["_InterceptionCustomSelectors"] |
| 20 | + ), |
| 21 | + .library( |
| 22 | + name: "_InterceptionMacros", |
| 23 | + type: .static, |
| 24 | + targets: ["_InterceptionMacros"] |
| 25 | + ), |
| 26 | + .library( |
| 27 | + name: "_InterceptionUtils", |
| 28 | + type: .static, |
| 29 | + targets: ["_InterceptionUtils"] |
| 30 | + ), |
| 31 | + .library( |
| 32 | + name: "Interception", |
| 33 | + type: .static, |
| 34 | + targets: ["Interception"] |
| 35 | + ), |
| 36 | + .library( |
| 37 | + name: "InterceptionMacros", |
| 38 | + type: .static, |
| 39 | + targets: ["InterceptionMacros"] |
| 40 | + ), |
| 41 | + ], |
| 42 | + dependencies: [ |
| 43 | + .package( |
| 44 | + url: "https://github.com/stackotter/swift-macro-toolkit.git", |
| 45 | + .upToNextMinor(from: "0.5.0") |
| 46 | + ), |
| 47 | + .package( |
| 48 | + url: "https://github.com/pointfreeco/swift-macro-testing.git", |
| 49 | + .upToNextMinor(from: "0.5.2") |
| 50 | + ) |
| 51 | + ], |
| 52 | + targets: [ |
| 53 | + .target( |
| 54 | + name: "_InterceptionMacros", |
| 55 | + dependencies: [ |
| 56 | + .target(name: "InterceptionMacrosPlugin"), |
| 57 | + .target(name: "_InterceptionCustomSelectors") |
| 58 | + ] |
| 59 | + ), |
| 60 | + .target(name: "_InterceptionCustomSelectors"), |
| 61 | + .target(name: "_InterceptionUtilsObjc"), |
| 62 | + .target( |
| 63 | + name: "_InterceptionUtils", |
| 64 | + dependencies: [ |
| 65 | + .target(name: "_InterceptionUtilsObjc"), |
| 66 | + ] |
| 67 | + ), |
| 68 | + .target( |
| 69 | + name: "Interception", |
| 70 | + dependencies: [ |
| 71 | + .target(name: "_InterceptionCustomSelectors"), |
| 72 | + .target(name: "_InterceptionUtils"), |
| 73 | + ] |
| 74 | + ), |
| 75 | + .target( |
| 76 | + name: "InterceptionMacros", |
| 77 | + dependencies: [ |
| 78 | + .target(name: "_InterceptionMacros"), |
| 79 | + .target(name: "Interception") |
| 80 | + ] |
| 81 | + ), |
| 82 | + .macro( |
| 83 | + name: "InterceptionMacrosPlugin", |
| 84 | + dependencies: [ |
| 85 | + .product( |
| 86 | + name: "MacroToolkit", |
| 87 | + package: "swift-macro-toolkit" |
| 88 | + ) |
| 89 | + ] |
| 90 | + ), |
| 91 | + .testTarget( |
| 92 | + name: "InterceptionMacrosPluginTests", |
| 93 | + dependencies: [ |
| 94 | + .target(name: "InterceptionMacrosPlugin"), |
| 95 | + .product(name: "MacroTesting", package: "swift-macro-testing"), |
| 96 | + ] |
| 97 | + ), |
| 98 | + .testTarget( |
| 99 | + name: "InterceptionTests", |
| 100 | + dependencies: [ |
| 101 | + .target(name: "Interception"), |
| 102 | + ] |
| 103 | + ), |
| 104 | + .testTarget( |
| 105 | + name: "InterceptionMacrosTests", |
| 106 | + dependencies: [ |
| 107 | + .target(name: "InterceptionMacros"), |
| 108 | + ] |
| 109 | + ), |
| 110 | + ], |
| 111 | + swiftLanguageModes: [.v6] |
| 112 | +) |
| 113 | + |
| 114 | +for target in package.targets where target.type == .system || target.type == .test { |
| 115 | + target.swiftSettings?.append(contentsOf: [ |
| 116 | + .swiftLanguageMode(.v5), |
| 117 | + .enableExperimentalFeature("StrictConcurrency"), |
| 118 | + .enableUpcomingFeature("InferSendableFromCaptures"), |
| 119 | + ]) |
| 120 | +} |
0 commit comments