Only rebuild webapp if clean-build or there were changes

This commit is contained in:
Lukas Rieger (Blue) 2024-05-21 22:23:57 +02:00
parent d77d90c658
commit 3faf2f0135
No known key found for this signature in database
GPG Key ID: AA33883B1BBA03E6

View File

@ -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")
}