Skip to content

Commit

Permalink
Wrap more options in UnlockExperimentalVMOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Sep 7, 2023
1 parent 69b0e01 commit 67a9f00
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public NativeImageInvokerInfo build() {
}
final String includeLocales = LocaleProcessor.nativeImageIncludeLocales(nativeConfig, localesBuildTimeConfig);
if (!includeLocales.isEmpty()) {
nativeImageArgs.add("-H:IncludeLocales=" + includeLocales);
addExperimentalVMOption(nativeImageArgs, "-H:IncludeLocales=" + includeLocales);
}

nativeImageArgs.add("-J-Dfile.encoding=" + nativeConfig.fileEncoding());
Expand Down Expand Up @@ -744,7 +744,7 @@ public NativeImageInvokerInfo build() {
* {@code handleAdditionalProperties(nativeImageArgs)} to ensure that devs and advanced users can
* override it by passing -Dquarkus.native.additional-build-args=-H:+ParseOnce
*/
nativeImageArgs.add("-H:-ParseOnce");
addExperimentalVMOption(nativeImageArgs, "-H:-ParseOnce");
}

if (nativeConfig.debug().enabled() && graalVMVersion.compareTo(GraalVM.Version.VERSION_23_0_0) >= 0) {
Expand All @@ -756,9 +756,9 @@ public NativeImageInvokerInfo build() {
*
* See https://github.com/quarkusio/quarkus/issues/30772 for more details.
*/
nativeImageArgs.add("-H:+TrackNodeSourcePosition");
addExperimentalVMOption(nativeImageArgs, "-H:+TrackNodeSourcePosition");
/* See https://github.com/Karm/mandrel-integration-tests/issues/154 for more details. */
nativeImageArgs.add("-H:+DebugCodeInfoUseSourceMappings");
addExperimentalVMOption(nativeImageArgs, "-H:+DebugCodeInfoUseSourceMappings");
}

/**
Expand All @@ -780,7 +780,7 @@ public NativeImageInvokerInfo build() {
nativeImageArgs.add("-J--add-opens=java.base/java.util=ALL-UNNAMED");

if (nativeConfig.enableReports()) {
nativeImageArgs.add("-H:PrintAnalysisCallTreeType=CSV");
addExperimentalVMOption(nativeImageArgs, "-H:PrintAnalysisCallTreeType=CSV");
}

// only available in GraalVM 22.3.0+.
Expand Down Expand Up @@ -829,7 +829,7 @@ public NativeImageInvokerInfo build() {
}
if (nativeConfig.debug().enabled()) {
nativeImageArgs.add("-g");
nativeImageArgs.add("-H:DebugInfoSourceSearchPath=" + APP_SOURCES);
addExperimentalVMOption(nativeImageArgs, "-H:DebugInfoSourceSearchPath=" + APP_SOURCES);
}
if (nativeConfig.debugBuildProcess()) {
String debugBuildProcessHost;
Expand Down Expand Up @@ -864,14 +864,14 @@ public NativeImageInvokerInfo build() {
nativeImageArgs.add("--enable-url-protocols=" + String.join(",", protocols));
}
if (!inlineBeforeAnalysis) {
nativeImageArgs.add("-H:-InlineBeforeAnalysis");
addExperimentalVMOption(nativeImageArgs, "-H:-InlineBeforeAnalysis");
}
if (!pie.isEmpty()) {
nativeImageArgs.add("-H:NativeLinkerOption=" + pie);
}

if (!nativeConfig.enableIsolates()) {
nativeImageArgs.add("-H:-SpawnIsolates");
addExperimentalVMOption(nativeImageArgs, "-H:-SpawnIsolates");
}
if (!nativeConfig.enableJni()) {
log.warn(
Expand All @@ -887,7 +887,7 @@ public NativeImageInvokerInfo build() {
+ " will be removed in a future Quarkus version.");
}
if (nativeConfig.enableVmInspection()) {
nativeImageArgs.add("-H:+AllowVMInspection");
addExperimentalVMOption(nativeImageArgs, "-H:+AllowVMInspection");
}

if (nativeConfig.monitoring().isPresent()) {
Expand All @@ -914,15 +914,15 @@ public NativeImageInvokerInfo build() {
}

if (nativeConfig.enableDashboardDump()) {
nativeImageArgs.add("-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump");
nativeImageArgs.add("-H:+DashboardAll");
addExperimentalVMOption(nativeImageArgs, "-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump");
addExperimentalVMOption(nativeImageArgs, "-H:+DashboardAll");
}

if (nativeImageSecurityProviders != null && !nativeImageSecurityProviders.isEmpty()) {
String additionalSecurityProviders = nativeImageSecurityProviders.stream()
.map(p -> p.getSecurityProvider())
.collect(Collectors.joining(","));
nativeImageArgs.add("-H:AdditionalSecurityProviders=" + additionalSecurityProviders);
addExperimentalVMOption(nativeImageArgs, "-H:AdditionalSecurityProviders=" + additionalSecurityProviders);
}

if (jpmsExports != null) {
Expand Down

0 comments on commit 67a9f00

Please sign in to comment.