Skip to content

Commit

Permalink
Only pass the short name to native image args
Browse files Browse the repository at this point in the history
  • Loading branch information
melix committed Feb 4, 2022
1 parent c4be4d7 commit cae55ba
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ protected Provider<String> getGraalVMHome() {
return graalvmHomeProvider;
}

@Internal
public Provider<String> getExecutableShortName() {
return getOptions().flatMap(NativeImageOptions::getImageName);
}

@Internal
public Provider<String> getExecutableName() {
return getOptions().flatMap(options -> options.getImageName().map(name -> name + EXECUTABLE_EXTENSION));
Expand Down Expand Up @@ -151,7 +156,7 @@ private List<String> buildActualCommandLineArgs() {
return new NativeImageCommandLineProvider(
getOptions(),
getAgentEnabled(),
getExecutableName(),
getExecutableShortName(),
// Can't use getOutputDirectory().map(...) because Gradle would complain that we use
// a mapped value before the task was called, when we are actually calling it...
getProviders().provider(() -> getOutputDirectory().getAsFile().get().getAbsolutePath()),
Expand Down

0 comments on commit cae55ba

Please sign in to comment.