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