From bf7e46d1d5b32dee74d5df9960b25aad1204ae12 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Thu, 28 Aug 2014 13:39:01 +0200 Subject: [PATCH] Add Gradle OneJar plugin For creation of a self-contained executable jar. Run: - `./gradle executableJar` - `java -jar ./build/libs/bitsquare.jar Note that actually executing the jar fails with an exception from io.bitsquare.util.AppDirectoryUtil.createDirIfNotExists. This will be fixed later. The purpose of this commit is only to establish the executable jar infrastructure. --- build.gradle | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.gradle b/build.gradle index 3dcdaa15f7..07525cda94 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,15 @@ +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.github.rholder:gradle-one-jar:1.0.4' + } +} + apply plugin: 'java' apply plugin: 'application' +apply plugin: 'gradle-one-jar' version = '0.1.0-SNAPSHOT' sourceCompatibility = 1.8 @@ -7,6 +17,11 @@ mainClassName = 'io.bitsquare.BitSquare' sourceSets.main.resources.srcDirs += 'src/main/java' +task executableJar(type: OneJar) { + mainClass = project.mainClassName + archiveName = 'bitsquare.jar' +} + repositories { jcenter() mavenLocal()