|
| 1 | +// swift-tools-version: 6.0 |
| 2 | + |
| 3 | +import CompilerPluginSupport |
| 4 | +import PackageDescription |
| 5 | + |
| 6 | +let package = Package( |
| 7 | + name: "swiftui-color-hex-macro", |
| 8 | + platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .macCatalyst(.v13)], |
| 9 | + products: [ |
| 10 | + .library( |
| 11 | + name: "ColorHexMacro", |
| 12 | + targets: ["ColorHexMacro"] |
| 13 | + ) |
| 14 | + ], |
| 15 | + targets: [ |
| 16 | + .macro( |
| 17 | + name: "ColorHexMacroPlugin", |
| 18 | + dependencies: [ |
| 19 | + .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), |
| 20 | + .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), |
| 21 | + .product(name: "SwiftSyntaxBuilder", package: "swift-syntax"), |
| 22 | + ] |
| 23 | + ), |
| 24 | + |
| 25 | + .target(name: "ColorHexMacro", dependencies: ["ColorHexMacroPlugin"]), |
| 26 | + |
| 27 | + .testTarget( |
| 28 | + name: "ColorHexMacroTests", |
| 29 | + dependencies: [ |
| 30 | + "ColorHexMacro", |
| 31 | + "ColorHexMacroPlugin", |
| 32 | + .product(name: "MacroTesting", package: "swift-macro-testing"), |
| 33 | + .product(name: "SwiftCompilerPlugin", package: "swift-syntax"), |
| 34 | + ] |
| 35 | + ), |
| 36 | + ] |
| 37 | +) |
| 38 | + |
| 39 | +package.dependencies += [ |
| 40 | + .package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.6.0"), |
| 41 | + .package(url: "https://github.com/swiftlang/swift-syntax", "600.0.0"..<"603.0.0"), |
| 42 | +] |
| 43 | + |
| 44 | +for target in package.targets { |
| 45 | + target.swiftSettings = target.swiftSettings ?? [] |
| 46 | + target.swiftSettings? += [ |
| 47 | + .enableUpcomingFeature("ExistentialAny"), |
| 48 | + .enableUpcomingFeature("InternalImportsByDefault"), |
| 49 | + ] |
| 50 | +} |
0 commit comments