On 01/10/2011, at 2:21 AM, Russel Winder wrote:

> It seems that Gradle now keeps a cache of a projects dependencies for
> each version of Gradle.

Not quite. The artifact cache is versioned based on its layout. When we change 
the layout (which includes file naming scheme, the contents of the meta-data 
files, the locking protocols, etc), we change the version number of the cache. 
Which means downloading the dependencies again. For the next few releases, I 
would imagine this version will change quite frequently. Once a bit more 
stable, this version will change more slowly.

To help with this, we want to separately the binary artifacts and the 
dependency resolution meta data into separate caches which are versioned 
indepentently. This will mean that only when the binary artifact cache layout 
changes will you need to download everything again. We expect the binary 
artifact cache version to change much less frequently than the meta-data cache. 
Plus, by separating them, we can focus on keeping the binary artifact cache 
stable, without putting too many constraints on what we can do with the 
meta-data cache.


>  So how can all the garbage of all the
> dependencies downloaded for versions of Gradle no longer in use be
> removed?  Is there a "garbage collection" capability in Gradle to handle
> all this.

Not yet. There will be at some point. I imagine we'll start with some kind of 
manual command to clean out old stuff, perhaps just a brute force operation 
that axes artifacts from previous Gradle versions. Later, we can start garbage 
collecting more stuff from old versions (compiled scripts, distributions used 
by the wrapper, and other start), and garbage collecting old stuff used by the 
current version (eg artifacts and other state used by builds which have been 
deleted, or repositories that are no longer used), and doing all this in the 
background (eg in the daemon, or while we're waiting for stuff to happen).


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to