From 16c0c39906bbb001e18ad250931d0557791c19eb Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Sun, 27 Mar 2022 06:27:31 +0200 Subject: [PATCH] Added fat jar generation --- build.gradle.kts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 82e7d38..2717f73 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,4 +53,26 @@ compose.desktop { packageVersion = "1.0.0" } } +} + + +task("fatJar", type = Jar::class) { + archiveBaseName.set("${project.name}-fat") + + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + + manifest { + attributes["Implementation-Title"] = "Gitnuro" + attributes["Implementation-Version"] = projectVersion + attributes["Main-Class"] = "MainKt" + } + from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) { + exclude( + "META-INF/MANIFEST.MF", + "META-INF/*.SF", + "META-INF/*.DSA", + "META-INF/*.RSA", + ) + } + with(tasks.jar.get() as CopySpec) } \ No newline at end of file