-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
76 lines (59 loc) · 2.4 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
plugins {
id 'com.stehno.natives' version '0.2.4'
id 'us.kirchmeier.capsule' version '1.0.2'
}
apply plugin: 'java'
apply plugin: 'application'
group 'com.github.tgstation'
version '0.7.4'
def javaLevel = 1.8
def mainClass = 'com.github.tgstation.fastdmm.FastDMM'
def nativePaths = ['windows', 'linux', 'osx'].collect { 'build/natives/' + it }
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
compile group: 'com.github.leonbloy', name: 'pngj', version: '-SNAPSHOT'
compile group: 'com.google.guava', name: 'guava', version: '19.0'
compile group: 'jline', name: 'jline', version: '2.12.1'
compile group: 'org.lwjgl.lwjgl', name: 'lwjgl', version: '2.9.3'
compile group: 'org.lwjgl.lwjgl', name: 'lwjgl_util', version: '2.9.3'
compile group: 'org.json', name: 'json', version: '20160810'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
compile group: 'commons-io', name:'commons-io', version:'+'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.16.10'
compile group: 'junit', name: 'junit', version: '4.11'
}
natives {
jars = configurations.compile.files.collect { it.name }.findAll { it ==~ /.*-natives-.*/ }
}
run {
mainClassName = mainClass
systemProperty 'java.library.path', files(nativePaths).asPath
}
// Set the correct java version.
sourceCompatibility = targetCompatibility = javaLevel
// Ensure capsule works when people have weird java installations.
def minimumJavaVersion = javaLevel + '.0'
// Ensure that the natives are unpacked when someone tries to run "gradlew run"
tasks.run.dependsOn(unpackNatives)
// Below is the configuration that handles the far jar.
configurations { fatCapsule }
dependencies { fatCapsule 'co.paralleluniverse:capsule:0.10.1-SNAPSHOT' }
task fatCapsule(type: FatCapsule, dependsOn: [jar, unpackNatives]) {
capsuleConfiguration = configurations.fatCapsule
// Application jar is embedded through applicationSource default value
applicationClass mainClassName
// Embed application dependencies
embedConfiguration = configurations.runtime { exclude '*-natives-*' }
// Copy native libraries to capsule root
from(nativePaths)
capsuleManifest {
minJavaVersion = minimumJavaVersion
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}