J2K PathUtil: convert and prettify

This commit is contained in:
Alexander Udalov
2017-07-05 19:24:37 +03:00
parent 3beb6a86f7
commit 46a01ec131
28 changed files with 158 additions and 178 deletions
@@ -24,7 +24,6 @@ import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.projectRoots.JavaSdkType
import com.intellij.openapi.projectRoots.JdkUtil
import com.intellij.openapi.projectRoots.SimpleJavaSdkType
import com.intellij.openapi.roots.ModuleRootManager
import com.intellij.openapi.roots.OrderEnumerator
@@ -68,7 +67,7 @@ class KotlinConsoleKeeper(val project: Project) {
// use to debug repl process
//paramList.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
val kotlinPaths = PathUtil.getKotlinPathsForIdeaPlugin()
val kotlinPaths = PathUtil.kotlinPathsForIdeaPlugin
val replClassPath = listOf(kotlinPaths.compilerPath, kotlinPaths.reflectPath, kotlinPaths.stdlibPath, kotlinPaths.scriptRuntimePath)
.joinToString(File.pathSeparator) { it.absolutePath }
@@ -112,4 +111,4 @@ class KotlinConsoleKeeper(val project: Project) {
companion object {
@JvmStatic fun getInstance(project: Project) = ServiceManager.getService(project, KotlinConsoleKeeper::class.java)
}
}
}
@@ -44,7 +44,7 @@ class KotlinJsr223JvmScriptEngine4Idea(
) : KotlinJsr223JvmScriptEngineBase(factory) {
private val daemon by lazy {
val path = PathUtil.getKotlinPathsForIdeaPlugin().compilerPath
val path = PathUtil.kotlinPathsForIdeaPlugin.compilerPath
assert(path.exists())
val compilerId = CompilerId.makeCompilerId(path)
val daemonOptions = configureDaemonOptions()
@@ -58,7 +58,7 @@ fun classpathFromClassloader(classLoader: ClassLoader): List<File>? =
private val kotlinCompilerJar: File by lazy {
// highest prio - explicit property
System.getProperty("kotlin.compiler.jar")?.let(::File)?.takeIf(File::exists)
?: PathUtil.getKotlinPathsForIdeaPlugin().compilerPath
?: PathUtil.kotlinPathsForIdeaPlugin.compilerPath
?: throw FileNotFoundException("Cannot find kotlin compiler jar, set kotlin.compiler.jar property to proper location")
}
@@ -83,4 +83,4 @@ private val kotlinScriptRuntimeJar: File? by lazy {
?: File(kotlinCompilerJar.parentFile, KOTLIN_JAVA_SCRIPT_RUNTIME_JAR).takeIf(File::exists)
}
private val kotlinScriptStandardJars by lazy { listOf(kotlinStdlibJar, kotlinScriptRuntimeJar) }
private val kotlinScriptStandardJars by lazy { listOf(kotlinStdlibJar, kotlinScriptRuntimeJar) }