packages = sourcePackagesForRoot(sourcePaths);
- if (!packages.isEmpty()) {
- sourcePackagesByDir.put(sourcePaths.toAbsolutePath().toString().replace("\\", "/"), packages);
- }
- }
- return sourcePackagesByDir;
- }
- if (disable) { // all the other values are Strings
- return EMPTY;
- }
-
- switch (ctxName) {
- case "ideLinkType":
- if (!effectiveIdeBuildItem.isPresent()) {
- return "none";
- }
- return effectiveIdeBuildItem.get().getIde().equals(Ide.VSCODE) ? "client" : "server";
- case "ideClientLinkFormat":
- if (!effectiveIdeBuildItem.isPresent()) {
- return "unused";
- }
- if (effectiveIdeBuildItem.get().getIde() == Ide.VSCODE) {
- return "vscode://file/{0}:{1}";
- } else {
- return "unused";
- }
- case "ideServerLinkEndpoint":
- if (!effectiveIdeBuildItem.isPresent()) {
- return "unused";
- }
- return "/io.quarkus.quarkus-vertx-http/openInIDE";
- }
- return Results.notFound(ctx);
- }
-
- /**
- * Return the most general packages used in the application
- *
- * TODO: this likely covers almost all typical use cases, but probably needs some tweaks for extreme corner cases
- */
- private List sourcePackagesForRoot(Path langPath) {
- if (!Files.exists(langPath)) {
- return Collections.emptyList();
- }
- File[] rootFiles = langPath.toFile().listFiles();
- List rootPackages = new ArrayList<>(1);
- if (rootFiles != null) {
- for (File rootFile : rootFiles) {
- if (rootFile.isDirectory()) {
- rootPackages.add(rootFile.toPath());
- }
- }
- }
- if (rootPackages.isEmpty()) {
- return List.of("");
- }
- List result = new ArrayList<>(rootPackages.size());
- for (Path rootPackage : rootPackages) {
- List paths = new ArrayList<>();
- SimpleFileVisitor simpleFileVisitor = new DetectPackageFileVisitor(paths);
- try {
- Files.walkFileTree(rootPackage, simpleFileVisitor);
- if (paths.isEmpty()) {
- continue;
- }
- String commonPath = commonPath(paths);
- String rootPackageStr = commonPath.replace(langPath.toAbsolutePath().toString(), "")
- .replace(File.separator, ".");
- if (rootPackageStr.startsWith(".")) {
- rootPackageStr = rootPackageStr.substring(1);
- }
- if (rootPackageStr.endsWith(".")) {
- rootPackageStr = rootPackageStr.substring(0, rootPackageStr.length() - 1);
- }
- result.add(rootPackageStr);
- } catch (IOException e) {
- log.debug("Unable to determine the sources directories", e);
- // just ignore it as it's not critical for the DevUI functionality
- }
- }
- return result;
- }
-
- private String commonPath(List paths) {
- String commonPath = "";
- List dirs = new ArrayList<>(paths.size());
- for (int i = 0; i < paths.size(); i++) {
- dirs.add(i, paths.get(i).split(Pattern.quote(File.separator)));
- }
- for (int j = 0; j < dirs.get(0).length; j++) {
- String thisDir = dirs.get(0)[j]; // grab the next directory name in the first path
- boolean allMatched = true;
- for (int i = 1; i < dirs.size() && allMatched; i++) { // look at the other paths
- if (dirs.get(i).length < j) { //there is no directory
- allMatched = false;
- break;
- }
- allMatched = dirs.get(i)[j].equals(thisDir); //check if it matched
- }
- if (allMatched) {
- commonPath += thisDir + File.separator;
- } else {
- break;
- }
- }
- return commonPath;
- }
- }
-}
diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevTemplatePathBuildItem.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevTemplatePathBuildItem.java
deleted file mode 100644
index f900b8b5c6f19..0000000000000
--- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevTemplatePathBuildItem.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package io.quarkus.vertx.http.deployment.devmode.console;
-
-import io.quarkus.builder.item.MultiBuildItem;
-
-/**
- * Represents a dev template path.
- */
-public final class DevTemplatePathBuildItem extends MultiBuildItem {
-
- static final String TAGS = "tags/";
-
- private final String path;
- private final String contents;
-
- public DevTemplatePathBuildItem(String path, String contents) {
- this.path = path;
- this.contents = contents;
- }
-
- /**
- * Uses the {@code /} path separator.
- *
- * @return the path relative to the template root
- */
- public String getPath() {
- return path;
- }
-
- /**
- * Returns the template contents
- *
- * @return the template contents
- */
- public String getContents() {
- return contents;
- }
-
- /**
- *
- * @return {@code true} if it represents a user tag, {@code false} otherwise
- */
- public boolean isTag() {
- return path.startsWith(TAGS);
- }
-
- public boolean isRegular() {
- return !isTag();
- }
-
- public String getTagName() {
- int end = path.lastIndexOf('.');
- if (end == -1) {
- end = path.length();
- }
- return path.substring(TAGS.length(), end);
- }
-
-}
diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevTemplateVariantsBuildItem.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevTemplateVariantsBuildItem.java
deleted file mode 100644
index a847c2b87334d..0000000000000
--- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/DevTemplateVariantsBuildItem.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package io.quarkus.vertx.http.deployment.devmode.console;
-
-import java.util.List;
-import java.util.Map;
-
-import io.quarkus.builder.item.SimpleBuildItem;
-
-/**
- * Holds all dev template variants found.
- */
-public final class DevTemplateVariantsBuildItem extends SimpleBuildItem {
-
- private final Map> variants;
-
- public DevTemplateVariantsBuildItem(Map> variants) {
- this.variants = variants;
- }
-
- public Map> getVariants() {
- return variants;
- }
-
-}
diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/FlashScopeHandler.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/FlashScopeHandler.java
deleted file mode 100644
index 78bc7bc161ff7..0000000000000
--- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/FlashScopeHandler.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package io.quarkus.vertx.http.deployment.devmode.console;
-
-import io.quarkus.devconsole.runtime.spi.FlashScopeUtil;
-import io.vertx.core.Handler;
-import io.vertx.ext.web.RoutingContext;
-
-public class FlashScopeHandler implements Handler {
-
- @Override
- public void handle(RoutingContext event) {
- FlashScopeUtil.handleFlashCookie(event);
- event.next();
- }
-
-}
diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/JsonObjectValueResolver.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/JsonObjectValueResolver.java
deleted file mode 100644
index fe4b2a01d845e..0000000000000
--- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/JsonObjectValueResolver.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package io.quarkus.vertx.http.deployment.devmode.console;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionStage;
-
-import io.quarkus.qute.EvalContext;
-import io.quarkus.qute.Results;
-import io.quarkus.qute.ValueResolver;
-import io.vertx.core.json.JsonObject;
-
-public class JsonObjectValueResolver implements ValueResolver {
-
- public boolean appliesTo(EvalContext context) {
- return ValueResolver.matchClass(context, JsonObject.class);
- }
-
- @Override
- public CompletionStage