A simpler extension point than Exec for ad-hoc Gradle tasks that run shell commands.
- Specify entire
commandline in one string (instead ofList<CharSequence>). - Append/prepend to the current
PATH. - Execute a
command | pipeorconditional && command || chain. - Easy access to
stdoutandstderr.
Exec tasks yet (see #11), but the current API is very similar.
import at.phatbl.shellexec.ShellExec
buildscript {
repositories.gradlePluginPortal()
dependencies.classpath("at.phatbl:shellexec:+")
}
val lolBoxFortune by registering(ShellExec::class) {
command = "fortune | boxes --design parchment --no-color | lolcat --force"
}Note that the
boxesandlolcattools need to be installed for the abovelolBoxFortuneto work.
> Task :lolBoxFortune
____________
/\ \
\_| Ship it. |
| |
| _______|_
\_/_________/
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.