diff --git a/12-custom-plugin/build.gradle b/12-custom-plugin/build.gradle new file mode 100644 index 0000000..5b64091 --- /dev/null +++ b/12-custom-plugin/build.gradle @@ -0,0 +1,2 @@ +apply from: "helloPlugin.gradle" + diff --git a/12-custom-plugin/helloPlugin.gradle b/12-custom-plugin/helloPlugin.gradle new file mode 100644 index 0000000..2719e8c --- /dev/null +++ b/12-custom-plugin/helloPlugin.gradle @@ -0,0 +1,8 @@ + +task helloFromPlugin() { + description "Say Hello! Code implemented in plugin." + doLast { + println "Hello from plugin!" + } +} + diff --git a/README.md b/README.md index 49f21b7..ef21e32 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ building decorators. gradle tasks gradle helloWorld + ## 11-task-class 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 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