aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-03-02 18:36:51 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-03-02 18:36:51 +0100
commitfe09a2623c32bb71c98b79380014f782f688bdc4 (patch)
tree83ae99d2a0d632814a36546b758493cfd6b52983
parentfeed2016cea8650626ba53306251a3c42da63dfd (diff)
downloaddokka-fe09a2623c32bb71c98b79380014f782f688bdc4.tar.gz
dokka-fe09a2623c32bb71c98b79380014f782f688bdc4.tar.bz2
dokka-fe09a2623c32bb71c98b79380014f782f688bdc4.zip
report number of warnings after generation
-rw-r--r--src/main.kt17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main.kt b/src/main.kt
index bcd129b4..6dd6d5c4 100644
--- a/src/main.kt
+++ b/src/main.kt
@@ -88,6 +88,7 @@ public fun main(args: Array<String>) {
arguments.nodeprecated)
generator.generate()
+ DokkaConsoleLogger.report()
}
trait DokkaLogger {
@@ -97,9 +98,23 @@ trait DokkaLogger {
}
object DokkaConsoleLogger: DokkaLogger {
+ var warningCount: Int = 0
+
override fun info(message: String) = println(message)
- override fun warn(message: String) = println("WARN: $message")
+ override fun warn(message: String) {
+ println("WARN: $message")
+ warningCount++
+ }
+
override fun error(message: String) = println("ERROR: $message")
+
+ fun report() {
+ if (warningCount > 0) {
+ println("Generation completed with $warningCount warnings")
+ } else {
+ println("Generation completed successfully")
+ }
+ }
}
class DokkaMessageCollector(val logger: DokkaLogger): MessageCollector {