Hi all,
In our project we have both ‘tests’ and ‘speedtests’. The latter are performance tests and take a long time, so we don’t want them running every time we test compiler correctness.
Right now, here’s the sourceSets configuration:
sourceSets {
main.java {
srcDir 'src'
srcDir 'protobuf/java'
srcDir 'third-party-src'
}
test.java {
srcDir 'test'
}
speedtest.java {
srcDir 'speedtest'
}
}
task speedtest(type: Test) {
testClassesDir = sourceSets.speedtest.output.classesDir
classpath = sourceSets.speedtest.runtimeClasspath
include = 'speedtest/**'
scanForTestClasses=true
}
If I run ‘gradle build’ it will compile everything successfully and run the tests in the ‘test’ subdirectory. It does not run ‘speedtestClasses’ to compile the ‘speedtest’ code. When I run ‘speedtestClasses’ manually, it fails—presumably because it does not know that, like test, it needs to copy all the settings from ‘compile’ and ‘runtime’ and ‘testCompile’ and ‘testRuntime’.
Is there a way to easily get it to clone ‘test’'s settings and act in a similar way?
Thanks!