Update minimum supported Swift version to Swift 5.7 (#1837)

This commit is contained in:
Cal Stephens
2025-05-05 20:03:31 -07:00
committed by Cal Stephens
parent 24334e162e
commit 3185ffbf62
4 changed files with 28 additions and 43 deletions
+2 -2
View File
@@ -46,8 +46,8 @@ jobs:
fail-fast: false
matrix:
swiftver:
- swift:5.3
- swift:5.10
- swift:5.7
- swift:6.0
swiftos:
- focal
runs-on: ubuntu-latest
+1 -1
View File
@@ -29,7 +29,7 @@
--self remove
--semicolons inline
--stripunusedargs always
--swiftversion 5.3
--swiftversion 5.3 # TODO: Update to 5.7 after releasing Swift Format 0.56.0
--trimwhitespace always
--wraparguments preserve
--wrapcollections preserve
+25 -4
View File
@@ -1,4 +1,4 @@
// swift-tools-version:4.2
// swift-tools-version:5.7
import PackageDescription
let package = Package(
@@ -6,10 +6,31 @@ let package = Package(
products: [
.executable(name: "swiftformat", targets: ["CommandLineTool"]),
.library(name: "SwiftFormat", targets: ["SwiftFormat"]),
.plugin(name: "SwiftFormatPlugin", targets: ["SwiftFormatPlugin"]),
],
targets: [
.target(name: "CommandLineTool", dependencies: ["SwiftFormat"], path: "CommandLineTool"),
.target(name: "SwiftFormat", path: "Sources"),
.testTarget(name: "SwiftFormatTests", dependencies: ["SwiftFormat"], path: "Tests"),
.executableTarget(
name: "CommandLineTool", dependencies: ["SwiftFormat"], path: "CommandLineTool",
exclude: ["swiftformat"]
),
.target(name: "SwiftFormat", path: "Sources", exclude: ["Info.plist"]),
.testTarget(
name: "SwiftFormatTests",
dependencies: ["SwiftFormat"],
path: "Tests",
exclude: ["GlobTest[5].txt"]
),
.plugin(
name: "SwiftFormatPlugin",
capability: .command(
intent: .custom(
verb: "swiftformat", description: "Formats Swift source files using SwiftFormat"
),
permissions: [
.writeToPackageDirectory(reason: "This command reformats source files"),
]
),
dependencies: [.target(name: "CommandLineTool")]
),
]
)
-36
View File
@@ -1,36 +0,0 @@
// swift-tools-version:5.6
import PackageDescription
let package = Package(
name: "SwiftFormat",
products: [
.executable(name: "swiftformat", targets: ["CommandLineTool"]),
.library(name: "SwiftFormat", targets: ["SwiftFormat"]),
.plugin(name: "SwiftFormatPlugin", targets: ["SwiftFormatPlugin"]),
],
targets: [
.executableTarget(
name: "CommandLineTool", dependencies: ["SwiftFormat"], path: "CommandLineTool",
exclude: ["swiftformat"]
),
.target(name: "SwiftFormat", path: "Sources", exclude: ["Info.plist"]),
.testTarget(
name: "SwiftFormatTests",
dependencies: ["SwiftFormat"],
path: "Tests",
exclude: ["GlobTest[5].txt"]
),
.plugin(
name: "SwiftFormatPlugin",
capability: .command(
intent: .custom(
verb: "swiftformat", description: "Formats Swift source files using SwiftFormat"
),
permissions: [
.writeToPackageDirectory(reason: "This command reformats source files"),
]
),
dependencies: [.target(name: "CommandLineTool")]
),
]
)