|
1 | | -// swift-tools-version: 6.1 |
| 1 | +// swift-tools-version: 6.0 |
2 | 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. |
3 | 3 |
|
4 | 4 | import PackageDescription |
5 | 5 |
|
| 6 | +// MARK: - Swift Settings Configuration |
| 7 | + |
| 8 | +let swiftSettings: [SwiftSetting] = [ |
| 9 | + // Swift 6.2 Upcoming Features (not yet enabled by default) |
| 10 | + // SE-0335: Introduce existential `any` |
| 11 | + .enableUpcomingFeature("ExistentialAny"), |
| 12 | + // SE-0409: Access-level modifiers on import declarations |
| 13 | + .enableUpcomingFeature("InternalImportsByDefault"), |
| 14 | + // SE-0444: Member import visibility (Swift 6.1+) |
| 15 | + .enableUpcomingFeature("MemberImportVisibility"), |
| 16 | + // SE-0413: Typed throws |
| 17 | + .enableUpcomingFeature("FullTypedThrows"), |
| 18 | + |
| 19 | + // Experimental Features (stable enough for use) |
| 20 | + // SE-0426: BitwiseCopyable protocol |
| 21 | + .enableExperimentalFeature("BitwiseCopyable"), |
| 22 | + // SE-0432: Borrowing and consuming pattern matching for noncopyable types |
| 23 | + .enableExperimentalFeature("BorrowingSwitch"), |
| 24 | + // Extension macros |
| 25 | + .enableExperimentalFeature("ExtensionMacros"), |
| 26 | + // Freestanding expression macros |
| 27 | + .enableExperimentalFeature("FreestandingExpressionMacros"), |
| 28 | + // Init accessors |
| 29 | + .enableExperimentalFeature("InitAccessors"), |
| 30 | + // Isolated any types |
| 31 | + .enableExperimentalFeature("IsolatedAny"), |
| 32 | + // Move-only classes |
| 33 | + .enableExperimentalFeature("MoveOnlyClasses"), |
| 34 | + // Move-only enum deinits |
| 35 | + .enableExperimentalFeature("MoveOnlyEnumDeinits"), |
| 36 | + // SE-0429: Partial consumption of noncopyable values |
| 37 | + .enableExperimentalFeature("MoveOnlyPartialConsumption"), |
| 38 | + // Move-only resilient types |
| 39 | + .enableExperimentalFeature("MoveOnlyResilientTypes"), |
| 40 | + // Move-only tuples |
| 41 | + .enableExperimentalFeature("MoveOnlyTuples"), |
| 42 | + // SE-0427: Noncopyable generics |
| 43 | + .enableExperimentalFeature("NoncopyableGenerics"), |
| 44 | + // One-way closure parameters |
| 45 | + // .enableExperimentalFeature("OneWayClosureParameters"), |
| 46 | + // Raw layout types |
| 47 | + .enableExperimentalFeature("RawLayout"), |
| 48 | + // Reference bindings |
| 49 | + .enableExperimentalFeature("ReferenceBindings"), |
| 50 | + // SE-0430: sending parameter and result values |
| 51 | + .enableExperimentalFeature("SendingArgsAndResults"), |
| 52 | + // Symbol linkage markers |
| 53 | + .enableExperimentalFeature("SymbolLinkageMarkers"), |
| 54 | + // Transferring args and results |
| 55 | + .enableExperimentalFeature("TransferringArgsAndResults"), |
| 56 | + // SE-0393: Value and Type Parameter Packs |
| 57 | + .enableExperimentalFeature("VariadicGenerics"), |
| 58 | + // Warn unsafe reflection |
| 59 | + .enableExperimentalFeature("WarnUnsafeReflection"), |
| 60 | + |
| 61 | + // Enhanced compiler checking |
| 62 | + .unsafeFlags([ |
| 63 | + // Enable concurrency warnings |
| 64 | + "-warn-concurrency", |
| 65 | + // Enable actor data race checks |
| 66 | + "-enable-actor-data-race-checks", |
| 67 | + // Complete strict concurrency checking |
| 68 | + "-strict-concurrency=complete", |
| 69 | + // Enable testing support |
| 70 | + "-enable-testing", |
| 71 | + // Warn about functions with >100 lines |
| 72 | + "-Xfrontend", "-warn-long-function-bodies=100", |
| 73 | + // Warn about slow type checking expressions |
| 74 | + "-Xfrontend", "-warn-long-expression-type-checking=100" |
| 75 | + ]) |
| 76 | +] |
| 77 | + |
6 | 78 | // swiftlint:disable:next explicit_top_level_acl explicit_acl |
7 | 79 | let package = Package( |
8 | 80 | name: "SyntaxKit", |
@@ -34,15 +106,18 @@ let package = Package( |
34 | 106 | .product(name: "SwiftSyntax", package: "swift-syntax"), |
35 | 107 | .product(name: "SwiftOperators", package: "swift-syntax"), |
36 | 108 | .product(name: "SwiftParser", package: "swift-syntax") |
37 | | - ] |
| 109 | + ], |
| 110 | + swiftSettings: swiftSettings |
38 | 111 | ), |
39 | 112 | .executableTarget( |
40 | 113 | name: "skit", |
41 | | - dependencies: ["SyntaxKit"] |
| 114 | + dependencies: ["SyntaxKit"], |
| 115 | + swiftSettings: swiftSettings |
42 | 116 | ), |
43 | 117 | .testTarget( |
44 | 118 | name: "SyntaxKitTests", |
45 | | - dependencies: ["SyntaxKit"] |
| 119 | + dependencies: ["SyntaxKit"], |
| 120 | + swiftSettings: swiftSettings |
46 | 121 | ), |
47 | 122 | ] |
48 | 123 | ) |
0 commit comments