Some fixes in tuistenv
This commit is contained in:
parent
8a6d94a144
commit
bc71a39c05
|
@ -19,15 +19,6 @@
|
|||
"version": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"package": "SwiftShell",
|
||||
"repositoryURL": "git@github.com:tuist/SwiftShell.git",
|
||||
"state": {
|
||||
"branch": null,
|
||||
"revision": "f9d6e23a382cf7ccf728d7e046b1b91157ffeb56",
|
||||
"version": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"package": "xcodeproj",
|
||||
"repositoryURL": "git@github.com:tuist/xcodeproj.git",
|
||||
|
|
|
@ -8,17 +8,22 @@ public protocol Systeming {
|
|||
func popen(_ args: [String], verbose: Bool) throws
|
||||
}
|
||||
|
||||
struct SystemError: FatalError {
|
||||
public struct SystemError: FatalError {
|
||||
let stderror: String?
|
||||
let exitcode: Int32
|
||||
|
||||
var type: ErrorType {
|
||||
public var type: ErrorType {
|
||||
return .abort
|
||||
}
|
||||
|
||||
var description: String {
|
||||
public var description: String {
|
||||
return stderror ?? "Error running command"
|
||||
}
|
||||
|
||||
public init(stderror: String? = nil, exitcode: Int32) {
|
||||
self.stderror = stderror
|
||||
self.exitcode = exitcode
|
||||
}
|
||||
}
|
||||
|
||||
public struct SystemResult {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Foundation
|
||||
@testable import TuistCore
|
||||
import TuistCore
|
||||
|
||||
public final class MockSystem: Systeming {
|
||||
private var stubs: [String: (stderror: String?, stdout: String?, exitstatus: Int32?)] = [:]
|
||||
|
|
|
@ -56,15 +56,11 @@ final class Installer: Installing {
|
|||
if printing { printer.print("Checking out \(version) reference") }
|
||||
try system.capture("git", "-C", temporaryDirectory.path.asString, "checkout", version, verbose: verbose).throwIfError()
|
||||
if printing { printer.print("Building using Swift (it might take a while)") }
|
||||
let os = ProcessInfo.processInfo.operatingSystemVersion
|
||||
let target = "x86_64-apple-macosx\(os.majorVersion).\(os.minorVersion)"
|
||||
let swiftPath = try system.capture("/usr/bin/xcrun", "-f", "swift", verbose: false).stdout.chuzzle()!
|
||||
try system.capture(swiftPath, "build",
|
||||
"--package-path", temporaryDirectory.path.asString,
|
||||
"--configuration", "release",
|
||||
"-Xswiftc", "-static-stdlib",
|
||||
"-Xswiftc", "-target",
|
||||
"-Xswiftc", target,
|
||||
verbose: verbose).throwIfError()
|
||||
|
||||
// Copying built files
|
||||
|
|
BIN
bin/tuistenv
BIN
bin/tuistenv
Binary file not shown.
Loading…
Reference in New Issue