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
|
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 swiftPath = supportedSwiftPaths.first { fileManager.fileExists(atPath: $0) }
|
||||||
let swiftC = swiftCPath ?? "swiftc"
|
let swift = swiftPath ?? "swift"
|
||||||
let args = [
|
let args = [
|
||||||
"--driver-mode=swift",
|
|
||||||
scriptPath,
|
scriptPath,
|
||||||
version,
|
version,
|
||||||
] + parameters.arguments
|
] + parameters.arguments
|
||||||
|
|
||||||
logger.logInfo("Running: \(swiftC) \(args.joined(separator: " "))")
|
logger.logInfo("Running: \(swift) \(args.joined(separator: " "))")
|
||||||
|
|
||||||
let process = Process()
|
let process = Process()
|
||||||
process.launchPath = swiftC
|
process.launchPath = swift
|
||||||
process.arguments = args
|
process.arguments = args
|
||||||
|
|
||||||
let standardOutput = FileHandle.standardOutput
|
let standardOutput = FileHandle.standardOutput
|
||||||
|
|
|
@ -15,9 +15,8 @@ final class SwiftScriptExecutorTests: XCTestCase {
|
||||||
|
|
||||||
executor.executeStep(version: "1.0.0", logger: Logger.testLogger)
|
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) == [
|
expect(processLauncher.receivedProcess?.arguments) == [
|
||||||
"--driver-mode=swift",
|
|
||||||
testPath,
|
testPath,
|
||||||
"1.0.0",
|
"1.0.0",
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue