Drop deprecated KotlinPaths.getRuntimePath, use getStdlibPath instead
This commit is contained in:
@@ -401,22 +401,21 @@ open class TestKotlinScriptDependenciesResolver : TestKotlinScriptDummyDependenc
|
||||
private val kotlinPaths by lazy { PathUtil.kotlinPathsForCompiler }
|
||||
|
||||
@AcceptedAnnotations(DependsOn::class, DependsOnTwo::class)
|
||||
override fun resolve(scriptContents: ScriptContents,
|
||||
environment: Environment
|
||||
): ResolveResult
|
||||
{
|
||||
val cp = scriptContents.annotations.flatMap {
|
||||
when (it) {
|
||||
is DependsOn -> if (it.path == "@{runtime}") listOf(kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath) else listOf(File(it.path))
|
||||
is DependsOnTwo -> listOf(it.path1, it.path2).flatMap {
|
||||
override fun resolve(scriptContents: ScriptContents, environment: Environment): ResolveResult {
|
||||
val cp = scriptContents.annotations.flatMap { annotation ->
|
||||
when (annotation) {
|
||||
is DependsOn ->
|
||||
if (annotation.path == "@{kotlin-stdlib}") listOf(kotlinPaths.stdlibPath, kotlinPaths.scriptRuntimePath)
|
||||
else listOf(File(annotation.path))
|
||||
is DependsOnTwo -> listOf(annotation.path1, annotation.path2).flatMap {
|
||||
when {
|
||||
it.isBlank() -> emptyList()
|
||||
it == "@{runtime}" -> listOf(kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath)
|
||||
it == "@{kotlin-stdlib}" -> listOf(kotlinPaths.stdlibPath, kotlinPaths.scriptRuntimePath)
|
||||
else -> listOf(File(it))
|
||||
}
|
||||
}
|
||||
is InvalidScriptResolverAnnotation -> throw Exception("Invalid annotation ${it.name}", it.error)
|
||||
else -> throw Exception("Unknown annotation ${it::class.java}")
|
||||
is InvalidScriptResolverAnnotation -> throw Exception("Invalid annotation ${annotation.name}", annotation.error)
|
||||
else -> throw Exception("Unknown annotation ${annotation::class.java}")
|
||||
}
|
||||
}
|
||||
return ScriptDependencies(
|
||||
|
||||
Reference in New Issue
Block a user