From 0e30e1333dbec2485ac1338ac5ba73f90ecca3eb Mon Sep 17 00:00:00 2001 From: Juraj Michalek Date: Tue, 13 May 2014 10:48:36 +0200 Subject: [PATCH] 16 - how to stop build execution --- 16-stop-build/build.gradle | 15 +++++++++++++++ README.md | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 16-stop-build/build.gradle diff --git a/16-stop-build/build.gradle b/16-stop-build/build.gradle new file mode 100644 index 0000000..8df5d7e --- /dev/null +++ b/16-stop-build/build.gradle @@ -0,0 +1,15 @@ + +task workingTask { + description 'Task that works' + doLast { + println 'Everything is ok' + } +} + +task failingTask { + description 'Task that fails' + doLast { + throw new GradleException("Problem detected. Build failed") + } +} + diff --git a/README.md b/README.md index 5415d6f..fc9bc8b 100644 --- a/README.md +++ b/README.md @@ -163,3 +163,11 @@ Plugin is just counting lines in build.gradle file in current directory. gradle tasks gradle countLines + + +## 16-stop-build + +It is possible to stop build by throwing exception. + + gradle workingTask + gradle failingTask