Skip to content

Commit c5176d6

Browse files
committed
Use applicationName as the first fallback for both imageName and installerName.
applicationName is intended to be the display name of the application, so it makes sense for this to be used by default. Intended to fix beryx#127 but needs testing on macOS to be absolutely certain.
1 parent 029f609 commit c5176d6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

doc/user_guide.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ imageOutputDir:: the directory passed as argument to the `--output` option when
316316
_usage example_: `imageOutputDir = file("$buildDir/my-packaging-image")`
317317

318318
imageName:: the argument passed to the `--name` option when running `jpackage` to create an application image. +
319-
_defaultValue_: `_project.name_` +
319+
_defaultValue_: the `applicationName` configured for the `application` plugin, then `_project.name_` +
320320
_usage example_: `imageName = "MyApp"`
321321

322322
imageOptions:: list of additional options to be passed to the `jpackage` executable when creating the appliction image. +
@@ -340,7 +340,7 @@ installerOutputDir:: the directory passed as argument to the `--output` option w
340340
_usage example_: `installerOutputDir = file("$buildDir/my-packaging-installer")`
341341

342342
installerName:: the argument passed to the `--name` option when running `jpackage` to create an application installer. +
343-
_defaultValue_: `_project.name_` +
343+
_defaultValue_: the `applicationName` configured for the `application` plugin, then `_project.name_` +
344344
_usage example_: `installerName = "MyApp"`
345345

346346
jvmArgs:: list of JVM arguments to be passed to the virtual machine. +

src/main/groovy/org/beryx/runtime/data/JPackageData.groovy

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.beryx.runtime.data
1717

1818
import org.beryx.runtime.util.Util
19+
import org.gradle.api.plugins.JavaApplication
1920
import org.gradle.api.tasks.Internal
2021

2122
import static org.beryx.runtime.util.Util.EXEC_EXTENSION
@@ -106,14 +107,19 @@ class JPackageData {
106107
String getMainClassOrDefault() {
107108
this.@mainClass ?: Util.getMainClass(project)
108109
}
110+
109111
@Input
110112
String getImageNameOrDefault() {
111-
this.@imageName ?: project.name
113+
this.@imageName
114+
?: project.extensions.getByType(JavaApplication).applicationName
115+
?: project.name
112116
}
113117

114118
@Input
115119
String getInstallerNameOrDefault() {
116-
this.@installerName ?: project.name
120+
this.@installerName
121+
?: project.extensions.getByType(JavaApplication).applicationName
122+
?: project.name
117123
}
118124

119125
@OutputDirectory

0 commit comments

Comments
 (0)