I would like to mark the classes of my systest sourceSet as unit test classes. I tried to mark them with the following code:
sourceSets {
main {
groovy {
srcDirs = [
'src/main/masks'
}
resources {
srcDirs += 'src/main/journaltemplates'
}
}
/* This brings up systest in the test resources */
test.java.srcDir 'src/systest/java'
test.resources.srcDir 'src/systest/resources'
systest {
java {
srcDirs = ['src/systest/java']
}
resources {
srcDirs = ['src/systest/resources']
}
}
}
With this solution the sourceset got marked as unit test class, but was additionally added to the test sourceSet which is not desired. I want to keep the classes in the systest sourceSet and specify that the systest sourceSet, is a unit test sourceSet. I want the same behaviour for the systest sourceSet as for the test sourceSet, but they should be distinct sourceSets.
The second solution i tried was using the idea plugin for gradle and modify the module setting, as seen in this SO post:
idea {
module {
testSourceDirs += file('src/systest')
}
}
The problem with this solution is that the systest sources are added to the test sourceSet too.
Hopefully this is clear enough, otherwise please comment. Thank you.