From: AsamK Date: Wed, 27 Oct 2021 18:59:02 +0000 (+0200) Subject: Add fatJar gradle task to create a single executable jar file X-Git-Tag: v0.10.0~101 X-Git-Url: https://git.nmode.ca/signal-cli/commitdiff_plain/f8841757482485336005d3b4f15c8c8c17a2e731?hp=1fae09433d79ede67febe3257abf1f1dbd2146e6 Add fatJar gradle task to create a single executable jar file --- diff --git a/README.md b/README.md index b041b4a0..67bbb75a 100644 --- 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" diff --git a/build.gradle.kts b/build.gradle.kts index 481f2668..eb4b18fa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -65,3 +65,17 @@ tasks.withType { ) } } + +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) +}