How to declare dependency between a sourceSet and jar task.
My gradle looks like this
sourceSet {
main {
}
contrib {
}
}
task myJar(type: jar) {
//This task builds jar from the sourceSets.main.output
}
Now the compilation of the contrib depends on the jar myJar . How can I declare this dependency ?
Also in the dependencies section I have contribCompile. Following line works
contribCompile sourceSets.main.output
but if I try to declare a dependency like this it fails
contribCompile myJar
Can someone please help me ?