Created
November 7, 2012 00:27
-
-
Save xconnecting/4028688 to your computer and use it in GitHub Desktop.
Sample: Gradle custom plugin in build.gradle
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) { | |
target.task('greet', type: GreetingTask) | |
} | |
} | |
class GreetingTask extends DefaultTask { | |
def greeting = 'Hello' | |
@TaskAction | |
def greet() { | |
println greeting | |
} | |
} | |
apply plugin: Greeting | |
task hi(type:GreetingTask){ | |
greeting = 'Hi' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment