Skip to content

Commit

Permalink
Merge pull request quarkusio#36322 from yrodiere/build-prop-no-warn
Browse files Browse the repository at this point in the history
Do not warn on static init about clearly build-related properties being set in environment variables
  • Loading branch information
geoand authored Oct 9, 2023
2 parents 291e0f2 + 0936ebb commit 0095d5f
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 0095d5f

Please sign in to comment.