FXLauncher Gradle Plugin
See usage example in the fxldemo-gradle demo project
The plugin supports the following tasks:
- copyAppDependencies: Assembles the application into
build/fxlauncher
- generateApplicationManifest: Generates app.xml into
build/fxlauncher
- embedApplicationManifest: Copies app.xml into
fxlauncher.jar
- deployApp: Transfers application to
deployTarget
via scp - generateNativeInstaller: Generates a native installer
Configuration example:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'no.tornado:fxlauncher-gradle-plugin:1.0.21'
}
}
apply plugin: 'no.tornado.fxlauncher'
fxlauncher {
applicationVendor 'My Company'
applicationUrl 'http://host/path'
applicationMainClass 'com.example.Application'
deployTarget 'username@hostname:path'
}
Please note that the deployApp
task requires the scp binary to be present in your path, and that you have installed the corresponding target host key locally and the public key on the target
The deployTarget
option also accepts deploying to local file system paths, for example: C:/some/path
.
Optionally include scpOptions = ["-v"]
to enable verbose output from scp if you run into trouble.
What's new file
Supply whatsNew https://whatsnew/url
to include an HTML link that will be shown to the user after update.
Optional parameters
If you need to further customize the parameters to javapackager
you can supply the javapackagerOptions
parameter, which takes a List<String>
. Consult the JavaPackager docs for more information about possible parameters.
Use javapackerNativeParam
to supply arguments to javapackager -native
flag such as msi
or dep
in order to generate native installer packages instead of MSI.
User interface customization
You can change how the FXLauncher's user interface looks when it's updating the app.
Update Text
Actual Text
To change the default "Updating..." text, add something like updateText 'Updating CoolApp...'
to the fxlauncher section of your build.gradle file.
Text Style
To style the update text, add something like updateLabelStyle '-fx-underline: true;'
to the fxlauncher section of your build.gradle file. You can use any valid CSS rule that applies to a Labeled. Here's the list for Labeled, but don't forget about the rules for its parents, Control, Region, Parent, and Node.
Progress Bar
To style the progress bar, add something like progressBarStyle '-fx-accent: lime;'
to the fxlauncher section of your build.gradle file. (Hint: -fx-accent
happens to be the rule that controls the progress bar's color. See java's modena.css as well as this StackOverflow question)
Text and Bar Wrapper
There's a VBox around everything. To style it, add something like -fx-spacing: 20;
to the fxlauncher section of your build.gradle file. You can use any valid CSS rule that applies to a VBox. Here's the list for VBox, but don't forget about the rules for its parents, Pane, Region, Parent, and Node.
Keep update screen until primary stage is shown, even if update is completed
lingeringUpdateScreen true