-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
98 lines (83 loc) · 2.59 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
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.13' //requires JDK11+
id 'org.beryx.jlink' version '2.25.0'
}
wrapper {
gradleVersion = '7.4.2'
distributionType = Wrapper.DistributionType.ALL
}
group = 'com.javafx.experiments'
version = '1.0.0-SNAPSHOT'
ext {
mainModuleName = 'Viewer3D'
mainClassName = 'com.javafx.experiments.jfx3dviewer.Jfx3dViewerApp'
launcherClassName = 'com.javafx.experiments.jfx3dviewer.Launcher'
javafxVersion = '17.0.2' //requires JDK11+
}
repositories {
mavenCentral()
mavenLocal()
}
compileJava {
options.release = 11 //use JDK11+ for compiling & running
options.encoding = 'UTF-8'
}
javafx {
version = javafxVersion
modules = ['javafx.controls', 'javafx.fxml', 'javafx.swing']
}
jar {
manifest {
attributes(
'Main-Class': project.mainClassName,
'JavaFX-Version': javafxVersion,
'Created-By': System.getProperty('java.runtime.version') + ' (' + System.getProperty('java.vendor') + ')',
'Gradle-Version': 'Gradle ' + gradle.getGradleVersion(),
)
}
}
application {
mainModule = project.mainModuleName
mainClass = project.mainClassName
executableDir = ''
}
//main distribution generated would be platform-specific to the current OS
//hence the distribution's name should reflect that
distributions.main.distributionBaseName = project.name + '-' + javafx.platform.classifier
run {
//args '...'
//get system properties specified from the command line (for debugging, etc.)
//and pass them on to the running application's JVM
systemProperties = System.getProperties()
debugOptions {
enabled = false
port = 5566
server = true
suspend = false
}
}
//make an executable uber jar including all dependencies
//which should work only for current OS platform
task uberJar(type: Jar) {
archiveClassifier = 'no-deps-' + javafx.platform.classifier
with jar
manifest {
attributes(
'Main-Class': project.launcherClassName,
'JavaFX-Version': javafxVersion,
'Created-By': System.getProperty('java.runtime.version') + ' (' + System.getProperty('java.vendor') + ')',
'Gradle-Version': 'Gradle ' + gradle.getGradleVersion(),
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy 'exclude'
}
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = project.mainModuleName
}
}