Copy (partly) context classpath extraction code from script-util to JSR223 4 Idea, use it there
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ private inline fun File.existsAndCheckOrNull(check: (File.() -> Boolean)): File?
|
||||
private val kotlinCompilerJar: File by lazy {
|
||||
// highest prio - explicit property
|
||||
System.getProperty("kotlin.compiler.jar")?.let(::File)?.existsOrNull()
|
||||
// search classpath from context classloader and `java.calss.path` property
|
||||
// search classpath from context classloader and `java.class.path` property
|
||||
?: (classpathFromClass(Thread.currentThread().contextClassLoader, K2JVMCompiler::class)
|
||||
?: contextClasspath(KOTLIN_COMPILER_JAR, Thread.currentThread().contextClassLoader)
|
||||
?: classpathFromClasspathProperty()
|
||||
|
||||
-3
@@ -1,7 +1,5 @@
|
||||
package org.jetbrains.kotlin.script.util
|
||||
|
||||
import org.jetbrains.kotlin.script.util.resolvers.DirectResolver
|
||||
import org.jetbrains.kotlin.script.util.resolvers.MavenResolver
|
||||
import java.io.File
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
@@ -9,7 +7,6 @@ import java.net.URLClassLoader
|
||||
import java.util.jar.Manifest
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
|
||||
private fun URL.toFile() =
|
||||
try {
|
||||
File(toURI().schemeSpecificPart)
|
||||
|
||||
Reference in New Issue
Block a user