Skip to content

Instantly share code, notes, and snippets.

@xconnecting
Created November 19, 2012 02:10
Show Gist options
  • Save xconnecting/4108586 to your computer and use it in GitHub Desktop.
Save xconnecting/4108586 to your computer and use it in GitHub Desktop.
Gradle: Add group and description to task defined in custom plugin
class Greeting implements Plugin<Project> {
void apply(Project target) {
def helloTask = target.task('hello', type: HelloTask)
helloTask .group = 'greeting'
helloTask .description = 'Say hello.'
target.task('hi', type: HiTask){
group = 'greeting'
description = 'Say hi.'
}
}
}
class HelloTask extends DefaultTask {
@TaskAction
def greet() {
println 'hello'
}
}
class HiTask extends DefaultTask {
@TaskAction
def greet() {
println 'hi'
}
}
apply plugin: Greeting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment