Last active
August 30, 2020 11:04
-
-
Save laevandus/023efd4556ab11d2843bf6b25eea87b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/swift | |
import Foundation | |
let projectType = "-workspace" | |
let projectPath = "SignalPath.xcworkspace" | |
let scheme = "SignalPathiOS" | |
let destinationDevice = "platform=iOS Simulator,name=iPhone 11 Pro Max" | |
let resultBundlePath = "PrePush.xcresult" | |
removeResultBundle(at: resultBundlePath) | |
print("Building for testing…") | |
let buildCommand = [ | |
"xcodebuild", | |
"build-for-testing", | |
"-quiet", | |
projectType, projectPath.wrappedInQuotes, | |
"-scheme", scheme.wrappedInQuotes, | |
"-destination", destinationDevice.wrappedInQuotes | |
].joined(separator: " ") | |
let buildStatus = Process.runZshCommand(buildCommand) | |
if buildStatus != 0 { | |
exit(buildStatus) | |
} | |
extension String { | |
var wrappedInQuotes: String { | |
return "\"\(self)\"" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment