Skip to content

Instantly share code, notes, and snippets.

@wafna
Created February 27, 2024 01:24
Show Gist options
  • Save wafna/a691596b9c6cc12ca16d4fa383fbcf95 to your computer and use it in GitHub Desktop.
Save wafna/a691596b9c6cc12ca16d4fa383fbcf95 to your computer and use it in GitHub Desktop.
Create integrationTest source tree in Gradle with Kotlin DSL
val integrationTest = java.sourceSets.create("integrationTest").apply {
compileClasspath += sourceSets.test.get().compileClasspath
runtimeClasspath += sourceSets.test.get().runtimeClasspath
java.srcDirs("src/integration-test/kotlin")
}
tasks.create("integrationTest", Test::class) {
group = "verification"
description = "Runs integration tests."
testClassesDirs = integrationTest.output.classesDirs
classpath = integrationTest.runtimeClasspath
shouldRunAfter("test")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment