diff --git a/build.gradle b/build.gradle index a8d0b7d221..0014993725 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,9 @@ +import org.apache.tools.ant.taskdefs.condition.Os + +plugins { + id "com.github.johnrengelman.shadow" version "1.1.2" +} + apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'application' @@ -41,4 +47,17 @@ dependencies { testCompile 'org.mockito:mockito-all:1.9.5' } +task packageNative(type:Exec, dependsOn:shadowJar) { + if (Os.isFamily(Os.FAMILY_MAC)) + executable "${project.rootDir}/package/mac.sh" + else if (Os.isFamily(Os.FAMILY_UNIX)) + executable "${project.rootDir}/package/linux.sh" + else if (Os.isFamily(Os.FAMILY_WINDOWS)) + executable "${project.rootDir}/package/windows.bat" + else + throw new GradleException("Unsupported OS: " + System.properties['os.name']) + + args project.version, shadowJar.archivePath, mainClassName +} + wrapper.gradleVersion = '2.1' diff --git a/package/linux.sh b/package/linux.sh new file mode 100755 index 0000000000..5b32e45b48 --- /dev/null +++ b/package/linux.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +version=$1 +jar=$2 +mainClass=$3 + +javapackager -deploy \ + -BappVersion=$version \ + -Bcategory=Finance \ + -BlicenseType=GPLv3 \ + -Bemail=info@bitsquare.io \ + -native deb \ + -name Bitsquare \ + -title Bitsquare \ + -vendor Bitsquare \ + -outdir build \ + -appclass $mainClass \ + -srcfiles $jar \ + -outfile Bitsquare + +# -Bicon=client/icons/icon.png \ diff --git a/package/mac.sh b/package/mac.sh new file mode 100755 index 0000000000..e4397f99b5 --- /dev/null +++ b/package/mac.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +version=$1 +jar=$2 +mainClass=$3 + +javapackager \ + -deploy \ + -BappVersion=$version \ + -Bmac.CFBundleIdentifier=bitsquare \ + -Bmac.CFBundleName=Bitsquare \ + -Bruntime="$JAVA_HOME/../../" \ + -native dmg \ + -name Bitsquare \ + -title Bitsquare \ + -vendor Bitsquare \ + -outdir build \ + -srcfiles $jar \ + -appclass $mainClass \ + -outfile Bitsquare + +#-Bicon=client/icons/mac.icns \ diff --git a/package/msvcp100.dll b/package/msvcp100.dll new file mode 100644 index 0000000000..68fa0d31ad Binary files /dev/null and b/package/msvcp100.dll differ diff --git a/package/msvcr100.dll b/package/msvcr100.dll new file mode 100644 index 0000000000..b1c3a5e77c Binary files /dev/null and b/package/msvcr100.dll differ diff --git a/package/windows.bat b/package/windows.bat new file mode 100644 index 0000000000..d8d92fed10 --- /dev/null +++ b/package/windows.bat @@ -0,0 +1 @@ +C:\Progra~1\Java\jdk1.8.0_20\bin\javapackager.exe -deploy -BappVersion=0.1.0 -native exe -name Bitsquare -title Bitsquare -vendor Bitsquare -outdir build -appclass io.bitsquare.BitSquare -srcfiles .\build\libs\bitsquare-0.1.0-SNAPSHOT-all.jar -outfile Bitsquare -Bruntime="c:\Program Files\Java\jdk1.8.0_20\jre"