-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
165 lines (146 loc) · 6.58 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.13'
id 'org.beryx.runtime' version '1.12.7'
id 'de.fuerstenau.buildconfig' version '1.1.8'
}
mainClassName = 'HUPPAAL'
allprojects {
group = 'dk.cs.aau.huppaal'
version = '1.4.0'
}
def getGitCommitSha = { ->
try (def stdout = new ByteArrayOutputStream()) {
exec {
commandLine 'git', 'describe','--long','--always','--dirty','--exclude=*','--abbrev=8'
standardOutput = stdout
}
return stdout.toString().trim()
}
}
def getGitCommitShaLong = { ->
try (def stdout = new ByteArrayOutputStream()) {
exec {
commandLine 'git', 'describe','--long','--always','--exclude=*','--abbrev=40'
standardOutput = stdout
}
return stdout.toString().trim()
}
}
buildConfig {
appName = project.name
version = project.version
buildConfigField('String', 'COMMIT_SHA', "${getGitCommitShaLong()}")
buildConfigField('String', 'COMMIT_SHA_SHORT', "${getGitCommitSha()}")
clsName = 'BuildConfig'
packageName = 'dk.cs.aau.huppaal'
charset = 'UTF-8'
}
configurations {
create("compile")
}
java {
sourceCompatibility = gradle.ext.javaVersion
targetCompatibility = gradle.ext.javaVersion
}
javafx {
version = '19'
modules = ['javafx.controls',
'javafx.fxml',
'javafx.graphics',
'javafx.base']
}
// This list of "allowed" illegal reflection access definitions originates from jfoenix in this github issue:
// https://github.com/sshahine/JFoenix/issues/1200#issuecomment-828541961
// It's been edited to remove duplicate lines and to add consistency. Most of these generate a warning at runtime
// that the mentioned module is unknown, but I'm keeping these until jfoenix starts fixing their awful codebase.
def reflectionHack = [
"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED",
"--add-opens=java.base/java.lang.reflect=com.jfoenix",
"--add-opens=javafx.controls/javafx.scene.control.skin=ALL-UNNAMED",
"--add-opens=javafx.controls/javafx.scene.control.skin=com.jfoenix",
"--add-exports=java.base/java.lang.reflect=ALL-UNNAMED",
"--add-exports=java.base/java.lang.reflect=com.jfoenix",
"--add-exports=javafx.base/com.sun.javafx.binding=ALL-UNNAMED",
"--add-exports=javafx.base/com.sun.javafx.binding=com.jfoenix",
"--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED",
"--add-exports=javafx.base/com.sun.javafx.event=com.jfoenix",
"--add-exports=javafx.controls/com.Sun.javafx.scene.control.behavior=ALL-UNNAMED",
"--add-exports=javafx.controls/com.Sun.javafx.scene.control.behavior=com.jfoenix",
"--add-exports=javafx.controls/com.sun.javafx.binding=ALL-UNNAMED",
"--add-exports=javafx.controls/com.sun.javafx.binding=com.jfoenix",
"--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED",
"--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix",
"--add-exports=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
"--add-exports=javafx.controls/com.sun.javafx.scene.control=com.jfoenix",
"--add-exports=javafx.controls/javafx.scene.control.skin=ALL-UNNAMED",
"--add-exports=javafx.controls/javafx.scene.control.skin=com.jfoenix",
"--add-exports=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.scene=com.jfoenix",
"--add-exports=javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.stage=com.jfoenix",
]
application {
applicationDefaultJvmArgs = ['-XX:+UseZGC'] + reflectionHack
}
runtime {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
noConsole = true
}
jpackage {
// Uncomment and adjust the following line if your runtime task is configured to generate images for multiple platforms
// targetPlatformName = "mac"
def currentOs = org.gradle.internal.os.OperatingSystem.current()
def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png'
imageOptions += ['--icon', "src/main/resources/huppaal.$imgType"]
installerOptions += ['--resource-dir', "src/main/resources"]
installerOptions += ['--vendor', 'Aalborg University']
if (currentOs.windows) {
installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut']
} else if (currentOs.linux) {
installerOptions += ['--linux-package-name', 'huppaal', '--linux-shortcut']
} else if (currentOs.macOsX) {
installerOptions += ['--mac-package-name', 'huppaal']
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/resources']
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation group: 'com.jfoenix', name: 'jfoenix', version: '9.0.10'
implementation group: 'de.codecentric.centerdevice', name: 'javafxsvg', version: '1.3.0'
implementation group: 'com.github.jiconfont', name: 'jiconfont-javafx', version: '1.0.0'
implementation group: 'com.github.jiconfont', name: 'jiconfont-google_material_design_icons', version: '2.2.0.2'
implementation group: 'org.kordamp.ikonli', name: 'ikonli-core', version: '12.3.1'
implementation group: 'org.kordamp.ikonli', name: 'ikonli-material-pack', version: '12.3.1'
implementation group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: '12.3.1'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10'
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre'
implementation group: 'org.hildan.fxgson', name: 'fx-gson', version: '4.1.0'
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.11.0'
implementation group: 'org.openjfx', name: 'javafx', version: '19'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: '19'
implementation group: 'org.openjfx', name: 'javafx-controls', version: '19'
implementation group: 'org.openjfx', name: 'javafx-base', version: '19'
//Junit
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.0'
testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.9.0'
}
test {
useJUnitPlatform()
}