Skip to content

Commit ea6d503

Browse files
authored
chore(build): gradle script cleanups (#1740)
* chore(build): gradle script cleanups * remove unnecessary publish to maven local on each jar build (it was required BEFORE we move moved all plugin integration tests to separate composite projects) * use JVM test suite instead of a custom `Test` task * ktlint fix
1 parent 403603c commit ea6d503

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

buildSrc/src/main/kotlin/com.expediagroup.graphql.conventions.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ tasks {
5353
attributes["Implementation-Title"] = project.name
5454
attributes["Implementation-Version"] = project.version
5555
}
56-
57-
// NOTE: in order to run gradle and maven plugin integration tests we need to have our build artifacts available in local repo
58-
finalizedBy("publishToMavenLocal")
5956
}
6057

6158
// published sources and javadoc artifacts

plugins/schema/graphql-kotlin-sdl-generator/build.gradle.kts

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,40 @@ dependencies {
1313
testImplementation(projects.graphqlKotlinSpringServer)
1414
}
1515

16-
sourceSets {
17-
create("integrationTest") {
18-
withConvention(org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet::class) {
19-
kotlin.srcDir("src/integrationTest/kotlin")
20-
resources.srcDir("src/integrationTest/resources")
21-
compileClasspath += sourceSets["main"].output + sourceSets["test"].compileClasspath
22-
runtimeClasspath += output + compileClasspath + sourceSets["test"].runtimeClasspath
16+
testing {
17+
suites {
18+
val test by getting(JvmTestSuite::class) {
19+
useJUnitJupiter()
2320
}
24-
}
25-
}
2621

27-
tasks {
28-
val integrationTest by registering(Test::class) {
29-
description = "Runs the integration tests"
30-
group = "verification"
22+
val integrationTest by registering(JvmTestSuite::class) {
23+
dependencies {
24+
implementation(project())
25+
}
26+
27+
targets {
28+
all {
29+
testTask.configure {
30+
shouldRunAfter(test)
31+
}
32+
}
33+
}
3134

32-
testClassesDirs = sourceSets["integrationTest"].output.classesDirs
33-
classpath = sourceSets["integrationTest"].runtimeClasspath
34-
mustRunAfter("test")
35-
finalizedBy("jacocoTestReport")
36-
useJUnitPlatform()
35+
sources {
36+
java {
37+
setSrcDirs(listOf("src/integrationTest/kotlin"))
38+
}
39+
resources {
40+
setSrcDirs(listOf("src/integrationTest/resources"))
41+
}
42+
compileClasspath += sourceSets["test"].compileClasspath
43+
runtimeClasspath += compileClasspath + sourceSets["test"].runtimeClasspath
44+
}
45+
}
3746
}
47+
}
3848

49+
tasks {
3950
jacocoTestReport {
4051
// we need to explicitly add integrationTest coverage info
4152
executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec"))
@@ -59,6 +70,6 @@ tasks {
5970
}
6071
}
6172
check {
62-
dependsOn("integrationTest")
73+
dependsOn(testing.suites.named("integrationTest"))
6374
}
6475
}

0 commit comments

Comments
 (0)