Skip to content

Commit ed8e69c

Browse files
committed
rename test task
1 parent 241bcd4 commit ed8e69c

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

core/build.gradle.kts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ kotlin.sourceSets {
4444
}
4545

4646
sourceSets {
47-
create("myTest") {
47+
create("samples") {
4848
kotlin.srcDir("src/test/kotlin")
4949
}
5050
}
5151

5252
dependencies {
53-
val kotlinCompilerPluginClasspathMyTest by configurations.getting
53+
val kotlinCompilerPluginClasspathSamples by configurations.getting
5454

5555
api(libs.kotlin.reflect)
5656
implementation(libs.kotlin.stdlib)
57-
kotlinCompilerPluginClasspathMyTest(project(":plugins:expressions-converter"))
57+
kotlinCompilerPluginClasspathSamples(project(":plugins:expressions-converter"))
5858
implementation(libs.kotlin.stdlib.jdk8)
5959

6060
api(libs.commonsCsv)
@@ -72,29 +72,29 @@ dependencies {
7272
testImplementation(libs.jsoup)
7373
}
7474

75-
val myTestImplementation by configurations.getting {
75+
val samplesImplementation by configurations.getting {
7676
extendsFrom(configurations.testImplementation.get())
7777
}
7878

79-
val myKotlinCompileTask = tasks.named<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>("compileMyTestKotlin") {
79+
val myKotlinCompileTask = tasks.named<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>("compileSamplesKotlin") {
8080
friendPaths.from(sourceSets["main"].output.classesDirs)
8181
source(sourceSets["test"].kotlin)
8282
destinationDirectory.set(file("$buildDir/classes/testWithOutputs/kotlin"))
8383
}
8484

8585
tasks.withType<KspTask> {
8686
// "test" classpath is re-used, so repeated generation should be disabled
87-
if (name == "kspMyTestKotlin") {
87+
if (name == "kspSamplesKotlin") {
8888
dependsOn("kspTestKotlin")
8989
enabled = false
9090
}
9191
}
9292

93-
tasks.named("lintKotlinMyTest") {
93+
tasks.named("lintKotlinSamples") {
9494
onlyIf { false }
9595
}
9696

97-
val customTest = tasks.register<Test>("customTest") {
97+
val samplesTest = tasks.register<Test>("samplesTest") {
9898
group = "Verification"
9999
description = "Runs the custom tests."
100100

@@ -115,20 +115,25 @@ val customTest = tasks.register<Test>("customTest") {
115115
ignoreFailures = true
116116

117117
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
119119
}
120120

121-
val copySamplesOutputs = tasks.register<JavaExec>("copySamplesOutputs") {
121+
val clearSamplesOutputs by tasks.creating {
122122
group = "documentation"
123-
mainClass.set("org.jetbrains.kotlinx.dataframe.explainer.SampleAggregatorKt")
124123

125124
doFirst {
126125
delete {
127126
delete(fileTree(File(projectDir, "../docs/StardustDocs/snippets")))
128127
}
129128
}
129+
}
130+
131+
val copySamplesOutputs = tasks.register<JavaExec>("copySamplesOutputs") {
132+
group = "documentation"
133+
mainClass.set("org.jetbrains.kotlinx.dataframe.explainer.SampleAggregatorKt")
130134

131-
dependsOn(customTest)
135+
dependsOn(samplesTest)
136+
dependsOn(clearSamplesOutputs)
132137
classpath = sourceSets.test.get().runtimeClasspath
133138
}
134139

0 commit comments

Comments
 (0)