From 1e17ee9dbfe2ecae392936d13567aaabc037c249 Mon Sep 17 00:00:00 2001 From: Gleb Nazarov Date: Mon, 16 Dec 2024 23:12:24 +0500 Subject: [PATCH] store backendJar task in variable to access it later --- fullstack-mpp/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fullstack-mpp/build.gradle.kts b/fullstack-mpp/build.gradle.kts index fcd9104b..0632ebf3 100644 --- a/fullstack-mpp/build.gradle.kts +++ b/fullstack-mpp/build.gradle.kts @@ -69,14 +69,14 @@ repositories { mavenCentral() } -tasks.named("backendJar") { - val frontendBrowserProductionWebpack = tasks.named("frontendBrowserProductionWebpack", KotlinWebpack::class).get() +val backendJar = tasks.getByName("backendJar") { + val frontendBrowserProductionWebpack = tasks.getByName("frontendBrowserProductionWebpack") dependsOn(frontendBrowserProductionWebpack) from(frontendBrowserProductionWebpack.outputDirectory, frontendBrowserProductionWebpack.mainOutputFileName) } tasks.register("run") { - dependsOn(tasks.named("backendJar")) + dependsOn(backendJar) mainClass.set("io.ktor.samples.fullstack.backend.BackendCodeKt") classpath = files(configurations.named("backendRuntimeClasspath").get(), tasks.named("backendJar").get()) args = listOf()