Created
November 19, 2012 02:10
-
-
Save xconnecting/4108586 to your computer and use it in GitHub Desktop.
Gradle: Add group and description to task defined in custom plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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