Last active
September 16, 2018 19:50
-
-
Save DrewCarlson/1557d46dc7bba7b993eac41935a64247 to your computer and use it in GitHub Desktop.
Carthage mangment tasks
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
/** 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