Do not infer artifact version from build.txt #KT-21150
This commit is contained in:
@@ -63,6 +63,4 @@ public interface KotlinPaths {
|
||||
@NotNull
|
||||
File getCompilerPath();
|
||||
|
||||
@NotNull
|
||||
File getBuildNumberFile();
|
||||
}
|
||||
|
||||
@@ -112,12 +112,6 @@ public class KotlinPathsFromHomeDir implements KotlinPaths {
|
||||
return getLibraryFile(PathUtil.KOTLIN_COMPILER_JAR);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public File getBuildNumberFile() {
|
||||
return new File(homePath, "build.txt");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private File getLibraryFile(@NotNull String fileName) {
|
||||
return new File(getLibPath(), fileName);
|
||||
|
||||
@@ -41,6 +41,7 @@ import com.intellij.util.indexing.ScalarIndexExtension
|
||||
import com.intellij.util.text.VersionComparatorUtil
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.config.JvmTarget
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
import org.jetbrains.kotlin.idea.KotlinPluginUtil
|
||||
import org.jetbrains.kotlin.idea.configuration.*
|
||||
import org.jetbrains.kotlin.idea.framework.JavaRuntimeDetectionUtil
|
||||
@@ -213,17 +214,12 @@ enum class LibraryJarDescriptor(val jarName: String,
|
||||
fun getPathInPlugin() = getPath(PathUtil.kotlinPathsForIdeaPlugin)
|
||||
}
|
||||
|
||||
fun bundledRuntimeVersion(): String {
|
||||
return bundledRuntimeBuildNumber ?: pluginRuntimeVersion(KotlinPluginUtil.getPluginVersion())
|
||||
}
|
||||
fun bundledRuntimeVersion(): String = KotlinCompilerVersion.VERSION
|
||||
|
||||
private val bundledRuntimeBuildNumber: String? by lazy {
|
||||
val file = PathUtil.kotlinPathsForIdeaPlugin.buildNumberFile
|
||||
if (file.exists()) file.readText().trim() else null
|
||||
}
|
||||
|
||||
private val PLUGIN_VERSIONS_SEPARATORS = arrayOf("Idea", "IJ", "release", "dev", "Studio")
|
||||
|
||||
// TODO: Used only in tests, can be removed
|
||||
fun pluginRuntimeVersion(pluginVersion: String): String {
|
||||
var placeToSplit = -1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user