Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Repository files navigation

ShellExec

A simpler extension point than Exec for ad-hoc Gradle tasks that run shell commands.

Features

  • Specify entire command line in one string (instead of List<CharSequence>).
  • Append/prepend to the current PATH.
  • Execute a command | pipe or conditional && command || chain.
  • Easy access to stdout and stderr.

⚠️ Not compatible with Exec tasks yet (see #11), but the current API is very similar.

Example build.gradle.kts

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 boxes and lolcat tools need to be installed for the above lolBoxFortune to work.

Task Output

> Task :lolBoxFortune
 ____________
/\           \
\_| Ship it. |
  |          |
  |   _______|_
   \_/_________/


BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed

License

This repo is licensed under the MIT License. See the LICENSE file for rights and limitations.

About

🐚 Gradle plugin with a simpler Exec task

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.