Rename KotlinVersion->KotlinCompilerVersion, move to module util.runtime
Rename to avoid confusion with the recently added kotlin.KotlinVersion
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.common;
|
||||
|
||||
public class KotlinVersion {
|
||||
// The value of this constant is generated by the build script
|
||||
// DON'T MODIFY IT
|
||||
public static final String VERSION = "@snapshot@";
|
||||
}
|
||||
+3
-3
@@ -16,16 +16,16 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.repl
|
||||
|
||||
import org.jetbrains.kotlin.cli.common.KotlinVersion
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
import javax.script.ScriptEngine
|
||||
import javax.script.ScriptEngineFactory
|
||||
|
||||
abstract class KotlinJsr223JvmScriptEngineFactoryBase : ScriptEngineFactory {
|
||||
|
||||
override fun getLanguageName(): String = "kotlin"
|
||||
override fun getLanguageVersion(): String = KotlinVersion.VERSION
|
||||
override fun getLanguageVersion(): String = KotlinCompilerVersion.VERSION
|
||||
override fun getEngineName(): String = "kotlin"
|
||||
override fun getEngineVersion(): String = KotlinVersion.VERSION
|
||||
override fun getEngineVersion(): String = KotlinCompilerVersion.VERSION
|
||||
override fun getExtensions(): List<String> = listOf("kts")
|
||||
override fun getMimeTypes(): List<String> = listOf("text/x-kotlin")
|
||||
override fun getNames(): List<String> = listOf("kotlin")
|
||||
|
||||
@@ -342,7 +342,7 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
|
||||
if (!arguments.version) return;
|
||||
|
||||
messageCollector.report(CompilerMessageSeverity.INFO,
|
||||
"Kotlin Compiler version " + KotlinVersion.VERSION,
|
||||
"Kotlin Compiler version " + KotlinCompilerVersion.VERSION,
|
||||
CompilerMessageLocation.NO_LOCATION);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ package org.jetbrains.kotlin.cli.jvm.repl
|
||||
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import org.jetbrains.kotlin.cli.common.KotlinVersion
|
||||
import org.jetbrains.kotlin.cli.jvm.repl.LineResult.*
|
||||
import org.jetbrains.kotlin.cli.jvm.repl.messages.unescapeLineBreaks
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||
import java.io.File
|
||||
import java.io.PrintWriter
|
||||
import java.util.*
|
||||
@@ -44,7 +44,7 @@ class ReplFromTerminal(
|
||||
|
||||
private fun doRun() {
|
||||
try {
|
||||
writer.printlnWelcomeMessage("Welcome to Kotlin version ${KotlinVersion.VERSION} " +
|
||||
writer.printlnWelcomeMessage("Welcome to Kotlin version ${KotlinCompilerVersion.VERSION} " +
|
||||
"(JRE ${System.getProperty("java.runtime.version")})")
|
||||
writer.printlnWelcomeMessage("Type :help for help, :quit for quit")
|
||||
var next = WhatNextAfterOneLine.READ_LINE
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ import kotlin.text.Regex;
|
||||
import org.intellij.lang.annotations.Language;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.cli.common.KotlinVersion;
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TestCaseWithTmpdir;
|
||||
import org.jetbrains.kotlin.utils.PathUtil;
|
||||
@@ -85,7 +85,7 @@ public abstract class KotlinIntegrationTestBase extends TestCaseWithTmpdir {
|
||||
content = normalizePath(content, tmpdir, "[Temp]");
|
||||
content = normalizePath(content, getCompilerLib(), "[CompilerLib]");
|
||||
content = normalizePath(content, getKotlinProjectHome(), "[KotlinProjectHome]");
|
||||
content = content.replaceAll(Pattern.quote(KotlinVersion.VERSION), "[KotlinVersion]");
|
||||
content = content.replaceAll(Pattern.quote(KotlinCompilerVersion.VERSION), "[KotlinVersion]");
|
||||
content = StringUtil.convertLineSeparators(content);
|
||||
return content;
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ import kotlin.text.Charsets;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.cli.common.CLICompiler;
|
||||
import org.jetbrains.kotlin.cli.common.ExitCode;
|
||||
import org.jetbrains.kotlin.cli.common.KotlinVersion;
|
||||
import org.jetbrains.kotlin.cli.js.K2JSCompiler;
|
||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler;
|
||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion;
|
||||
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion;
|
||||
import org.jetbrains.kotlin.serialization.deserialization.BinaryVersion;
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||
@@ -77,7 +77,7 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir {
|
||||
.replace(PathUtil.getKotlinPathsForDistDirectory().getHomePath().getAbsolutePath(), "$PROJECT_DIR$")
|
||||
.replace("expected version is " + version, "expected version is $ABI_VERSION$")
|
||||
.replace("\\", "/")
|
||||
.replace(KotlinVersion.VERSION, "$VERSION$");
|
||||
.replace(KotlinCompilerVersion.VERSION, "$VERSION$");
|
||||
|
||||
return normalizedOutputWithoutExitCode + exitCode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user