@@ -77,7 +77,7 @@ val samplesImplementation by configurations.getting {
77
77
extendsFrom(configurations.testImplementation.get())
78
78
}
79
79
80
- val myKotlinCompileTask = tasks.named< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > (" compileSamplesKotlin" ) {
80
+ val compileSamplesKotlin = tasks.named< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > (" compileSamplesKotlin" ) {
81
81
friendPaths.from(sourceSets[" main" ].output.classesDirs)
82
82
source(sourceSets[" test" ].kotlin)
83
83
destinationDirectory.set(file(" $buildDir /classes/testWithOutputs/kotlin" ))
@@ -95,18 +95,17 @@ tasks.named("lintKotlinSamples") {
95
95
onlyIf { false }
96
96
}
97
97
98
+ val clearTestResults by tasks.creating(Delete ::class ) {
99
+ delete(File (buildDir, " dataframes" ))
100
+ delete(File (buildDir, " korroOutputLines" ))
101
+ }
102
+
98
103
val samplesTest = tasks.register<Test >(" samplesTest" ) {
99
104
group = " Verification"
100
105
description = " Runs the custom tests."
101
106
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)
110
109
111
110
environment(" DATAFRAME_SAVE_OUTPUTS" , " " )
112
111
@@ -134,8 +133,8 @@ val copySamplesOutputs = tasks.register<JavaExec>("copySamplesOutputs") {
134
133
group = " documentation"
135
134
mainClass.set(" org.jetbrains.kotlinx.dataframe.explainer.SampleAggregatorKt" )
136
135
137
- dependsOn(samplesTest)
138
136
dependsOn(clearSamplesOutputs)
137
+ dependsOn(samplesTest)
139
138
classpath = sourceSets.test.get().runtimeClasspath
140
139
}
141
140
0 commit comments