From 3faf2f0135efb0ecabd672e2a79ea2e2a97b1ace Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Tue, 21 May 2024 22:23:57 +0200 Subject: [PATCH] Only rebuild webapp if clean-build or there were changes --- BlueMapCommon/build.gradle.kts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BlueMapCommon/build.gradle.kts b/BlueMapCommon/build.gradle.kts index 883f31f1..389e4987 100644 --- a/BlueMapCommon/build.gradle.kts +++ b/BlueMapCommon/build.gradle.kts @@ -70,12 +70,14 @@ tasks.test { useJUnitPlatform() } -tasks.register("buildWebapp", type = NpmTask::class) { +tasks.clean { doFirst { if (!file("webapp/dist/").deleteRecursively()) throw IOException("Failed to delete build directory!") } +} +tasks.register("buildWebapp", type = NpmTask::class) { dependsOn ("npmInstall") args.set(listOf("run", "build")) @@ -89,7 +91,6 @@ tasks.register("zipWebapp", type = Zip::class) { archiveFileName.set("webapp.zip") destinationDirectory.set(file("src/main/resources/de/bluecolored/bluemap/")) - //outputs.upToDateWhen { false } inputs.dir("webapp/dist/") outputs.file("src/main/resources/de/bluecolored/bluemap/webapp.zip") }