Skip to content

Instantly share code, notes, and snippets.

@gmazzo
Created April 3, 2018 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmazzo/d8bfbf3697ea36cb42d65b962ef85992 to your computer and use it in GitHub Desktop.
Save gmazzo/d8bfbf3697ea36cb42d65b962ef85992 to your computer and use it in GitHub Desktop.
Integration tests sourceSet script for a Gradle Java project
sourceSets {
integrationTest {
compileClasspath += sourceSets.main.output + configurations.testRuntime
runtimeClasspath += output + compileClasspath
}
}
configurations {
integrationTestCompile {
extendsFrom configurations.testCompile
}
integrationTestRuntime {
extendsFrom configurations.testRuntime
}
}
idea {
module {
testSourceDirs += file('src/integrationTest/java')
}
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
build.dependsOn it
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment