From ba54376c1b33b7c54525aa27d3e0217dbcf5c67d Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Sun, 13 Oct 2013 18:52:27 +0200 Subject: [PATCH] "gradle uberjar" to create a fat jar with all dependencies This way, Dahu can be ran with java -jar build/libs/Dahu-0.1-SNAPSHOT.jar The bundles generated by "gradle build" are supposedly superior, but just don't work for me. --- editor/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/editor/build.gradle b/editor/build.gradle index 7a61b2d..97e7d4a 100644 --- a/editor/build.gradle +++ b/editor/build.gradle @@ -136,3 +136,11 @@ javafx { scale = 1 } } + +/* "gradle uberjar" makes a jar with all dependencies in */ +task uberjar(type: Jar) { + dependsOn configurations.runtime + manifest.attributes('Main-Class': 'io.dahuapp.editor.app.DahuApp') + from sourceSets.main.output + from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } } +}