Skip to content

Commit

Permalink
[GR-30629] Native image bash launcher version and vm config #3329.
Browse files Browse the repository at this point in the history
PullRequest: graal/8708
  • Loading branch information
olpaw committed Apr 9, 2021
2 parents f653d2c + 4608618 commit b948546
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ public boolean consume(ArgumentQueue args) {
case "--version":
args.poll();
singleArgumentCheck(args, headArg);
String message = System.getProperty("java.vm.version");
String message;
if (NativeImage.IS_AOT) {
message = System.getProperty("java.vm.version");
} else {
message = "native-image " + NativeImage.graalvmVersion + " " + NativeImage.graalvmConfig;
}
message += " (Java Version " + javaRuntimeVersion + ")";
nativeImage.showMessage(message);
System.exit(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private static String getPlatform() {
}

static final String graalvmVersion = System.getProperty("org.graalvm.version", "dev");
static final String graalvmConfig = System.getProperty("org.graalvm.config", "CE");

private static Map<String, String[]> getCompilerFlags() {
Map<String, String[]> result = new HashMap<>();
Expand Down Expand Up @@ -813,6 +814,7 @@ private void prepareImageBuildArgs() {
addImageBuilderJavaArgs("-Djava.awt.headless=true");
}
addImageBuilderJavaArgs("-Dorg.graalvm.version=" + graalvmVersion);
addImageBuilderJavaArgs("-Dorg.graalvm.config=" + graalvmConfig);
addImageBuilderJavaArgs("-Dcom.oracle.graalvm.isaot=true");
addImageBuilderJavaArgs("-Djava.system.class.loader=" + CUSTOM_SYSTEM_CLASS_LOADER);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public void afterRegistration(AfterRegistrationAccess access) {
}

protected VM createVMSingletonValue() {
return new VM("CE");
String config = System.getProperty("org.graalvm.config", "CE");
return new VM(config);
}

@Override
Expand Down

0 comments on commit b948546

Please sign in to comment.