One of my projects requires Java 1.8, but sometimes we have not noticed that we are using older Java to get some strange errors.
I want to add verification to build.gradle , so when we run a task, it first checks the version and prints an error and exits immediately.
I tried adding verification directly to build.gradle in the first line, but still performs some other tasks, for example. ( clean , compileJava ) before checking when I run:
$ ./gradlew
How to do it right?
source share