Skip to content

Commit

Permalink
Do not warn on static init about clearly build-related properties bei…
Browse files Browse the repository at this point in the history
…ng set in environment variables
  • Loading branch information
yrodiere committed Oct 6, 2023
1 parent cb81846 commit 0936ebb
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.NativeImageFeatureBuildItem;
import io.quarkus.deployment.builditem.SuppressNonRuntimeConfigChangedWarningBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ExcludeConfigBuildItem;
import io.quarkus.deployment.builditem.nativeimage.JPMSExportBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageAllowIncompleteClasspathAggregateBuildItem;
Expand Down Expand Up @@ -362,6 +363,22 @@ public NativeImageRunnerBuildItem dummyNativeImageBuildRunner(NativeConfig nativ
return new NativeImageRunnerBuildItem(new NoopNativeImageBuildRunner(explicitContainerBuild));
}

@BuildStep
public void ignoreBuildPropertyChanges(BuildProducer<SuppressNonRuntimeConfigChangedWarningBuildItem> producer) {
// Don't produce warnings on static init for properties that are overridden through environment variables
// if they are clearly only relevant when building.
for (String propertyKey : new String[] {
"quarkus.native.container-build",
"quarkus.native.remote-container-build",
"quarkus.native.builder-image.image",
"quarkus.native.builder-image.pull",
"quarkus.native.container-runtime",
"quarkus.native.container-runtime-options"
}) {
producer.produce(new SuppressNonRuntimeConfigChangedWarningBuildItem(propertyKey));
}
}

private void copyJarSourcesToLib(OutputTargetBuildItem outputTargetBuildItem,
CurateOutcomeBuildItem curateOutcomeBuildItem) {
Path targetDirectory = outputTargetBuildItem.getOutputDirectory()
Expand Down

0 comments on commit 0936ebb

Please sign in to comment.