diff --git a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java index 9437d09d5872a..f7430ed6b1733 100644 --- a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java +++ b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java @@ -3355,31 +3355,29 @@ public static String getName(InjectionPointInfo injectionPoint) { * @param templatePaths * @param watchedPaths * @param nativeImageResources - * @param osSpecificResourcePath The OS-specific resource path, i.e. templates\nested\foo.html + * @param resourcePath The relative resource path, including the template root * @param templatePath The path relative to the template root; using the {@code /} path separator * @param originalPath * @param config */ private static void produceTemplateBuildItems(BuildProducer templatePaths, BuildProducer watchedPaths, - BuildProducer nativeImageResources, String osSpecificResourcePath, + BuildProducer nativeImageResources, String resourcePath, String templatePath, Path originalPath, QuteConfig config) { if (templatePath.isEmpty()) { return; } - // OS-agnostic full path, i.e. templates/foo.html - String osAgnosticResourcePath = toOsAgnosticPath(osSpecificResourcePath, originalPath.getFileSystem()); LOGGER.debugf("Produce template build items [templatePath: %s, osSpecificResourcePath: %s, originalPath: %s", templatePath, - osSpecificResourcePath, + resourcePath, originalPath); boolean restartNeeded = true; if (config.devMode.noRestartTemplates.isPresent()) { - restartNeeded = !config.devMode.noRestartTemplates.get().matcher(osAgnosticResourcePath).matches(); + restartNeeded = !config.devMode.noRestartTemplates.get().matcher(resourcePath).matches(); } - watchedPaths.produce(new HotDeploymentWatchedFileBuildItem(osAgnosticResourcePath, restartNeeded)); - nativeImageResources.produce(new NativeImageResourceBuildItem(osSpecificResourcePath)); + watchedPaths.produce(new HotDeploymentWatchedFileBuildItem(resourcePath, restartNeeded)); + nativeImageResources.produce(new NativeImageResourceBuildItem(resourcePath)); templatePaths.produce( new TemplatePathBuildItem(templatePath, originalPath, readTemplateContent(originalPath, config.defaultCharset))); @@ -3399,7 +3397,7 @@ private void scanTemplateRootSubtree(PathTree pathTree, Path templateRoot, return; } produceTemplateBuildItems(templatePaths, watchedPaths, nativeImageResources, - visit.getRelativePath(visit.getPath().getFileSystem().getSeparator()), + visit.getRelativePath("/"), templatePath, visit.getPath(), config); } }); diff --git a/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/templateroot/AdditionalTemplateRootTest.java b/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/templateroot/AdditionalTemplateRootTest.java index 9095a01599387..37b3606d7a096 100644 --- a/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/templateroot/AdditionalTemplateRootTest.java +++ b/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/templateroot/AdditionalTemplateRootTest.java @@ -51,11 +51,8 @@ public void execute(BuildContext context) { List items = context.consumeMulti(NativeImageResourceBuildItem.class); for (NativeImageResourceBuildItem item : items) { if (item.getResources().contains("web/public/hello.txt") - || item.getResources().contains("web\\public\\hello.txt") || item.getResources().contains("templates/hi.txt") - || item.getResources().contains("templates\\hi.txt") - || item.getResources().contains("templates/nested/hoho.txt") - || item.getResources().contains("templates\\nested\\hoho.txt")) { + || item.getResources().contains("templates/nested/hoho.txt")) { found++; } }