]> nmode's Git Repositories - signal-cli/commitdiff
Add fatJar gradle task to create a single executable jar file
authorAsamK <asamk@gmx.de>
Wed, 27 Oct 2021 18:59:02 +0000 (20:59 +0200)
committerAsamK <asamk@gmx.de>
Wed, 27 Oct 2021 18:59:02 +0000 (20:59 +0200)
README.md
build.gradle.kts

index b041b4a087d26331c5f482384dfe86243ffa8350..67bbb75ae955d25771e54d1c099fec73213e55ff 100644 (file)
--- a/README.md
+++ b/README.md
@@ -81,15 +81,19 @@ dependencies. If you have a recent gradle version installed, you can replace `./
 
         ./gradlew build
 
-    3a. Create shell wrapper in *build/install/signal-cli/bin*:
+    2a. Create shell wrapper in *build/install/signal-cli/bin*:
 
         ./gradlew installDist
 
-    3b. Create tar file in *build/distributions*:
+    2b. Create tar file in *build/distributions*:
 
         ./gradlew distTar
 
-    3c. Compile and run signal-cli:
+    2c. Create a fat tar file in *build/libs/signal-cli-fat*:
+
+        ./gradlew fatJar
+
+    2d. Compile and run signal-cli:
 
         ./gradlew run --args="--help"
 
index 481f2668ba1f576d846cbdc3a5104eeb11d84bbc..eb4b18fafc56d0b9b166d4e35b5053b3f8dc22bc 100644 (file)
@@ -65,3 +65,17 @@ tasks.withType<Jar> {
         )
     }
 }
+
+task("fatJar", type = Jar::class) {
+    archiveBaseName.set("${project.name}-fat")
+    exclude(
+        "META-INF/*.SF",
+        "META-INF/*.DSA",
+        "META-INF/*.RSA",
+        "META-INF/NOTICE",
+        "META-INF/LICENSE",
+        "**/module-info.class"
+    )
+    from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
+    with(tasks.jar.get() as CopySpec)
+}