You should not try to override the default clean task, but instead configure it to delete additional stuff like
clean {
delete rootProject.buildDir
}
But check first whether this is not the default behavior of the clean task anyway.
Alternatively if you want to be able to do a specific clean action individually, you can also define a separate task and add a dependency like
task customClean(type: Delete) {
delete rootProject.buildDir
}
clean.dependsOn customClean