Add example with custom task in one and separate files

This commit is contained in:
Juraj Michalek
2015-02-26 14:57:07 +01:00
parent 6233b16f67
commit f69e857849
5 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
apply plugin: 'groovy'
import com.ysoft.greeting.GreetingTask
task hello(type: GreetingTask)
// Customize the greeting
task greeting(type: GreetingTask) {
greeting = 'greetings from Brno'
}

View File

@@ -0,0 +1,13 @@
package com.ysoft.greeting
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
class GreetingTask extends DefaultTask {
String greeting = 'hello from Y Soft'
@TaskAction
def greet() {
println greeting
}
}