mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 20:36:44 +00:00
detect and configure build for headless environments
This commit is contained in:
parent
f3b0d37c54
commit
b2d85b6c78
1 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import java.awt.GraphicsEnvironment
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'application'
|
id 'application'
|
||||||
id 'org-openjfx-javafxplugin'
|
id 'org-openjfx-javafxplugin'
|
||||||
|
@ -17,6 +19,7 @@ if(System.getProperty("os.arch") == "aarch64") {
|
||||||
osArch = "aarch64"
|
osArch = "aarch64"
|
||||||
targetName = "-" + osArch
|
targetName = "-" + osArch
|
||||||
}
|
}
|
||||||
|
def headless = GraphicsEnvironment.isHeadless()
|
||||||
|
|
||||||
group "com.sparrowwallet"
|
group "com.sparrowwallet"
|
||||||
version "${sparrowVersion}"
|
version "${sparrowVersion}"
|
||||||
|
@ -159,6 +162,9 @@ run {
|
||||||
applicationDefaultJvmArgs += ["-Dprism.lcdtext=false", "-Xdock:name=Sparrow", "-Xdock:icon=/Users/scy/git/sparrow/src/main/resources/sparrow-large.png",
|
applicationDefaultJvmArgs += ["-Dprism.lcdtext=false", "-Xdock:name=Sparrow", "-Xdock:icon=/Users/scy/git/sparrow/src/main/resources/sparrow-large.png",
|
||||||
"--add-opens=javafx.graphics/com.sun.glass.ui.mac=centerdevice.nsmenufx"]
|
"--add-opens=javafx.graphics/com.sun.glass.ui.mac=centerdevice.nsmenufx"]
|
||||||
}
|
}
|
||||||
|
if(headless) {
|
||||||
|
applicationDefaultJvmArgs += ["-Dglass.platform=Monocle", "-Dmonocle.platform=Headless", "-Dprism.order=sw"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jlink {
|
jlink {
|
||||||
|
@ -211,6 +217,9 @@ jlink {
|
||||||
if(os.macOsX) {
|
if(os.macOsX) {
|
||||||
jvmArgs += ["-Dprism.lcdtext=false", "--add-opens=javafx.graphics/com.sun.glass.ui.mac=com.sparrowwallet.merged.module"]
|
jvmArgs += ["-Dprism.lcdtext=false", "--add-opens=javafx.graphics/com.sun.glass.ui.mac=com.sparrowwallet.merged.module"]
|
||||||
}
|
}
|
||||||
|
if(headless) {
|
||||||
|
jvmArgs += ["-Dglass.platform=Monocle", "-Dmonocle.platform=Headless", "-Dprism.order=sw"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
addExtraDependencies("javafx")
|
addExtraDependencies("javafx")
|
||||||
jpackage {
|
jpackage {
|
||||||
|
|
Loading…
Reference in a new issue