Slackbot
10/27/2023, 8:36 AMGabriel Feo
10/27/2023, 1:28 PMtest.dependsOn(download) (https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:adding_dependencies_to_tasks)Giuseppe Barbieri
10/27/2023, 1:41 PMGabriel Feo
10/27/2023, 2:00 PMGiuseppe Barbieri
10/27/2023, 5:07 PM:cleanJvmTest :jvmTest --tests "io.scif.formats.apng.ApngTest", then how can I define the corresponding test task?Gabriel Feo
10/27/2023, 5:27 PMjvmTest sounds like Kotlin Multiplatform). You don't need to create a Test task, just your Download task, then set the existing test task to depend on Download. You could do something like this
tasks.named("jvmTest") {
dependsOn(tasks.named("downloadTaskName"))
}Giuseppe Barbieri
10/28/2023, 10:28 AMApngTest, is it possible?Gabriel Feo
10/30/2023, 10:31 AMApngTest to a new test suite. Declare a new suite (see docs), then set the testTask of that suite to depend on download
register<JvmTestSuite>("pngTest") {
targets {
all {
testTask.configure {
dependsOn(tasks.named("downloadTaskName"))
}
}
}
}
2. The easiest: you keep requesting both tasks when you run, i.e. :downloadTaskName :jvmTest --tests "io.scif.formats.apng.ApngTest", but you can specify that jvmTest needs to wait for the download task (if the download task was requested)
tasks.named("jvmTest") {
mustRunAfter(tasks.named("downloadTaskName"))
}Giuseppe Barbieri
10/30/2023, 8:48 PM