Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 866 Bytes
// Assumes 'java', 'groovy' or 'scala' plugins have been applied before
// Add integration test source sets
sourceSets {
integrationTest { sourceSet ->
["java", "groovy", "scala", "resources"].each {
if (!sourceSet.hasProperty(it)) return
sourceSet."$it".srcDir file("src/integration-test/${it}")
}
}
}
// Setup dependencies for integration testing
dependencies {
integrationTestCompile sourceSets.main.output
integrationTestCompile sourceSets.test.output
integrationTestCompile configurations.testCompile
integrationTestRuntime configurations.testRuntime
}
// Define integration test task
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
}
// Make sure 'check' task calls integration test
check.dependsOn integrationTest