Implement main method generation in scripts and runnable jar saving

refactor necessary parts on the way
This commit is contained in:
Ilya Chernikov
2019-04-09 08:28:53 +02:00
parent c896b4873b
commit 67ad3773de
14 changed files with 355 additions and 81 deletions
@@ -7,6 +7,8 @@
package kotlin.script.experimental.api
import java.io.File
/**
* The single script diagnostic report
* @param message diagnostic message
@@ -25,6 +27,27 @@ data class ScriptDiagnostic(
* The diagnostic severity
*/
enum class Severity { FATAL, ERROR, WARNING, INFO, DEBUG }
override fun toString(): String = buildString {
append(severity.name)
append(' ')
append(message)
if (sourcePath != null || location != null) {
append(" (")
sourcePath?.let { append(it.substringAfterLast(File.separatorChar)) }
location?.let {
append(':')
append(it.start.line)
append(':')
append(it.start.col)
}
append(')')
}
if (exception != null) {
append(": ")
append(exception)
}
}
}
/**