From 68182a9a23f52eef085d3dc2bc5a6aea8ffee669 Mon Sep 17 00:00:00 2001 From: stephengold Date: Thu, 12 Sep 2024 14:26:22 -0700 Subject: [PATCH] build.gradle.kts: register cleanup tasks --- build.gradle.kts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 09cc687..6ba80d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -54,3 +54,21 @@ dependencies { implementation(libs.jsnaploader) } + +// Register cleanup tasks: + +tasks.named("clean") { + dependsOn("cleanDLLs", "cleanDyLibs", "cleanLogs", "cleanSOs") +} +tasks.register("cleanDLLs") { // extracted Windows native libraries + delete(fileTree(".").matching{ include("*.dll") }) +} +tasks.register("cleanDyLibs") { // extracted macOS native libraries + delete(fileTree(".").matching{ include("*.dylib") }) +} +tasks.register("cleanLogs") { // JVM crash logs + delete(fileTree(".").matching{ include("hs_err_pid*.log") }) +} +tasks.register("cleanSOs") { // extracted Linux and Android native libraries + delete(fileTree(".").matching{ include("*.so") }) +}