gradle-doctor
gradle-doctor copied to clipboard
Add a task to easily delete empty directories
The gradle doctor finds empty directories in source directories, but if the root directory is empty, it does not warn you. Let's add a task which removes all empty source directories. Related to: https://github.com/gradle/gradle/issues/2463
I'd love that. Is there any special consideration to implement it or should it just delete any empty dirs recursively?
@ZacSweers 's PR to check the furthest empty parent makes this a lot easier when finding cache misses: https://github.com/runningcode/gradle-doctor/pull/105 However it still doesn't fix the case when the root directory is empty. Although a cache miss with an empty root directory is usually not a big deal since it doesn't take long to compile empty sources.
As for a script, the only consideration would be that some projects might have empty source directories which are somehow meaningful to the build. Otherwise I would think it would be safe to delete all empty directories in the entire project.