A simpler extension point than Exec
for ad-hoc Gradle tasks that run shell commands.
- Specify entire
command
line in one string (instead ofList<CharSequence>
). - Append/prepend to the current
PATH
. - Execute a
command | pipe
orconditional && command || chain
. - Easy access to
stdout
andstderr
.
Exec
tasks yet (see #11), but the current API is very similar.
buildscript {
repositories.jcenter()
dependencies.classpath 'at.phatbl:shellexec:+'
}
import at.phatbl.shellexec.ShellExec
task lolCowFortune(type: ShellExec) {
command "fortune | cowsay | lolcat"
}
> Task :lolCowFortune
_________________________________________
/ Do not clog intellect's sluices with \
\ bits of knowledge of questionable uses. /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
This repo is licensed under the MIT License. See the LICENSE file for rights and limitations.