ghillairet / xcore-gradle-example

xcore-gradle-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gradle clean

m9aertner opened this issue · comments

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.