diff --git a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartType.java b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartType.java index 17dc328e7dc40..ef1bdec85bb1f 100644 --- a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartType.java +++ b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/CodestartType.java @@ -1,5 +1,7 @@ package io.quarkus.devtools.codestarts; +import io.smallrye.common.os.OS; + public enum CodestartType { LANGUAGE(true, 1, "\uD83D\uDD20"), BUILDTOOL(true, 2, "\uD83E\uDDF0"), @@ -24,7 +26,7 @@ public boolean isBase() { } public String getIcon() { - return icon; + return OS.WINDOWS.isCurrent() ? ">>" : icon; } public int getProcessingOrder() { diff --git a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartProjectGeneration.java b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartProjectGeneration.java index 12cc9998f4179..1eea467c6ebf0 100644 --- a/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartProjectGeneration.java +++ b/independent-projects/tools/codestarts/src/main/java/io/quarkus/devtools/codestarts/core/CodestartProjectGeneration.java @@ -50,11 +50,12 @@ static void generateProject(final CodestartProjectDefinition projectDefinition, }); processor.writeFiles(); + log.info("\napplying codestarts..."); log.info(projectDefinition.getCodestarts().stream() .map(c -> c.getType().getIcon() + " " + c.getName()) - .collect(Collectors.joining("\n"))); + .collect(Collectors.joining(System.lineSeparator()))); } private static Map mergeStrategies(CodestartProjectDefinition projectDefinition) { diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java index 08088cf06cc7e..8e65c76429181 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateProjectCommandHandler.java @@ -110,7 +110,7 @@ public QuarkusCommandOutcome execute(QuarkusCommandInvocation invocation) throws final CodestartProjectDefinition projectDefinition = catalog.createProject(input); projectDefinition.generate(invocation.getQuarkusProject().getProjectDirPath()); invocation.log() - .info("\n-----------\n" + MessageIcons.NOOP_ICON + " " + .info("\n-----------\n" + MessageIcons.OK_ICON + " " + projectDefinition.getRequiredCodestart(CodestartType.PROJECT).getName() + " project has been successfully generated in:\n--> " + invocation.getQuarkusProject().getProjectDirPath().toString() + "\n-----------"); diff --git a/independent-projects/tools/message-writer/pom.xml b/independent-projects/tools/message-writer/pom.xml index 1f5eb4b30862f..3ef13025f1d0d 100644 --- a/independent-projects/tools/message-writer/pom.xml +++ b/independent-projects/tools/message-writer/pom.xml @@ -3,6 +3,12 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + + + io.smallrye.common + smallrye-common-os + + io.quarkus diff --git a/independent-projects/tools/message-writer/src/main/java/io/quarkus/devtools/messagewriter/MessageIcons.java b/independent-projects/tools/message-writer/src/main/java/io/quarkus/devtools/messagewriter/MessageIcons.java index e3630afd0abd4..e6c9f2e4cb563 100644 --- a/independent-projects/tools/message-writer/src/main/java/io/quarkus/devtools/messagewriter/MessageIcons.java +++ b/independent-projects/tools/message-writer/src/main/java/io/quarkus/devtools/messagewriter/MessageIcons.java @@ -1,14 +1,25 @@ package io.quarkus.devtools.messagewriter; -public final class MessageIcons { +import io.smallrye.common.os.OS; - public static final String OK_ICON = "\u2705"; - public static final String NOK_ICON = "\u274c"; - public static final String NOOP_ICON = "\uD83D\uDC4D"; - public static final String WARN_ICON = "\uD83D\uDD25"; - public static final String ERROR_ICON = "\u2757"; +public enum MessageIcons { - private MessageIcons() { + OK_ICON("\u2705", "[SUCCESS]"), + NOK_ICON("\u274c", "[FAILURE]"), + NOOP_ICON("\uD83D\uDC4D", ""), + WARN_ICON("\uD83D\uDD25", "[WARN]"), + ERROR_ICON("\u2757", "[ERROR]"); + + private String icon; + private String messageCode; + + MessageIcons(String icon, String messageCode) { + this.icon = icon; + this.messageCode = messageCode; } + @Override + public String toString() { + return OS.WINDOWS.isCurrent() ? messageCode : String.format("%s %s", messageCode, icon); + } } diff --git a/independent-projects/tools/pom.xml b/independent-projects/tools/pom.xml index 690b8a6afb546..c4f6ce3bb7b1a 100644 --- a/independent-projects/tools/pom.xml +++ b/independent-projects/tools/pom.xml @@ -53,6 +53,7 @@ 18 2.8.0 3.0.18.Final + 1.5.0 platform-descriptor-api @@ -204,6 +205,11 @@ test ${quarkus.version} + + io.smallrye.common + smallrye-common-os + ${smallrye-commons.version} + com.fasterxml.jackson @@ -212,7 +218,6 @@ import pom -