Skip to content

Commit 00d23b3

Browse files
authored
Update build.gradle environment for OpenJFX
OpenJFX requires these additions to guarantee an appropriate build environment.
1 parent 49f9bb4 commit 00d23b3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

build.gradle

+18
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dependencies {
3838
implementation 'com.opencsv:opencsv:5.7.1'
3939

4040
// Wayland
41+
implementation platform('org.openjfx:javafx-bom:19') // Use BOM for version consistency
4142
implementation 'org.openjfx:javafx-controls:19' // Core OpenJFX controls
4243
implementation 'org.openjfx:javafx-graphics:19' // Essential for graphics rendering
4344

@@ -108,5 +109,22 @@ task copyStartScript(type: Copy) {
108109
include "${rootProject.name}-admin.bat"
109110
}
110111

112+
// Configure the Java execution environment to include OpenJFX modules
113+
tasks.withType<JavaExec> {
114+
doFirst {
115+
// Assuming your project has a "src/main/resources" directory for configuration files
116+
// Adjust this path if needed
117+
def modulePath = file("${projectDir}/src/main/resources/module-path")
118+
119+
if (!modulePath.exists()) {
120+
// Create the module-path file if it doesn't exist
121+
modulePath.createNewFile()
122+
123+
// Add OpenJFX modules to the module path
124+
modulePath.appendText("${configurations.runtimeClasspath.asPath.replace(':', ';')}") // Use ; as a separator on Windows
125+
}
126+
}
127+
}
128+
111129
task dist(dependsOn: ['copyJar', 'copyTessdata', 'copyStartScript', 'jlink']) {
112130
}

0 commit comments

Comments
 (0)