Skip to content

Commit

Permalink
Merge pull request #6 from giginet/add-swift6-stack
Browse files Browse the repository at this point in the history
Add Swift 6 build environment for GitHub Action
  • Loading branch information
giginet authored Jul 6, 2024
2 parents b37aa9c + d690197 commit bede921
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
Tests:
strategy:
matrix:
xcode_version: ["15.3"]
xcode_version: ["15.4", "16.0"]
env:
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer"
runs-on: macos-14
Expand Down
18 changes: 14 additions & 4 deletions Plugins/RevolutionaryPlugin/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct SwiftTestingRevolutionaryPlugin: CommandPlugin {
let revolutionaryExecutable = try context.tool(named: "swift-testing-revolutionary")

let argumentsToExecute = arguments
try performTool(executablePath: revolutionaryExecutable.path.url, arguments: argumentsToExecute)
try performTool(executablePath: revolutionaryExecutable.url, arguments: argumentsToExecute)
}
}

Expand All @@ -29,12 +29,12 @@ extension SwiftTestingRevolutionaryPlugin: XcodeCommandPlugin {
}

let allTestFiles = target.inputFiles
.filter { $0.path.lastComponent.hasSuffix("Tests.swift") }
.filter { $0.url.lastPathComponent.hasSuffix("Tests.swift") }
return files + allTestFiles
}

let argumentsToExecute = extractor.remainingArguments + allTestFiles.map { $0.path.string }
try performTool(executablePath: revolutionaryExecutable.path.url, arguments: argumentsToExecute)
let argumentsToExecute = extractor.remainingArguments + allTestFiles.map { $0.url.path() }
try performTool(executablePath: revolutionaryExecutable.url, arguments: argumentsToExecute)
}
}

Expand All @@ -55,8 +55,18 @@ private func performTool(executablePath: URL, arguments: [String]) throws {
}
}

#if compiler(<6.0)

extension Path {
fileprivate var url: URL {
URL(filePath: string)
}
}

extension PluginContext.Tool {
fileprivate var url: URL {
path.url
}
}

#endif

0 comments on commit bede921

Please sign in to comment.