From df782f1e4560b1975dfdd0addc81d07578e6041c Mon Sep 17 00:00:00 2001 From: Alexey Loubyansky Date: Wed, 21 Feb 2024 21:40:18 +0100 Subject: [PATCH] Collect classes dirs from all the modules in RuntimeUpdatesProcessor --- .../deployment/dev/RuntimeUpdatesProcessor.java | 11 ++++++----- .../io/quarkus/dev/spi/HotReplacementContext.java | 2 +- .../devmode/StaticResourcesHotReplacementSetup.java | 4 +++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java index 1b57c9aa9ab57..d809ee5f85311 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java @@ -186,12 +186,13 @@ public TestSupport getTestSupport() { } @Override - public Path getClassesDir() { - //TODO: fix all these - for (DevModeContext.ModuleInfo i : context.getAllModules()) { - return Paths.get(i.getMain().getClassesPath()); + public List getClassesDir() { + final List allModules = context.getAllModules(); + final List paths = new ArrayList<>(allModules.size()); + for (DevModeContext.ModuleInfo i : allModules) { + paths.add(Path.of(i.getMain().getClassesPath())); } - return null; + return paths; } @Override diff --git a/core/devmode-spi/src/main/java/io/quarkus/dev/spi/HotReplacementContext.java b/core/devmode-spi/src/main/java/io/quarkus/dev/spi/HotReplacementContext.java index 15f3b0163a960..aba0ea21e75a0 100644 --- a/core/devmode-spi/src/main/java/io/quarkus/dev/spi/HotReplacementContext.java +++ b/core/devmode-spi/src/main/java/io/quarkus/dev/spi/HotReplacementContext.java @@ -8,7 +8,7 @@ public interface HotReplacementContext { - Path getClassesDir(); + List getClassesDir(); List getSourcesDir(); diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/StaticResourcesHotReplacementSetup.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/StaticResourcesHotReplacementSetup.java index 8b658a5509d25..e574b0f26fc3d 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/StaticResourcesHotReplacementSetup.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/StaticResourcesHotReplacementSetup.java @@ -14,7 +14,9 @@ public class StaticResourcesHotReplacementSetup implements HotReplacementSetup { @Override public void setupHotDeployment(HotReplacementContext context) { List resources = new ArrayList<>(); - addPathIfContainsStaticResources(resources, context.getClassesDir()); + for (Path classesDir : context.getClassesDir()) { + addPathIfContainsStaticResources(resources, classesDir); + } for (Path resourceDir : context.getResourcesDir()) { addPathIfContainsStaticResources(resources, resourceDir); }