Skip to content

Instantly share code, notes, and snippets.

@andreiRS
Created May 8, 2016 03:29
Show Gist options
  • Save andreiRS/8961c17d75bc97a9ddc2e3d12c7469b2 to your computer and use it in GitHub Desktop.
Save andreiRS/8961c17d75bc97a9ddc2e3d12c7469b2 to your computer and use it in GitHub Desktop.
Execute system command from gradle
task hello(type: Exec) {
executable "sh"
args "-c", "echo 'hello from your shell'"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
doLast {
print standardOutput.toString()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment