In gradle I have created a new sourceSet for service testing like this:
sourceSets{
servicetest{
java.srcDirs = [//path to servicetests]
}
}
This source set depends on TestNG, so I was hoping to pull the dependency down by doing something like:
dependencies{
servicetest(group: 'org.testng', name: 'testng', version: '5.8', classifier: 'jdk15')
}
Unfortunately this returns an error. Is there any way to declare a dependency for a specific sourceSet or am I out of luck?
Recent Gradle versions automatically create and wire configurations ‘fooCompile’ and ‘fooRuntime’ for each source set ‘foo’.
If you are still using an older version, you can declare your own configuration and add it to the source set’s compileClasspath or runtimeClasspath. Something like: