I want to retain the buildDir, but want to delete all its contents whenever i do “gradle clean”.
I have read in the forums how to do it in a single-root-project scenario, by overwriting the default clean task.
But i have a multi-project build, where the output of all the subproject’s build are put in a single buildDir.
In this case the sub-project’s clean task still deletes both the buildDir and its contents.
So i want to do it like ,when i do “gradle subproject:clean”, i only want the subproject’s stuff in buildDir deleted. and when i do “gradle clean” from the root, all the contents of buildDir should be removed , but the empty buildDir should still be present.
How to accomplish this in gradle?
Thanks in advance for reply,