From e55b9f06071fa631bf3c79b8ac7f4604f89554c6 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sun, 29 Nov 2015 14:07:48 -0800 Subject: [PATCH] Ascii art. --- src/main/kotlin/com/beust/kobalt/AsciiArt.kt | 13 ++++++++++--- src/main/kotlin/com/beust/kobalt/Main.kt | 5 +++-- .../kotlin/com/beust/kobalt/internal/TaskManager.kt | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/AsciiArt.kt b/src/main/kotlin/com/beust/kobalt/AsciiArt.kt index 00b75a80..5644e384 100644 --- a/src/main/kotlin/com/beust/kobalt/AsciiArt.kt +++ b/src/main/kotlin/com/beust/kobalt/AsciiArt.kt @@ -20,14 +20,21 @@ class AsciiArt { " |_|\\_\\ \\___/ |_.__/ \\__,_| |_| \\__| " ) - val banner : String get() = BANNERS.get(Random().nextInt(BANNERS.size)) + val banner : String get() = BANNERS[Random().nextInt(BANNERS.size)] - fun box(s: String) : List = box(listOf(s)) +// fun box(s: String) : List = box(listOf(s)) + + val horizontalSingleLine = "\u2500\u2500\u2500\u2500\u2500" + val horizontalDoubleLine = "\u2550\u2550\u2550\u2550\u2550" + +// fun horizontalLine(n: Int) = StringBuffer().apply { +// repeat(n, { append("\u2500") }) +// }.toString() fun box(strings: List) : List { val ul = "\u2554" val ur = "\u2557" - val h = "\u2550" + val h = horizontalDoubleLine val v = "\u2551" val bl = "\u255a" val br = "\u255d" diff --git a/src/main/kotlin/com/beust/kobalt/Main.kt b/src/main/kotlin/com/beust/kobalt/Main.kt index 8b5183aa..8fca75ee 100644 --- a/src/main/kotlin/com/beust/kobalt/Main.kt +++ b/src/main/kotlin/com/beust/kobalt/Main.kt @@ -1,6 +1,7 @@ package com.beust.kobalt import com.beust.jcommander.JCommander +import com.beust.kobalt.api.IClasspathDependency import com.beust.kobalt.api.Kobalt import com.beust.kobalt.api.Project import com.beust.kobalt.internal.PluginInfo @@ -12,7 +13,6 @@ import com.beust.kobalt.internal.remote.KobaltServer import com.beust.kobalt.maven.DepFactory import com.beust.kobalt.maven.Http import com.beust.kobalt.maven.LocalRepo -import com.beust.kobalt.api.IClasspathDependency import com.beust.kobalt.misc.* import com.google.inject.Guice import java.io.File @@ -180,7 +180,8 @@ private class Main @Inject constructor( val sb = StringBuffer("List of tasks\n") Plugins.plugins.forEach { plugin -> if (plugin.tasks.size > 0) { - sb.append("\n ===== ${plugin.name} =====\n") + sb.append("\n " + AsciiArt.horizontalDoubleLine +" ${plugin.name} " + + AsciiArt.horizontalDoubleLine + "\n") plugin.tasks.distinctBy { it.name }.forEach { task -> diff --git a/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt b/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt index 4387edaf..58ce4aa5 100644 --- a/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt +++ b/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt @@ -221,7 +221,7 @@ class TaskWorker(val tasks: List, val dryRun: Boolean) : IWorker { if (tasks.size > 0) { tasks[0].let { - log(1, "========== ${it.project.name}:${it.name}") + log(1, AsciiArt.horizontalSingleLine + " ${it.project.name}:${it.name}") } } var success = true