I have the following code:
subprojects {
if (project.name == ‘integrationTest’) {
sourceSets {
integrationTest {
java.srcDir file(projectDir)
}
}
idea {
module {
testSourceDirs += file(‘java’)
scopes.TEST.plus += configurations.integrationTestCompile
}
}
task integrationTest(type: Test) {
forkEvery = 1
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
systemProperties[‘jar.path’] = jar.archivePath
systemProperty ‘com.netflix.cryptexclient.sslCertsRootLoc’, project(’:cryptexclient’).projectDir.toString()
}
} else {
try {
integrationTestProject = project("${project.path}/integrationTest")
task integrationTest(type: Test, dependsOn: integrationTestProject.getTasksByName(“integrationTest”, false))
tasks.publish.dependsOn(‘integrationTest’)
} catch (UnknownProjectException e) {
// ignore exception since it’s not really a problem
}
}
if (project.name == ‘performanceTest’) {
sourceSets {
performanceTest {
java.srcDir file(projectDir)
}
}
idea {
module {
testSourceDirs += file(‘java’)
scopes.TEST.plus += configurations.performanceTestCompile
}
}
task performanceTest(type: Test) {
forkEvery = 1
testClassesDir = sourceSets.performanceTest.output.classesDir
classpath = sourceSets.performanceTest.runtimeClasspath
systemProperties[‘jar.path’] = jar.archivePath
systemProperty ‘com.netflix.cryptexclient.sslCertsRootLoc’, project(’:cryptexclient’).projectDir.toString()
}
} else {
try {
performanceTestProject = project("${project.path}/performanceTest")
task performanceTest(type: Test, dependsOn: performanceTestProject.getTasksByName(“performanceTest”, false))
tasks.publish.dependsOn(‘performanceTest’)
} catch (UnknownProjectException e) {
// ignore exception since it’s not really a problem
}
}
}