Skip to content

Commit f29ffa2

Browse files
committed
Have JavaFX Artifacts be appended with the system architecture
1 parent d05aba8 commit f29ffa2

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

build.gradle

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ plugins {
1515
}
1616
apply plugin: 'nebula-aggregate-javadocs'
1717

18-
1918
allprojects {
2019
apply plugin: 'java'
2120
apply plugin: 'application'
@@ -78,6 +77,7 @@ allprojects {
7877
}
7978

8079
def os = osdetector.classifier.replace("osx", "macosx").replace("windows-x86_32", "windows-x86")
80+
def arch = osdetector.arch.replace("x86_64", "x64")
8181

8282
project(":core") {
8383
apply plugin: 'java'
@@ -227,6 +227,18 @@ project(":ui") {
227227
jvmArgs = ["-XX:-OmitStackTraceInFastThrow"]
228228
}
229229
mainClassName = javafx.mainClass
230+
231+
// The JavaFX plugin does not provide a way to change the installer artifact's name without changing the appName or appID,
232+
// so instead, we simply rename the artifact to append the architecture (x86 or x64)
233+
jfxDeploy.doLast {
234+
def filet = fileTree(dir: 'build/distributions', include: "${javafx.appName}-${version}.*")
235+
println filet
236+
filet.each { File f ->
237+
def f2 = new File(f.getParentFile(), "${f.getName().replace("${version}", "${version}-${arch}")}")
238+
println f2.getAbsolutePath()
239+
f.renameTo(f2)
240+
}
241+
}
230242
}
231243

232244
/*

0 commit comments

Comments
 (0)