-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
83 lines (73 loc) · 2 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
77
78
79
80
81
82
83
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'io.github.fvarrui:javapackager:1.7.2'
}
}
apply plugin: 'application'
apply plugin: 'io.github.fvarrui.javapackager.plugin'
repositories {
mavenCentral()
}
dependencies {
implementation 'com.github.trilarion:java-vorbis-support:1.2.1'
implementation 'com.thoughtworks.xstream:xstream:1.4.16'
implementation 'org.beanshell:bsh:2.0b5'
}
application {
mainClass.set('org.spicetrade.Game')
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs.addAll(["-Xlint:unchecked", "-Xlint:deprecation"])
}
tasks.withType(Jar) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
jar {
manifest {
attributes (
'Built-By': 'Taher Alkhateeb',
'Main-Class': 'org.spicetrade.Game',
'Implementation-Title': 'Spice Trade',
'Implementation-Version': '2.0',
'Implementation-Vendor': 'pythys.com',
'Implementation-URL': 'https://www.pythys.com'
)
}
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
javapackager {
mainClass = application.mainClass.get()
bundleJre = true
generateInstaller = true
}
task copyProps(type: Copy) {
from 'spicetrade.properties'
into 'build/spicetrade'
}
task packageLinux(type: io.github.fvarrui.javapackager.gradle.PackageTask) {
dependsOn build
platform = 'linux'
createTarball = true
jrePath = file(System.properties['java.home'])
finalizedBy copyProps
}
task packageMac(type: io.github.fvarrui.javapackager.gradle.PackageTask) {
dependsOn build
platform = 'mac'
createTarball = true
finalizedBy copyProps
}
task packageWindows(type: io.github.fvarrui.javapackager.gradle.PackageTask) {
dependsOn build
platform = 'windows'
createZipball = true
finalizedBy copyProps
}
task packageAll(dependsOn: [ packageLinux, packageMac, packageWindows ])