Implement context classpath extraction using particular class,...
Use it in the main-kts. Also improve diagnoistics related to the definition loading. #KT-26828 fixed (after this commit - finally, see also another related commit)
This commit is contained in:
@@ -16,6 +16,7 @@ import kotlin.script.experimental.api.*
|
||||
import kotlin.script.experimental.jvm.JvmDependency
|
||||
import kotlin.script.experimental.jvm.compat.mapLegacyDiagnosticSeverity
|
||||
import kotlin.script.experimental.jvm.compat.mapLegacyScriptPosition
|
||||
import kotlin.script.experimental.jvm.dependenciesFromClassContext
|
||||
import kotlin.script.experimental.jvm.dependenciesFromCurrentContext
|
||||
import kotlin.script.experimental.jvm.jvm
|
||||
|
||||
@@ -27,9 +28,8 @@ object MainKtsScriptDefinition : ScriptCompilationConfiguration(
|
||||
{
|
||||
defaultImports(DependsOn::class, Repository::class)
|
||||
jvm {
|
||||
dependenciesFromCurrentContext("kotlin-main-kts")
|
||||
dependenciesFromClassContext(MainKtsScriptDefinition::class, "kotlin-main-kts")
|
||||
}
|
||||
// variant: dependencies(collectDependenciesFromCurrentContext(...
|
||||
refineConfiguration {
|
||||
onAnnotations(DependsOn::class, Repository::class, handler = MainKtsConfigurator())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user