Skip to content

Commit 8367a3d

Browse files
committed
fix tasks to remove results from previous test runs
1 parent e87437b commit 8367a3d

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

core/build.gradle.kts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ val samplesImplementation by configurations.getting {
7777
extendsFrom(configurations.testImplementation.get())
7878
}
7979

80-
val myKotlinCompileTask = tasks.named<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>("compileSamplesKotlin") {
80+
val compileSamplesKotlin = tasks.named<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>("compileSamplesKotlin") {
8181
friendPaths.from(sourceSets["main"].output.classesDirs)
8282
source(sourceSets["test"].kotlin)
8383
destinationDirectory.set(file("$buildDir/classes/testWithOutputs/kotlin"))
@@ -95,18 +95,17 @@ tasks.named("lintKotlinSamples") {
9595
onlyIf { false }
9696
}
9797

98+
val clearTestResults by tasks.creating(Delete::class) {
99+
delete(File(buildDir, "dataframes"))
100+
delete(File(buildDir, "korroOutputLines"))
101+
}
102+
98103
val samplesTest = tasks.register<Test>("samplesTest") {
99104
group = "Verification"
100105
description = "Runs the custom tests."
101106

102-
dependsOn(myKotlinCompileTask)
103-
104-
doFirst {
105-
delete {
106-
delete(fileTree(File(buildDir, "dataframes")))
107-
delete(fileTree(File(buildDir, "korroOutputLines")))
108-
}
109-
}
107+
dependsOn(compileSamplesKotlin)
108+
dependsOn(clearTestResults)
110109

111110
environment("DATAFRAME_SAVE_OUTPUTS", "")
112111

@@ -134,8 +133,8 @@ val copySamplesOutputs = tasks.register<JavaExec>("copySamplesOutputs") {
134133
group = "documentation"
135134
mainClass.set("org.jetbrains.kotlinx.dataframe.explainer.SampleAggregatorKt")
136135

137-
dependsOn(samplesTest)
138136
dependsOn(clearSamplesOutputs)
137+
dependsOn(samplesTest)
139138
classpath = sourceSets.test.get().runtimeClasspath
140139
}
141140

0 commit comments

Comments
 (0)