[GRADLE-3009] File handle leaks when using AntBuilder (daemon) Created: 29/Jan/14 Updated: 18/Feb/14 Resolved: 18/Feb/14
|Reporter:||Luke Daley||Assignee:||Luke Daley|
Ant internally uses an AntClassLoader. It keeps a cache of File → JarFile (AntClassLoader#jarFiles). This cache holds open JarFile objects. This cache is designed to be open for the duration of the build, and then closed at the end. The problem is that we never tell Ant that the build has finished and therefore it never closes this cache.
To remedy this, we need to make sure we call fireBuildFinished() on all ant Project instances when the build is over.