The clean task should not execute the deletion in the configuration phase. Simple solution is to write
clean.doFirst {
delete 'src/main/java-gen'
}
BTW, is that folder created at all? After a clean clone and build, I don't see it ... Maybe just remove it?
TL;DR
Neither << nor doLast { ... } are used, as one would commonly do in Gradle to move the code to the execution phase. Now the "clean" task is special, in that a simple delete calls the method on the wrong object (see http://stackoverflow.com/a/28044951/1037626). doLast works.
The clean task should not execute the deletion in the configuration phase. Simple solution is to write
BTW, is that folder created at all? After a clean clone and build, I don't see it ... Maybe just remove it?
TL;DR
Neither
<<
nordoLast { ... }
are used, as one would commonly do in Gradle to move the code to the execution phase. Now the "clean" task is special, in that a simpledelete
calls the method on the wrong object (see http://stackoverflow.com/a/28044951/1037626).doLast
works.