In my case I have multiproject build with many subprojects and sub/subprojects.
Then I would like to be able to call this task from different subprojects to produce different jars set (basing on the project dependencies). In that way I would be able to create separate distribution for different subprojects.
I've come to the stage that I can list all of projects deps jars in an ugly way:
task showJars {
doLast {
if( configurations && configurations.getByName('compile') ) {
configurations.compile.collect {
if( !it.toString().contains('.gradle') )
println(it)
}
}
}
}
I am working on a task to gather all project jars in one directory to create distribution for the app. Is there any clean way to achieve this ?
Thanks!
gradle jar
task. There are also dependencies between subprojects. I want to define a task which will create a projects jars and then copy them to one directory. The first part is to simply invokegradle jar
in the root or one of the subprojects, the second is to collect the project jars and copy them to one location. – Piotr