Skip to content

Commit

Permalink
Pick up javafx-gradle-plugin fix for M1 architecture
Browse files Browse the repository at this point in the history
Problem: until the recent release of JavaFX 17, it was impossible to run
a JavaFX app on an M1 Mac without locally installing an early-access
build of JavaFX SDK. Even after the release of JavaFX 17, however, it
was still not possible to run a JavaFX application on an M1 Mac because
of the bug reported at openjfx/javafx-gradle-plugin#112 (which caused
led to the dreaded "No toolkit found" error).

Solution: the PR at openjfx/javafx-gradle-plugin#113 fixes this error in
the javafx-gradle-plugin, but has not yet been released. This commit
assumes that the PR branch as been built and installed on the local
machine, and expects to resolve it from the local maven cache. Happily,
it works as expected, making it possible to run ./bisqfx without the SDK
installed locally.
  • Loading branch information
cbeams committed Nov 16, 2021
1 parent b7423ab commit c743079
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
19 changes: 1 addition & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,7 @@ configure(project(':app:fx')) {
}

javafx {
// customize the application plugin's `run` task to use the correct JavaFX SDK and
// modules; see the beryx runtime plugin's `launcher` closure below for equivalent
// customization of generated start scripts.
if (project.hasProperty(javafxSdkProperty))
sdk = project.getProperty(javafxSdkProperty)
else
version = '16'
version = '17.0.1'
modules = ['javafx.controls']
}

Expand All @@ -207,15 +201,6 @@ configure(project(':app:fx')) {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
noConsole = true
// start scripts created by the application plugin are overwritten by the
// org.beryx.runtime plugin, thus custom settings must be configured here as
// opposed to in the usual `startScripts` closure
if (project.hasProperty(javafxSdkProperty)) {
jvmArgs = [
'--add-modules=javafx.controls',
"--module-path=${project.getProperty(javafxSdkProperty)}/lib"
]
}
}

jpackage {
Expand All @@ -233,8 +218,6 @@ configure(project(':app:fx')) {
installerOptions += ['--linux-package-name', 'bisqfx', '--linux-shortcut']
} else if (osdetector.os == 'osx') {
installerOptions += ['--mac-package-name', 'bisqfx']
if (project.hasProperty(javafxSdkProperty))
jvmArgs += "--module-path=${project.getProperty(javafxSdkProperty)}/lib"
}
}
}
Expand Down
13 changes: 1 addition & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
javafxPluginVersion = 0.0.10
javafxPluginVersion = 0.0.11-SNAPSHOT
gitVersionPluginVersion = 0.12.3
osPluginVersion = 1.7.0
runtimePluginVersion = 1.12.5

requiredJavaVersion = 16
javafxSdkProperty = bisq.javafx.sdk

## Local JavaFX SDK path. Useful when early access builds are required that
## cannot be resolved as normal dependencies by the gradle build.
##
## Do NOT uncomment this property here. Instead, copy it to your personal
## ~/.gradle/gradle.properties file, uncomment and customize it there.
##
# bisq.javafx.sdk=/path/to/javafx-sdk

1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
plugins {
id 'org.openjfx.javafxplugin' version javafxPluginVersion
Expand Down

0 comments on commit c743079

Please sign in to comment.