diff --git a/10-custom-task-dofirst/build.gradle b/10-custom-task-dofirst/build.gradle new file mode 100644 index 0000000..7b005a4 --- /dev/null +++ b/10-custom-task-dofirst/build.gradle @@ -0,0 +1,14 @@ +task helloWorld { + // Configuration phase - Gradle learns about tasks. + // This scope is executed first + description "Say hello :-)" + + doFirst { + // Execution phase + println "Sunny day." + } + doLast { + // Execution phase + println "Greetings from Brno" + } +} diff --git a/README.md b/README.md index 005cb09..b782089 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,8 @@ Gradle is able to generate project files for Visual Studio for C/C++. gradle mainVisualStudio ii .\visualStudio\mainExe.sln +Solution file is stored in visualStudio/mainExe.sln + ## 09-custom-task-dolast @@ -96,4 +98,13 @@ will execute always even when you run `gradle tasks` gradle tasks gradle helloWorld -Solution file is stored in visualStudio/mainExe.sln + + +## 10-custom-task-dofirst + +doLast allows to append execution code at the end of task. There is another +method doFirst which prepends code before current code. It's useful when +building decorators. + + gradle tasks + gradle helloWorld