ghillairet / xcore-gradle-example

xcore-gradle-example
5 stars 5 forks source link

Gradle clean #5

Open m9aertner opened 7 years ago

m9aertner commented 7 years ago

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.