Failing builds on common errors or typos in build scripts?


I love the “fail-fast” philosophy of Gradle. Would it be possible to apply this also to common errors or typos in build scripts? E.g. the following code shows two simple problems. Execute it as

gradle -q bar and gradle -q baz

task bar << {
        print "Hello"
  task foo(depndsOn: bar) << {
        println " World!"
  task baz << {
        dependsOn bar, foo

The typo in the dependsOn-clause is not flagged as an error – the bad dependency declaration is simply ignored. And the dependency-clause in the baz-task is ignored as well, due to the extraneous “<<”.

Would it be possible to catch such problems and flag a warning at least?

Thanks, Carsten


In a lot of cases we do fail on such cases, but we’ve not yet updated the task creation DSL to use our new stricter option handling. I’ve raised GRADLE-2449 to track getting this updated, which would make this fail fast.

Thanks a lot, Luke!