So, Gradle automatically manages dependencies only when they are set on some
predefined configurations, like 'compile'. In order to make my project work
(and to avoid making 'distribution' project java), I had to add dependency
on a task explicitly:
project(':project-distribution') {
configurations {
binaries
sources
javadocs
examples
}
dependencies {
binaries project(path: ':project', configuration: 'default')
sources project(path: ':project', configuration: 'sources')
javadocs project(path: ':project', configuration : 'javadocs')
binaries project(path: ':project-browser', configuration: 'default')
sources project(path: ':project-browser', configuration: 'sources')
examples project(path: ':project-example-simple', configuration:
'sources')
}
task build(dependsOn: assemble) {}
task prepareDistribution() {}
// HACK, explicit dependency on all dependencies' 'assemble' task.
javaProjects().each {
project.prepareDistribution.dependsOn(it.assemble)
}
}
How much more beautiful it would be if any configuration dependency could be
taken into account!
My current solution works for my project, but is very far from 'correct', -
some artifacts I'd like to depend on might be ready far before 'assemble'
task, and some might be only ready at other moments... so explicit knowledge
of dependency lifecycle is required :(
Do I miss any elegant solution to this problem?
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Gradle-does-not-honor-dependencies-in-multi-module-project-tp4329149p4329310.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email