-
Notifications
You must be signed in to change notification settings - Fork 20
DSL of setupBuilder
This page describes the task DSL of the main component of the Setup Builder. The setupBuilder
is an extension of the CopySpec
and CopySpecSource
definitions of gradle, thus supporting the source input of them.
Basic Setup Builder options that apply to the setupBuilder
main task and certain sub-areas:
setupBuilder {
vendor = "i-net software GmbH";
copyright = "Copyright © 2019 i-net software GmbH"
description = "This is my application";
// optional, defaults to project name
application = "My Application";
version = "1.0.0";
appIdentifier = "com.application.my";
// optional, defaults to {appIdentifier}-{version}
archiveName = "com.application.my-1.0.0";
icons = "icon-file.icns";
mainClass = "com.application.my.Main";
// main jar file in the installed structure, relative to root.
mainJar = "java/MyApplication.jar";
destinationDir = "";
// optional, define the Java Runtime for the installation. See below
bundleJre = <JRE DEFINITION>;
// optional, a directory in the installed structure (will be created)
bundleJreTarget = "runtime";
// optional, will make the gradle job fail if not CopySpec source is given
failOnEmptyFrom = "true";
}
Extended setupBuilder
task options:
setupBuilder {
// default language of the given resource files.
defaultResourceLanguage = "en";
// the license file with the default language
licenseFile = "path/to/license.txt"
// optional, alternative definition of the license file with specific language
licenseFile {
// language of the license
locale = "de"
// the license file with the given language
resource = "path/to/license-de.txt"
}
// optional, longer description of the application
longDescription = "";
// optional, defines a desktopStarter-like application to run after installation
runAfter { ... }
// optional, defines a desktopStarter-like application to run before uninstallation
runBeforeUninstall { ... }
// optional, defines system services. Multiple definitions allowed.
service { ... }
// optional, create desktop links. Multiple definitions allowed.
desktopStarter { ... }
// List of files to remove before INSTALLATION.
// Relative to installation destiantion.
// Can be used to clean up the installation directory from files
// not created by the setup
deleteFiles = [ "old/file.txt", "old/file2.txt" ];
// alternative syntax with single entry
deleteFiles "old/file.txt"
// List of folders to remove before INSTALLATION. They have to be empty.
deleteFolders = [ "old" ];
// alternative syntax with single entry
deleteFolders "old"
}
The following properties may require further explanation.
The icons
property supports the .png
, .ico
and .icns
formats. Depending on the platform type to build the setup for it will try to genereate either from the other. Since .icns
is most compatible it is recommended to use it.
Bundling a specific java runtime is recommended by Oracle to ensure the application works as expected. The parameter accepts either a version number (e.g. either 1.8 or a "1.8.1") or a file path.
If a version number is given, the Setup Builder will try with standard measures to determine where the runtime is installed and embeds it. Please note: You have to have this runtime installed.
- Windows: Checks the Program Files directory for an installed Java instance with the given number
-
macOS: uses the
/usr/libexec/java_home
tool to determine the home directory of the given version number - Linux: does not apply.
The given path has to be the Java's home directory. It has to exist (and make sense) in the system.
You should check your options with platform specific Java VMs. AdoptOpenJDK offers a wide range of supported versions and platforms.
This is the recommended way.
These options define a specific program that can be launched. It usually has different settings (but the same settings) than the default setupBuilder
offers. Options not explicitly set will be reused from the setupBuilder
definition.
Please have a look at the documentation at of the desktopStarter
.
Services are daemon definition that run the given program in the
These options define a specific program that can be launched. It usually has different settings (but the same settings) than the default setupBuilder
offers. Options not explicitly set will be reused from the setupBuilder
definition.
Please have a look at the documentation at of the service
.