forked from jperedadnr/RubikFX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
129 lines (110 loc) · 3.75 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
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'com.gluonhq.gluonfx-gradle-plugin' version '1.0.22'
id 'org.beryx.jlink' version '3.0.1'
}
tasks.wrapper {
gradleVersion = '8.5'
distributionType = Wrapper.DistributionType.ALL
}
group = 'com.jpl.games'
version = '1.0.0-SNAPSHOT'
ext {
mainClassName = 'com.jpl.games.RubikFX'
mainModuleName = 'rubikfx'
launcherClassName = 'com.jpl.games.Launcher'
javafxVersion = '21.0.1'
currentPlatform = javafx.platform.classifier
}
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']
}
dependencies {
implementation('org.fxyz3d:fxyz3d-importers:0.5.4') {
exclude group: 'org.openjfx', module: '*'
}
}
jar {
manifest {
attributes(
'Main-Class': project.mainClassName,
'JavaFX-Version': javafxVersion,
'Built-By': System.getProperty('user.name'),
'Created-By': System.getProperty('java.runtime.version') + ' (' + System.getProperty('java.vendor') + ')',
'Gradle-Version': 'Gradle ' + gradle.getGradleVersion(),
)
}
}
application {
mainClass = project.mainClassName
mainModule = project.mainModuleName
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 + '-' + currentPlatform
run {
//use the following jvmArgs for as many different run scenarios as possible,
//and for all the code-execution paths as much as possible,
//to generate (or merge with) the GraalVM native-image configuration files
//in the src/graal-cfg/<currentPlatform>/META-INF/native-image directory.
//This directory is used by GraalVM during the native-image build.
//jvmArgs = ["-agentlib:native-image-agent=config-merge-dir=src/graal-cfg/$currentPlatform/META-INF/native-image"]
//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 in current OS platform
task uberJar(type: Jar) {
with jar
archiveClassifier = "no-deps-$currentPlatform"
manifest {
attributes(
'Main-Class': project.launcherClassName,
'JavaFX-Version': javafxVersion,
'Built-By': System.getProperty('user.name'),
'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'
}
gluonfx {
compilerArgs = [
'--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED',
'-H:+TraceNativeToolUsage',
]
//enable support for software acceleration
enableSwRendering = true
//extra packages/classes to be included in the native image
reflectionList = [
'com.sun.prism.shader.Solid_TextureRGB_AlphaTest_Loader',
'com.sun.prism.shader.Solid_TextureSecondPassLCD_AlphaTest_Loader',
]
}
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = project.mainModuleName
}
}