Merge pull request #45 from shibapm/use_swift_instead_of_swiftc_for_compilation
Use swift instead of swiftc for compilation
This commit is contained in:
commit
a101e9db31
|
@ -11,20 +11,19 @@ final class SwiftScriptExecutor: DefaultExecutor<SwiftScriptParameters> {
|
|||
return
|
||||
}
|
||||
|
||||
let supportedSwiftCPaths = ["/usr/bin/swiftc", "/home/travis/.swiftenv/shims/swiftc"]
|
||||
let supportedSwiftPaths = ["/usr/bin/swift", "/home/travis/.swiftenv/shims/swift"]
|
||||
|
||||
let swiftCPath = supportedSwiftCPaths.first { fileManager.fileExists(atPath: $0) }
|
||||
let swiftC = swiftCPath ?? "swiftc"
|
||||
let swiftPath = supportedSwiftPaths.first { fileManager.fileExists(atPath: $0) }
|
||||
let swift = swiftPath ?? "swift"
|
||||
let args = [
|
||||
"--driver-mode=swift",
|
||||
scriptPath,
|
||||
version,
|
||||
] + parameters.arguments
|
||||
|
||||
logger.logInfo("Running: \(swiftC) \(args.joined(separator: " "))")
|
||||
logger.logInfo("Running: \(swift) \(args.joined(separator: " "))")
|
||||
|
||||
let process = Process()
|
||||
process.launchPath = swiftC
|
||||
process.launchPath = swift
|
||||
process.arguments = args
|
||||
|
||||
let standardOutput = FileHandle.standardOutput
|
||||
|
|
|
@ -15,9 +15,8 @@ final class SwiftScriptExecutorTests: XCTestCase {
|
|||
|
||||
executor.executeStep(version: "1.0.0", logger: Logger.testLogger)
|
||||
|
||||
expect(processLauncher.receivedProcess?.launchPath) == "/usr/bin/swiftc"
|
||||
expect(processLauncher.receivedProcess?.launchPath) == "/usr/bin/swift"
|
||||
expect(processLauncher.receivedProcess?.arguments) == [
|
||||
"--driver-mode=swift",
|
||||
testPath,
|
||||
"1.0.0",
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue