mirror of
https://github.com/ysoftdevs/gradle-training.git
synced 2026-03-30 22:02:36 +02:00
12 custom plugin
This commit is contained in:
2
12-custom-plugin/build.gradle
Normal file
2
12-custom-plugin/build.gradle
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
apply from: "helloPlugin.gradle"
|
||||||
|
|
||||||
8
12-custom-plugin/helloPlugin.gradle
Normal file
8
12-custom-plugin/helloPlugin.gradle
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
task helloFromPlugin() {
|
||||||
|
description "Say Hello! Code implemented in plugin."
|
||||||
|
doLast {
|
||||||
|
println "Hello from plugin!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -109,6 +109,7 @@ building decorators.
|
|||||||
gradle tasks
|
gradle tasks
|
||||||
gradle helloWorld
|
gradle helloWorld
|
||||||
|
|
||||||
|
|
||||||
## 11-task-class
|
## 11-task-class
|
||||||
|
|
||||||
Gradle allows to define custom task class. This class should contain
|
Gradle allows to define custom task class. This class should contain
|
||||||
@@ -120,3 +121,11 @@ Each property defined on class level is configurable from gradle task
|
|||||||
gradle today
|
gradle today
|
||||||
gradle verboseToday
|
gradle verboseToday
|
||||||
|
|
||||||
|
|
||||||
|
## 12-custom-plugin
|
||||||
|
|
||||||
|
It's possible to specify tasks outside build.gradle and then "include" file.
|
||||||
|
Gradle uses notion of plugins. Check helloPlugin.gradle file.
|
||||||
|
|
||||||
|
gradle tasks
|
||||||
|
gradle helloFromPlugin
|
||||||
|
|||||||
Reference in New Issue
Block a user