Skip to content

Instantly share code, notes, and snippets.

@DrewCarlson
Last active September 16, 2018 19:50
Show Gist options
  • Save DrewCarlson/1557d46dc7bba7b993eac41935a64247 to your computer and use it in GitHub Desktop.
Save DrewCarlson/1557d46dc7bba7b993eac41935a64247 to your computer and use it in GitHub Desktop.
Carthage mangment tasks
/** Carthage Tasks **/
task checkCarthageInstalled(type: Exec) {
executable = "carthage"
standardOutput = new ByteArrayOutputStream()
ignoreExitValue = true
doLast {
if (execResult.exitValue != 0) {
throw new GradleException("Please install Carthage with `brew install carthage`")
}
}
}
task runCarthageBootstrap(type: Exec) {
onlyIf { !project.file("${project.projectDir}/Cartfile.resolved").exists() }
commandLine "carthage", "bootstrap"
standardOutput = new ByteArrayOutputStream()
}
task runCarthageOutdated(type: Exec) {
onlyIf { project.file("${project.projectDir}/Cartfile.resolved").exists() }
commandLine "carthage", "outdated"
standardOutput = new ByteArrayOutputStream()
}
afterEvaluate {
tasks.findByName("checkKonanCompiler")
.dependsOn(checkCarthageInstalled, runCarthageBootstrap, runCarthageOutdated)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment