Skip to content

Instantly share code, notes, and snippets.

@marco-primiceri
Created March 16, 2018 10:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marco-primiceri/9ea0692e1baf7fb6a3ec64730b61ebf2 to your computer and use it in GitHub Desktop.
Save marco-primiceri/9ea0692e1baf7fb6a3ec64730b61ebf2 to your computer and use it in GitHub Desktop.
DMG packaging of JavaFX application written in Kotlin (and powered by Spring Boot) using "javafx-gradle-plugin"
buildscript {
ext {
kotlinVersion = "1.2.21"
springBootVersion = "1.5.10.RELEASE"
javafxGradlePluginVersion = "8.8.0"
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-noarg:$kotlinVersion")
classpath("de.dynamicfiles.projects.gradle.plugins:javafx-gradle-plugin:$javafxGradlePluginVersion")
}
}
apply plugin: "kotlin"
apply plugin: "kotlin-spring"
apply plugin: "idea"
apply plugin: "java"
apply plugin: "org.springframework.boot"
apply plugin: "javafx-gradle-plugin"
group = "com.companyname"
version = "1.0.0"
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
repositories {
mavenCentral()
}
dependencies {
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
compile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
compile("org.springframework.boot:spring-boot-starter")
compile("javax.inject:javax.inject:1")
compile("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2")
compile("org.apache.httpcomponents:httpclient:4.5.5")
compile("org.controlsfx:controlsfx:8.40.14")
compile("org.jsoup:jsoup:1.11.2")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
jfx {
verbose = true
mainClass = "com.companyname.MyApplication"
jfxAppOutputDir = "build/jfx/app"
jfxMainAppJarName = "my-application.jar"
deployDir = "src/main/deploy"
useEnvironmentRelativeExecutables = true
libFolderName = "lib"
// gradle jfxJar
css2bin = false
preLoader = null // String
updateExistingJar = false
allPermissions = false
manifestAttributes = null // Map<String, String>
addPackagerJar = true
copyAdditionalAppResourcesToJar = false
skipCopyingDependencies = false
useLibFolderContentForManifestClasspath = false
fixedManifestClasspath = null
// gradle jfxNative
identifier = null // String - setting this for windows-bundlers makes it possible to generate upgradeable installers (using same GUID)
vendor = "Company Name"
nativeOutputDir = "build/jfx/native"
bundler = "dmg"
jvmProperties = null // Map<String, String>
jvmArgs = null // List<String>
userJvmArgs = null // Map<String, String>
launcherArguments = null // List<String>
nativeReleaseVersion = "$version"
needShortcut = false
needMenu = false
//bundleArguments = [
//runtime: null, // dont bundle JRE, useful for faster builds during testing
//licenseType: 'ASL 2.0',
//licenseFile: 'LICENSE'
//]
appName = "My Application" // this is used for files below "src/main/deploy", e.g. "src/main/deploy/package/windows/project.ico"
additionalBundlerResources = null // path to some additional resources for the bundlers when creating application-bundle
additionalAppResources = null // path to some additional resources when creating application-bundle
fileAssociations = null // List<Map<String, Object>>
noBlobSigning = false // when using bundler "jnlp", you can choose to NOT use blob signing
customBundlers = null // List<String>
failOnError = true
onlyCustomBundlers = false
skipJNLP = true
skipNativeVersionNumberSanitizing = false // anything than numbers or dots are removed
additionalJarsignerParameters = null // List<String>
skipMainClassScanning = false // set to true might increase build-speed
skipNativeLauncherWorkaround124 = false
skipNativeLauncherWorkaround167 = false
skipNativeLauncherWorkaround205 = false
skipJNLPRessourcePathWorkaround182 = false
skipSigningJarFilesJNLP185 = false
skipSizeRecalculationForJNLP185 = false
skipMacBundlerWorkaround = false
}
@FibreFoX
Copy link

Just some comment about the configuration-flags, the README.md of the project contains the default-values, they are not required to be added when not changed ;) makes the configuration a bit cleaner/smaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment