From 887b6635996bf639247d2c7036dc2b85d2c9d53f Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Wed, 20 Dec 2023 09:25:02 +0100 Subject: [PATCH] Qute - message bundles: skip unnecessary build steps - create the qute-i18n-examples directory only if message bundles are used - related to #37783 --- .../qute/deployment/MessageBundleProcessor.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java index 12477cf517114..a78a3331d11d7 100644 --- a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java +++ b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java @@ -354,6 +354,10 @@ void validateMessageBundleMethods(TemplatesAnalysisBuildItem templatesAnalysis, List templateGlobals, BuildProducer incorrectExpressions) { + if (messageBundleMethods.isEmpty()) { + return; + } + Map bundleMethods = messageBundleMethods.stream() .filter(MessageBundleMethodBuildItem::isValidatable) .collect(Collectors.toMap(MessageBundleMethodBuildItem::getTemplateId, Function.identity())); @@ -438,6 +442,10 @@ void validateMessageBundleMethodsInTemplates(TemplatesAnalysisBuildItem analysis QuteConfig config, List globals) { + if (messageBundles.isEmpty()) { + return; + } + IndexView index = beanArchiveIndex.getIndex(); Function templateIdToPathFun = new Function() { @Override @@ -630,6 +638,9 @@ public String apply(String id) { @BuildStep(onlyIf = IsNormal.class) void generateExamplePropertiesFiles(List messageBundleMethods, BuildSystemTargetBuildItem target, BuildProducer dummy) throws IOException { + if (messageBundleMethods.isEmpty()) { + return; + } Map> bundles = new HashMap<>(); for (MessageBundleMethodBuildItem messageBundleMethod : messageBundleMethods) { if (messageBundleMethod.isDefaultBundle()) {