In a project I have multiple sourceSets/source folders. Each sourceSet needs to be compiled but also needs to have separate dependencies:
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
group = 'grpId'
version = '1.0'
repositories {
mavenLocal()
}
sourceSets {
main {
java {
srcDir 'src'
}
}
other {
java {
srcDir 'other'
}
}
}
dependencies {
// specify that the 'other' sourceSet should be compiled
compile sourceSets.other.output
// How to set dependency specific for the the 'main' and 'other' sourceSet?
}
How do I:
-
Make sure both sourceSets are compiled - seems to work with the above approach
-
Specify a dependency for the sourceSet ‘other’, eg. c:\repo\a.jar?
-
Specify a dependency for the sourceSet ‘main’, eg. c:\repo\b.jar