Skip to content

Commit ccccf5f

Browse files
committed
Merge pull request #423 from JacisNonsense/jfx-arch-1
Have JavaFX Installer Artifacts be appended with the system architecture
2 parents d05aba8 + d4c4433 commit ccccf5f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

build.gradle

Lines changed: 11 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,16 @@ 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+
filet.each { File f ->
236+
def f2 = new File(f.getParentFile(), "${f.getName().replace("${version}", "${version}-${arch}")}")
237+
f.renameTo(f2)
238+
}
239+
}
230240
}
231241

232242
/*

0 commit comments

Comments
 (0)