@@ -44,17 +44,17 @@ kotlin.sourceSets {
44
44
}
45
45
46
46
sourceSets {
47
- create(" myTest " ) {
47
+ create(" samples " ) {
48
48
kotlin.srcDir(" src/test/kotlin" )
49
49
}
50
50
}
51
51
52
52
dependencies {
53
- val kotlinCompilerPluginClasspathMyTest by configurations.getting
53
+ val kotlinCompilerPluginClasspathSamples by configurations.getting
54
54
55
55
api(libs.kotlin.reflect)
56
56
implementation(libs.kotlin.stdlib)
57
- kotlinCompilerPluginClasspathMyTest (project(" :plugins:expressions-converter" ))
57
+ kotlinCompilerPluginClasspathSamples (project(" :plugins:expressions-converter" ))
58
58
implementation(libs.kotlin.stdlib.jdk8)
59
59
60
60
api(libs.commonsCsv)
@@ -72,29 +72,29 @@ dependencies {
72
72
testImplementation(libs.jsoup)
73
73
}
74
74
75
- val myTestImplementation by configurations.getting {
75
+ val samplesImplementation by configurations.getting {
76
76
extendsFrom(configurations.testImplementation.get())
77
77
}
78
78
79
- val myKotlinCompileTask = tasks.named< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > (" compileMyTestKotlin " ) {
79
+ val myKotlinCompileTask = tasks.named< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > (" compileSamplesKotlin " ) {
80
80
friendPaths.from(sourceSets[" main" ].output.classesDirs)
81
81
source(sourceSets[" test" ].kotlin)
82
82
destinationDirectory.set(file(" $buildDir /classes/testWithOutputs/kotlin" ))
83
83
}
84
84
85
85
tasks.withType<KspTask > {
86
86
// "test" classpath is re-used, so repeated generation should be disabled
87
- if (name == " kspMyTestKotlin " ) {
87
+ if (name == " kspSamplesKotlin " ) {
88
88
dependsOn(" kspTestKotlin" )
89
89
enabled = false
90
90
}
91
91
}
92
92
93
- tasks.named(" lintKotlinMyTest " ) {
93
+ tasks.named(" lintKotlinSamples " ) {
94
94
onlyIf { false }
95
95
}
96
96
97
- val customTest = tasks.register<Test >(" customTest " ) {
97
+ val samplesTest = tasks.register<Test >(" samplesTest " ) {
98
98
group = " Verification"
99
99
description = " Runs the custom tests."
100
100
@@ -115,20 +115,25 @@ val customTest = tasks.register<Test>("customTest") {
115
115
ignoreFailures = true
116
116
117
117
testClassesDirs = fileTree(" $buildDir /classes/testWithOutputs/kotlin" )
118
- classpath = files(" $buildDir /classes/testWithOutputs/kotlin" ) + configurations[" myTestRuntimeClasspath " ] + sourceSets[" main" ].runtimeClasspath
118
+ classpath = files(" $buildDir /classes/testWithOutputs/kotlin" ) + configurations[" samplesRuntimeClasspath " ] + sourceSets[" main" ].runtimeClasspath
119
119
}
120
120
121
- val copySamplesOutputs = tasks.register< JavaExec >( " copySamplesOutputs " ) {
121
+ val clearSamplesOutputs by tasks.creating {
122
122
group = " documentation"
123
- mainClass.set(" org.jetbrains.kotlinx.dataframe.explainer.SampleAggregatorKt" )
124
123
125
124
doFirst {
126
125
delete {
127
126
delete(fileTree(File (projectDir, " ../docs/StardustDocs/snippets" )))
128
127
}
129
128
}
129
+ }
130
+
131
+ val copySamplesOutputs = tasks.register<JavaExec >(" copySamplesOutputs" ) {
132
+ group = " documentation"
133
+ mainClass.set(" org.jetbrains.kotlinx.dataframe.explainer.SampleAggregatorKt" )
130
134
131
- dependsOn(customTest)
135
+ dependsOn(samplesTest)
136
+ dependsOn(clearSamplesOutputs)
132
137
classpath = sourceSets.test.get().runtimeClasspath
133
138
}
134
139
0 commit comments