From dd88f0579d76f7bb87d38416da9b40d4acb8d56b Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Tue, 30 Mar 2021 14:14:38 +0300 Subject: [PATCH] Add config to bash launcher version output --- .../src/com/oracle/svm/driver/DefaultOptionHandler.java | 2 +- .../src/com/oracle/svm/driver/NativeImage.java | 2 ++ .../src/com/oracle/svm/hosted/VMFeature.java | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java index 4312e17d35ea..1f8e49ee5653 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java @@ -84,7 +84,7 @@ public boolean consume(Queue args) { if (NativeImage.IS_AOT) { message = System.getProperty("java.vm.version"); } else { - message = NativeImage.graalvmVersion; + message = "native-image " + NativeImage.graalvmVersion + " " + NativeImage.graalvmConfig; } message += " (Java Version " + javaRuntimeVersion + ")"; nativeImage.showMessage(message); diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java index 35ad83ae7f89..c167d9be72ae 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java @@ -107,6 +107,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 getCompilerFlags() { Map result = new HashMap<>(); @@ -728,6 +729,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); /* diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/VMFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/VMFeature.java index 033e3f0719b6..f6908badd0f8 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/VMFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/VMFeature.java @@ -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