On 10/02/10 7:18 AM, Peter Ledbrook wrote:
Hi,
Does the Copy task in any way support copying files from the
classpath?
Not yet.
Given a ClassLoader, you could do something like:
copy {
from classLoader.urls.each { url ->
// ignore non-file URLs
def file = new File(url.path)
file.isFile() ? zipTree(file) : file
}
// include, exclude, whatever ...
}
I'm really looking for something similar to Spring's
Resource abstraction, so that one could copy from the filesystem, a
zip file (I know this is already possible), the classpath, a URL, etc.
This is pretty much what the FileCollection/FileTree and FileTreeElement
interfaces provide. Perhaps they need better names, or perhaps we should
extract some super-interfaces from them that represent a more abstract
'resource' concept.
Regardless, I think we should end up with a bunch of implementations
which let you copy from classpaths, URLs, SSH, and so on.
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email