mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Temporary fix for kotlinc 1.1.
This commit is contained in:
parent
9fb3eb87a2
commit
6ac1260e8b
9 changed files with 33 additions and 11 deletions
|
@ -102,7 +102,7 @@ class ConsoleTransferListener @JvmOverloads constructor(out: PrintStream? = null
|
||||||
|
|
||||||
if (event.exception !is MetadataNotFoundException) {
|
if (event.exception !is MetadataNotFoundException) {
|
||||||
if (KobaltLogger.LOG_LEVEL > 2) {
|
if (KobaltLogger.LOG_LEVEL > 2) {
|
||||||
event.exception.printStackTrace(out)
|
Exceptions.printStackTrace(event.exception)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ class ConsoleTransferListener @JvmOverloads constructor(out: PrintStream? = null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun transferCorrupted(event: TransferEvent?) {
|
override fun transferCorrupted(event: TransferEvent?) {
|
||||||
event!!.exception.printStackTrace(out)
|
Exceptions.printStackTrace(event!!.exception)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun toKB(bytes: Long): Long {
|
protected fun toKB(bytes: Long): Long {
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.beust.kobalt.maven.aether
|
||||||
|
|
||||||
|
object Exceptions {
|
||||||
|
fun printStackTrace(t: Throwable) {
|
||||||
|
t.printStackTrace(System.out)
|
||||||
|
|
||||||
|
// println("PRINT STACK TRACE FOR $t")
|
||||||
|
// t.printStackTrace(System.out)
|
||||||
|
// println(t.message)
|
||||||
|
// t.stackTrace.forEach {
|
||||||
|
// println(" " + it)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,7 +27,7 @@ object ManualRepositorySystemFactory {
|
||||||
|
|
||||||
locator.setErrorHandler(object : DefaultServiceLocator.ErrorHandler() {
|
locator.setErrorHandler(object : DefaultServiceLocator.ErrorHandler() {
|
||||||
override fun serviceCreationFailed(type: Class<*>, impl: Class<*>, exception: Throwable) {
|
override fun serviceCreationFailed(type: Class<*>, impl: Class<*>, exception: Throwable) {
|
||||||
exception.printStackTrace()
|
Exceptions.printStackTrace(exception)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.beust.kobalt.KobaltException
|
||||||
import com.beust.kobalt.internal.DocUrl
|
import com.beust.kobalt.internal.DocUrl
|
||||||
import com.beust.kobalt.internal.KobaltSettings
|
import com.beust.kobalt.internal.KobaltSettings
|
||||||
import com.beust.kobalt.maven.Http
|
import com.beust.kobalt.maven.Http
|
||||||
|
import com.beust.kobalt.maven.aether.Exceptions
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.google.inject.Inject
|
import com.google.inject.Inject
|
||||||
|
@ -132,7 +133,7 @@ class GithubApi2 @Inject constructor(
|
||||||
}
|
}
|
||||||
} catch(e: Exception) {
|
} catch(e: Exception) {
|
||||||
kobaltLog(1, "Couldn't retrieve releases from github: " + e.message)
|
kobaltLog(1, "Couldn't retrieve releases from github: " + e.message)
|
||||||
e.printStackTrace()
|
Exceptions.printStackTrace(e)
|
||||||
// val error = parseRetrofitError(e)
|
// val error = parseRetrofitError(e)
|
||||||
// val details = if (error.errors != null) {
|
// val details = if (error.errors != null) {
|
||||||
// error.errors[0]
|
// error.errors[0]
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.beust.kobalt.Args
|
||||||
import com.beust.kobalt.AsciiArt
|
import com.beust.kobalt.AsciiArt
|
||||||
import com.beust.kobalt.KobaltException
|
import com.beust.kobalt.KobaltException
|
||||||
import com.beust.kobalt.api.Kobalt
|
import com.beust.kobalt.api.Kobalt
|
||||||
|
import com.beust.kobalt.maven.aether.Exceptions
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
|
@ -81,7 +82,9 @@ class Logger(val dev: Boolean) {
|
||||||
|
|
||||||
println(AsciiArt.errorColor(getPattern("E", shortMessage, longMessage, tag)))
|
println(AsciiArt.errorColor(getPattern("E", shortMessage, longMessage, tag)))
|
||||||
if (KobaltLogger.LOG_LEVEL > 1) {
|
if (KobaltLogger.LOG_LEVEL > 1) {
|
||||||
e?.printStackTrace()
|
val t = e as Throwable
|
||||||
|
Exceptions.printStackTrace(t)
|
||||||
|
// e?.printStackTrace()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +92,7 @@ class Logger(val dev: Boolean) {
|
||||||
val fullMessage = "***** WARNING " + (e?.message ?: message)
|
val fullMessage = "***** WARNING " + (e?.message ?: message)
|
||||||
println(AsciiArt.Companion.warnColor(getPattern("W", fullMessage, fullMessage, tag)))
|
println(AsciiArt.Companion.warnColor(getPattern("W", fullMessage, fullMessage, tag)))
|
||||||
if (KobaltLogger.LOG_LEVEL > 1) {
|
if (KobaltLogger.LOG_LEVEL > 1) {
|
||||||
e?.printStackTrace()
|
Exceptions.printStackTrace(e!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.beust.kobalt.api.Kobalt
|
||||||
import com.beust.kobalt.app.ProjectFinder
|
import com.beust.kobalt.app.ProjectFinder
|
||||||
import com.beust.kobalt.internal.build.BuildFile
|
import com.beust.kobalt.internal.build.BuildFile
|
||||||
import com.beust.kobalt.internal.eventbus.ArtifactDownloadedEvent
|
import com.beust.kobalt.internal.eventbus.ArtifactDownloadedEvent
|
||||||
|
import com.beust.kobalt.maven.aether.Exceptions
|
||||||
import com.google.common.eventbus.EventBus
|
import com.google.common.eventbus.EventBus
|
||||||
import com.google.common.eventbus.Subscribe
|
import com.google.common.eventbus.Subscribe
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
@ -28,7 +29,7 @@ class GetDependencyGraphHandler : WebSocketListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onWebSocketError(cause: Throwable?) {
|
override fun onWebSocketError(cause: Throwable?) {
|
||||||
cause?.printStackTrace()
|
Exceptions.printStackTrace(cause)
|
||||||
throw UnsupportedOperationException()
|
throw UnsupportedOperationException()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +73,7 @@ class GetDependencyGraphHandler : WebSocketListener {
|
||||||
}
|
}
|
||||||
}, useGraph = true)
|
}, useGraph = true)
|
||||||
} catch(ex: Throwable) {
|
} catch(ex: Throwable) {
|
||||||
ex.printStackTrace()
|
Exceptions.printStackTrace(ex)
|
||||||
val errorMessage = ex.stackTrace.map { it.toString() }.joinToString("\n<p>")
|
val errorMessage = ex.stackTrace.map { it.toString() }.joinToString("\n<p>")
|
||||||
DependencyData.GetDependenciesData(errorMessage = errorMessage)
|
DependencyData.GetDependenciesData(errorMessage = errorMessage)
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.beust.kobalt.api.Kobalt
|
||||||
import com.beust.kobalt.app.MainModule
|
import com.beust.kobalt.app.MainModule
|
||||||
import com.beust.kobalt.homeDir
|
import com.beust.kobalt.homeDir
|
||||||
import com.beust.kobalt.internal.KobaltSettings
|
import com.beust.kobalt.internal.KobaltSettings
|
||||||
|
import com.beust.kobalt.maven.aether.Exceptions
|
||||||
import com.beust.kobalt.misc.KFiles
|
import com.beust.kobalt.misc.KFiles
|
||||||
import com.beust.kobalt.misc.kobaltLog
|
import com.beust.kobalt.misc.kobaltLog
|
||||||
import com.beust.kobalt.misc.warn
|
import com.beust.kobalt.misc.warn
|
||||||
|
@ -71,7 +72,7 @@ class KobaltWebSocketClient : Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(ex: IOException, response: Response?) {
|
override fun onFailure(ex: IOException, response: Response?) {
|
||||||
ex.printStackTrace()
|
Exceptions.printStackTrace(ex)
|
||||||
error("WebSocket failure: ${ex.message} response: $response")
|
error("WebSocket failure: ${ex.message} response: $response")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.beust.kobalt.app.remote
|
||||||
import com.beust.kobalt.api.Project
|
import com.beust.kobalt.api.Project
|
||||||
import com.beust.kobalt.homeDir
|
import com.beust.kobalt.homeDir
|
||||||
import com.beust.kobalt.internal.PluginInfo
|
import com.beust.kobalt.internal.PluginInfo
|
||||||
|
import com.beust.kobalt.maven.aether.Exceptions
|
||||||
import com.beust.kobalt.misc.KFiles
|
import com.beust.kobalt.misc.KFiles
|
||||||
import com.beust.kobalt.misc.kobaltLog
|
import com.beust.kobalt.misc.kobaltLog
|
||||||
import com.google.inject.Inject
|
import com.google.inject.Inject
|
||||||
|
@ -56,7 +57,7 @@ class KobaltServer @Inject constructor(@Assisted val force: Boolean, @Assisted @
|
||||||
// WasabiServer(initCallback, cleanUpCallback).run(port)
|
// WasabiServer(initCallback, cleanUpCallback).run(port)
|
||||||
}
|
}
|
||||||
} catch(ex: Exception) {
|
} catch(ex: Exception) {
|
||||||
ex.printStackTrace()
|
Exceptions.printStackTrace(ex)
|
||||||
} finally {
|
} finally {
|
||||||
// deleteServerFile()
|
// deleteServerFile()
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.beust.kobalt.app.Templates
|
||||||
import com.beust.kobalt.internal.PluginInfo
|
import com.beust.kobalt.internal.PluginInfo
|
||||||
import com.beust.kobalt.internal.build.BuildFile
|
import com.beust.kobalt.internal.build.BuildFile
|
||||||
import com.beust.kobalt.internal.eventbus.ArtifactDownloadedEvent
|
import com.beust.kobalt.internal.eventbus.ArtifactDownloadedEvent
|
||||||
|
import com.beust.kobalt.maven.aether.Exceptions
|
||||||
import com.google.common.collect.ListMultimap
|
import com.google.common.collect.ListMultimap
|
||||||
import com.google.common.eventbus.EventBus
|
import com.google.common.eventbus.EventBus
|
||||||
import com.google.common.eventbus.Subscribe
|
import com.google.common.eventbus.Subscribe
|
||||||
|
@ -110,7 +111,7 @@ class GetDependenciesHandler : WebSocketListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onWebSocketError(cause: Throwable?) {
|
override fun onWebSocketError(cause: Throwable?) {
|
||||||
cause?.printStackTrace()
|
Exceptions.printStackTrace(cause)
|
||||||
throw UnsupportedOperationException()
|
throw UnsupportedOperationException()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue