From 78f70e52c4166e34dd96825c1e8305ae6fe08cd9 Mon Sep 17 00:00:00 2001 From: Juraj Michalek Date: Fri, 9 May 2014 22:50:00 +0200 Subject: [PATCH] 12 custom plugin --- 12-custom-plugin/build.gradle | 2 ++ 12-custom-plugin/helloPlugin.gradle | 8 ++++++++ README.md | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 12-custom-plugin/build.gradle create mode 100644 12-custom-plugin/helloPlugin.gradle 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