diff --git a/docs/reference-manual/native-image/BuildOutput.md b/docs/reference-manual/native-image/BuildOutput.md index 7eeca685269d..3023fe4582d4 100644 --- a/docs/reference-manual/native-image/BuildOutput.md +++ b/docs/reference-manual/native-image/BuildOutput.md @@ -220,6 +220,7 @@ Run `native-image --expert-options-all | grep "BuildOutput"` to see all build ou -H:±BuildOutputLinks Show links in build output. Default: + (enabled). -H:±BuildOutputPrefix Prefix build output with ':'. Default: - (disabled). -H:±BuildOutputProgress Report progress in build output. Default: + (enabled). +-H:±BuildOutputSilent Silence build output. Default: - (disabled). ``` ### Related Documentation diff --git a/substratevm/CHANGELOG.md b/substratevm/CHANGELOG.md index f323725f7f66..9386f44a96b4 100644 --- a/substratevm/CHANGELOG.md +++ b/substratevm/CHANGELOG.md @@ -6,6 +6,7 @@ This changelog summarizes major changes to GraalVM Native Image. * (GR-35721) Remove old build output style and the `-H:±BuildOutputUseNewStyle` option. * (GR-39390) (GR-39649) (GR-40033) Red Hat added support for the JFR events `JavaMonitorEnter`, `JavaMonitorWait`, and `ThreadSleep`. * (GR-39497) Add `-H:BuildOutputJSONFile=` option for [JSON build output](https://github.com/oracle/graal/edit/master/docs/reference-manual/native-image/BuildOutput.md#machine-readable-build-output). Please feel free to provide feedback so that we can stabilize the schema/API. +* (GR-40170) Add `--silent` option to silence the build output. ## Version 22.2.0 * (GR-20653) Re-enable the usage of all CPU features for JIT compilation on AMD64. diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java index e9e01263c084..d125b205cf10 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java @@ -408,6 +408,10 @@ public Boolean getValue(OptionValues values) { /* * Build output options. */ + @APIOption(name = "silent")// + @Option(help = "Silence build output", type = OptionType.User)// + public static final HostedOptionKey BuildOutputSilent = new HostedOptionKey<>(false); + @Option(help = "Prefix build output with ':'", type = OptionType.User)// public static final HostedOptionKey BuildOutputPrefix = new HostedOptionKey<>(false); 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 61cb8de51fbb..0cdde5f7c50b 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 @@ -630,6 +630,7 @@ private ArrayList createFallbackBuildArgs() { buildArgs.add(fallbackExecutorJavaArg); } + buildArgs.add(oH + "+" + SubstrateOptions.BuildOutputSilent.getName()); buildArgs.add(oH + "+" + SubstrateOptions.ParseRuntimeOptions.getName()); Path imagePathPath; try { @@ -1407,6 +1408,7 @@ protected static void build(BuildConfiguration config, Function