Skip to content

Instantly share code, notes, and snippets.

@martinbonnin
Created December 25, 2019 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinbonnin/ba088f3012229b34b5cf01e08597dfba to your computer and use it in GitHub Desktop.
Save martinbonnin/ba088f3012229b34b5cf01e08597dfba to your computer and use it in GitHub Desktop.
apply from: "dependencies.gradle"
// A task that displays a greeting
class Greeting extends DefaultTask {
// A configurable greeting
@Input
String input
// Read-only property calculated from the greeting
@OutputFile
File output
@TaskAction
void printMessage() {
output.write(project.hello + input)
}
}
// Create the greeting task
task greeting(type: Greeting) {
input = "input"
output = new File("output.txt")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment