On Oct 1, 2009, at 2:04 PM, Steve Appling wrote:
Adam Murdoch wrote:
Steve Appling wrote:
On a related topic, I really don't like all of the script cache
information to be stored under the user home directory. It
seems that putting this under a .gradle in the root project
would be better. That way the script caches go away when a
project directory is deleted. I currently have 745 directories
directly under my home/scriptCache directory.
Is it the fact that the scripts are cached under ~/.gradle that
you don't like, or the fact that they aren't being cleaned up
when they are no longer needed?
It is really just that they are never cleaned up that bothers me.
I think we have a similar problem under ~/.gradle/wrapper and
~/.gradle/cache.
There's a few problems with moving the scripts to the root
project dir:
- It doesn't solve the problem for ~/.gradle/wrapper and
~/.gradle/cache.
- It doesn't solve the problem for scripts which are compiled
before we know the root project dir, such as init scripts.
- It doesn't work for read-only workspaces.
There may not be quite as many files under ~/.gradle/wrapper and
~/.gradle/cache, but they take up much more space. It would be
nice to come up with a solution which cleaned up every thing we
cache.
Some possible solutions:
- A task or command-line option which garbage collects ~/.gradle.
- The gradle command periodically garbage collects ~/.gradle,
based on some threshold. This could be number of invocations
since last garbage collect, time since last garbage collect,
total size of ~/.gradle, or free disk space.
- We garbage collect a cache whenever we write to it (no more
than once per build).
- Don't cache anything under ~/.gradle. For example, store
everything under the root project dir, including the ivy cache.
For those things where we don't know the root project dir, store
in a .gradle dir in the directory containing the thing.
I would have said that I prefer this, but it doesn't handle read
only workspaces or init scripts. I don't know how important this
is.
I'm not sure either. Maybe we don't care about this. We could
always add a command-line/init script option to let you specify the
cache dir, for this situation.
This solution also will duplicate the downloaded ivy files for
different projects, which is in line with my desire to keep
project information together, but will slow things down in
general :(.
You would pay a one-off cost for each dependency per build, which
might not be too bad. Moving the ivy cache to
$rootProjectDir/.gradle has some advantages, such as it gets rid of
some ivy weirdness when multiple builds share the same cache.
That's true - I currently get Ivy warnings whenever I switch between
working on Gradle or working on our own project because Ivy stores
the name of the repository in its cache.
This is a truly annoying Ivy bug. I have just commented on it again.
More votes might help (I know that you have voted):
https://issues.apache.org/jira/browse/IVY-758
- Hans
--
Hans Dockter
Gradle Project Manager
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email