diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b51d64eef..511fb518b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.swiftformat b/.swiftformat index 96ab4d037..947222892 100644 --- a/.swiftformat +++ b/.swiftformat @@ -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 diff --git a/Package.swift b/Package.swift index e3c2a3bdd..8fb32ce3e 100644 --- a/Package.swift +++ b/Package.swift @@ -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")] + ), ] ) diff --git a/Package@swift-5.6.swift b/Package@swift-5.6.swift deleted file mode 100644 index 1d8b30fc2..000000000 --- a/Package@swift-5.6.swift +++ /dev/null @@ -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")] - ), - ] -)