Closed ghost closed 3 years ago
Please try reading these docs carefully You will find a portion with mac specific options... Add those to the installerOptions
in this manner:
if(currentOs.macOsX){
installerOptions += .....
}
Please try reading these docs carefully You will find a portion with mac specific options... Add those to the
installerOptions
in this manner:if(currentOs.macOsX){ installerOptions += ..... }
I saw this docs.
But , I can't find that command for macos.
I saw the command for only linux and windows os.
But , I can't find the cammand for macos.
How can I solve this ?
will this code work ?
if (os.macOsX) {
--installerOptions += ['--mac-package-name', 'hellofxml']
}
Please remove --
before installerOptions
and it must work.. I am not much sure as I have never used MacOS but theoretically,
I feel it must work. You may install a mac on your virtual box using vagrant.
You might not want create a shortcut on OS X, as they aren't used the way they are on Windows. The default value for --mac-package-name should be the application name, so that also might not help you.
If you want to customize the icon, use the --icon option with a .icns file. More customization is available with --resource-dir, which use these default values: https://github.com/openjdk/jdk/tree/master/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources
@larsroe your correct! I apologize for my misconception.
My Build.gradle
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.9'
id 'org.beryx.runtime' version '1.11.3'
}
repositories {
mavenCentral()
}
javafx {
modules = ['javafx.controls', 'javafx.fxml']
}
application {
mainClassName = "org.example.hellofx.Launcher"
applicationName = 'hellofx'
}
runtime {
options = ['--strip-debug', '--compress', '2', '--no-header-
files', '--no-man-pages']
launcher {
noConsole = true
}
jpackage {
def currentOs = org.gradle.internal.os.OperatingSystem.current()
def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png'
imageOptions += ['--icon', "src/main/resources/hellofx.$imgType"]
installerOptions += ['--resource-dir', "src/main/resources"]
installerOptions += ['--vendor', 'Acme Corporation']
if(currentOs.windows) {
installerOptions += ['--win-per-user-install', '--win-dir-
chooser', '--win-menu', '--win-shortcut']
}
if (os.macOsX) {
installerOptions += ['--mac-package-name', 'hellofxml']
}
}
}
I changed my build.gradle file.
will this work?
will this create a shortcut on mac os X?
For windows os. I use this code
For linux os. I use this code
But , How can I create a shortcut for mac ?