On Dec 5, 2008, at 8:43 PM, Rafael Serrano wrote:
Hi all,
Congratulations for the new release! You're doing a fantastic job.
I have been testing it and found a new feature for adding exclusion
rules to
a certain configuration. However, I can't make it work. What I am
trying to
do is to copy all my runtime JARs to a directory, but want to exclude
"servlet-api-2.5.jar".
Here is my code snippet:
dependencies {
excludeRules.add(org: "javax.servlet", ["runtime"])
compile "javax.servlet:servlet-api:2.5"
...
}
createTask('copy-to') {
dependencies.resolve("runtime").each {
file -> FileUtils.copyFileToDirectory(file, 'foo/bar')
}
}
What you could do is:
dependencies.resolve("runtime").findAll { it.name != servlet-
api }.each { file ->
file -> FileUtils.copyFileToDirectory(file, 'foo/bar')
}
It would be nice if Gradle could provide a filter for the resolve
method which would not act on the file name but on group, name and
version.
BTW: In 0.5 you can also write: dependencies.runtime.resolve()
- Hans
--
Hans Dockter
Gradle Project lead
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email