From cd72dd7cd585cdcadbb3be764608abe372b7031c Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Wed, 9 Aug 2023 20:22:53 -0300 Subject: [PATCH 1/2] Output build graph using `quarkus.builder.graph-output` property Add `BuilderConfig` to eliminate build warnings --- .../io/quarkus/builder/BuildChainBuilder.java | 2 +- .../io/quarkus/runtime/BuilderConfig.java | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 core/runtime/src/main/java/io/quarkus/runtime/BuilderConfig.java diff --git a/core/builder/src/main/java/io/quarkus/builder/BuildChainBuilder.java b/core/builder/src/main/java/io/quarkus/builder/BuildChainBuilder.java index 820e66dc3e81a..0578ba0c4bc34 100644 --- a/core/builder/src/main/java/io/quarkus/builder/BuildChainBuilder.java +++ b/core/builder/src/main/java/io/quarkus/builder/BuildChainBuilder.java @@ -30,7 +30,7 @@ */ public final class BuildChainBuilder { - private static final String GRAPH_OUTPUT = System.getProperty("jboss.builder.graph-output"); + private static final String GRAPH_OUTPUT = System.getProperty("quarkus.builder.graph-output"); static final boolean LOG_CONFLICT_CAUSING = Boolean.getBoolean("quarkus.builder.log-conflict-cause"); private final BuildStepBuilder finalStep; diff --git a/core/runtime/src/main/java/io/quarkus/runtime/BuilderConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/BuilderConfig.java new file mode 100644 index 0000000000000..1af640d9ed936 --- /dev/null +++ b/core/runtime/src/main/java/io/quarkus/runtime/BuilderConfig.java @@ -0,0 +1,29 @@ +package io.quarkus.runtime; + +import java.util.Optional; + +import io.quarkus.runtime.annotations.ConfigItem; +import io.quarkus.runtime.annotations.ConfigPhase; +import io.quarkus.runtime.annotations.ConfigRoot; + +/** + * This configuration class is here to avoid warnings when using {@code -Dquarkus.builder.=...}. + * + * @see io.quarkus.builder.BuildChainBuilder + */ +@ConfigRoot(name = "builder", phase = ConfigPhase.RUN_TIME) +public class BuilderConfig { + + /** + * Dump the graph output to a file. This is useful for debugging. + */ + @ConfigItem + public Optional graphOutput; + + /** + * Whether to log the cause of a conflict. + */ + @ConfigItem + public Optional logConflictCause; + +} From b7f641cd74f9d7b42bcff44ab9a96676c4b037e7 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 11 Aug 2023 14:05:34 +0200 Subject: [PATCH 2/2] Convert newly added config to @ConfigMapping --- .../main/java/io/quarkus/runtime/BuilderConfig.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/runtime/src/main/java/io/quarkus/runtime/BuilderConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/BuilderConfig.java index 1af640d9ed936..b23b2cbe9ebde 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/BuilderConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/BuilderConfig.java @@ -2,28 +2,27 @@ import java.util.Optional; -import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; +import io.smallrye.config.ConfigMapping; /** * This configuration class is here to avoid warnings when using {@code -Dquarkus.builder.=...}. * * @see io.quarkus.builder.BuildChainBuilder */ -@ConfigRoot(name = "builder", phase = ConfigPhase.RUN_TIME) -public class BuilderConfig { +@ConfigMapping(prefix = "quarkus.builder") +@ConfigRoot(phase = ConfigPhase.RUN_TIME) +public interface BuilderConfig { /** * Dump the graph output to a file. This is useful for debugging. */ - @ConfigItem - public Optional graphOutput; + Optional graphOutput(); /** * Whether to log the cause of a conflict. */ - @ConfigItem - public Optional logConflictCause; + Optional logConflictCause(); }