Created
May 8, 2016 03:29
-
-
Save andreiRS/8961c17d75bc97a9ddc2e3d12c7469b2 to your computer and use it in GitHub Desktop.
Execute system command from gradle
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
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