Skip to content

Commit

Permalink
Do not require mainClass and moduleName to be set in secondaryLauncher (
Browse files Browse the repository at this point in the history
  • Loading branch information
airsquared committed Sep 24, 2023
1 parent 2c0289b commit 58a2536
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class SecondaryLauncherData extends LauncherData {

@CompileDynamic
void check() {
["name", "moduleName", "mainClass"].each {
if(!this."$it") throw new GradleException("Property '$it' not set in 'secondaryLauncher' block")
if (!this.name) {
throw new GradleException("Property 'name' not set in 'secondaryLauncher' block")
}
}
}
4 changes: 3 additions & 1 deletion src/main/groovy/org/beryx/jlink/impl/JlinkTaskImpl.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ class JlinkTaskImpl extends BaseTaskImpl<JlinkTaskData> {
def generator = new LaunchScriptGenerator(project, td.moduleName, td.mainClass, td.launcherData)
generator.generate("$imageDir/bin")
td.secondaryLaunchers.each { launcher ->
def secondaryGenerator = new LaunchScriptGenerator(project, launcher.moduleName, launcher.mainClass, launcher)
def moduleName = launcher.moduleName ? launcher.moduleName : td.moduleName
def mainClass = launcher.mainClass ? launcher.mainClass : td.mainClass
def secondaryGenerator = new LaunchScriptGenerator(project, moduleName, mainClass, launcher)
secondaryGenerator.generate("$imageDir/bin")
}
}
Expand Down

0 comments on commit 58a2536

Please sign in to comment.