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