diff --git a/buildSrc/src/main/kotlin/spring.batch.plus.java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/spring.batch.plus.java-library-conventions.gradle.kts index 757deae..459b513 100644 --- a/buildSrc/src/main/kotlin/spring.batch.plus.java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/spring.batch.plus.java-library-conventions.gradle.kts @@ -29,6 +29,19 @@ tasks.compileJava { options.encoding = "UTF-8" } +sourceSets { + create("integrationTest") { + compileClasspath += sourceSets.main.get().output + runtimeClasspath += sourceSets.main.get().output + } +} +val integrationTestImplementation: Configuration by configurations.getting { + extendsFrom(configurations.implementation.get(), configurations.testImplementation.get()) +} +val integrationTestRuntimeOnly: Configuration by configurations.getting { + extendsFrom(configurations.runtimeOnly.get(), configurations.testRuntimeOnly.get()) +} + tasks.withType().configureEach { reports { configFile = file("${project.rootDir}/buildSrc/config/naver-checkstyle-rules.xml") @@ -44,3 +57,14 @@ tasks.named("test") { useJUnitPlatform() maxParallelForks = Runtime.getRuntime().availableProcessors() } + +tasks.register("integrationTest") { + // run after 'test' task + shouldRunAfter("test") + + useJUnitPlatform() + maxParallelForks = Runtime.getRuntime().availableProcessors() + + testClassesDirs = sourceSets["integrationTest"].output.classesDirs + classpath = sourceSets["integrationTest"].runtimeClasspath +}