Hello,
I'm about 2 minutes away from giving up on using Gradle for my java
application.
I have a multi-module Java project that looks like:
MyProject/
app/
common/
The App project depends on the common project for compile and for runtime.
The Common project requires commons-lang.
Using commons lang classes in my App project is fine during compilation
time, and all my unit tests pass. However I cannot for the life of me get
the dependencies of the common project into the app project for deployment.
I cannot see any easy way to collect all the dependencies of App into a
single jar file to ship.
I was pointed to this in the IRC chat room:
http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-Creatingafatjar
But even changing it to configurations.runtime does absolutely nothing.
The best that I can come up with is something like:
[code]
assemble << {
copy {
into "${buildDir}/classes/main"
from configurations.compile.allDependencies.collect { dep ->
dep.dependencyProject.configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
}
[/code]
But this seems horrible to me.
Please tell me that there is an easy way to do this. Any help here would be
greatly appreciated.
Thanks.
Eric
--
Learn from the past. Live in the present. Plan for the future.
Blog: http://eric-berry.blogspot.com
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans