Permalink
Browse files

Rename KotlinVersion->KotlinCompilerVersion, move to module util.runtime

Rename to avoid confusion with the recently added kotlin.KotlinVersion
  • Loading branch information...
1 parent 65e01f2 commit 414daef001f8b3d400ed295e9e8b08c962a11bf3 @udalov udalov committed Dec 5, 2016
View
@@ -13,8 +13,8 @@
<property name="plugin.xml.versioned" value="${plugin.xml}.versioned"/>
<property name="plugin.xml.version.number" value="${build.number}"/>
- <property name="compiler.version.java" value="compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/KotlinVersion.java"/>
- <property name="compiler.version.java.bk" value="${version_substitute_dir}/KotlinVersion.java.bk"/>
+ <property name="compiler.version.java" value="core/util.runtime/src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java"/>
+ <property name="compiler.version.java.bk" value="${version_substitute_dir}/KotlinCompilerVersion.java.bk"/>
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned"/>
<property name="compiler.version.number" value="${build.number}"/>
@@ -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 @@ private void printVersionIfNeeded(@NotNull MessageCollector messageCollector, @N
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
@@ -33,7 +33,7 @@
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 @@ protected String normalizeOutput(@NotNull File testDataDir, @NotNull String cont
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 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 static String getNormalizedCompilerOutput(
.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;
}
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
+ * Copyright 2010-2016 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.
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package org.jetbrains.kotlin.cli.common;
+package org.jetbrains.kotlin.config;
-public class KotlinVersion {
+public class KotlinCompilerVersion {
// The value of this constant is generated by the build script
// DON'T MODIFY IT
public static final String VERSION = "@snapshot@";
@@ -40,7 +40,6 @@ import org.jetbrains.jps.model.module.JpsModule
import org.jetbrains.kotlin.build.GeneratedFile
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.build.isModuleMappingFile
-import org.jetbrains.kotlin.cli.common.KotlinVersion
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
@@ -53,6 +52,7 @@ import org.jetbrains.kotlin.compilerRunner.OutputItemsCollectorImpl
import org.jetbrains.kotlin.config.CompilerRunnerConstants
import org.jetbrains.kotlin.config.CompilerRunnerConstants.INTERNAL_ERROR_PREFIX
import org.jetbrains.kotlin.config.IncrementalCompilation
+import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.daemon.common.isDaemonEnabled
import org.jetbrains.kotlin.incremental.*
@@ -196,7 +196,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
return NOTHING_DONE
}
- messageCollector.report(INFO, "Kotlin JPS plugin version " + KotlinVersion.VERSION, CompilerMessageLocation.NO_LOCATION)
+ messageCollector.report(INFO, "Kotlin JPS plugin version " + KotlinCompilerVersion.VERSION, CompilerMessageLocation.NO_LOCATION)
val targetsWithoutOutputDir = targets.filter { it.outputDir == null }
if (targetsWithoutOutputDir.isNotEmpty()) {
@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.script.jsr223
-import org.jetbrains.kotlin.cli.common.KotlinVersion
+import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.junit.Assert
import org.junit.Test
import javax.script.ScriptEngine
@@ -31,15 +31,15 @@ class KotlinJsr223ScriptEngineIT {
Assert.assertNotNull(factory)
factory!!.apply {
Assert.assertEquals("kotlin", languageName)
- Assert.assertEquals(KotlinVersion.VERSION, languageVersion)
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, languageVersion)
Assert.assertEquals("kotlin", engineName)
- Assert.assertEquals(KotlinVersion.VERSION, engineVersion)
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, engineVersion)
Assert.assertEquals(listOf("kts"), extensions)
Assert.assertEquals(listOf("text/x-kotlin"), mimeTypes)
Assert.assertEquals(listOf("kotlin"), names)
Assert.assertEquals("obj.method(arg1, arg2, arg3)", getMethodCallSyntax("obj", "method", "arg1", "arg2", "arg3"))
Assert.assertEquals("print(\"Hello, world!\")", getOutputStatement("Hello, world!"))
- Assert.assertEquals(KotlinVersion.VERSION, getParameter(ScriptEngine.LANGUAGE_VERSION))
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, getParameter(ScriptEngine.LANGUAGE_VERSION))
val sep = System.getProperty("line.separator")
val prog = arrayOf("val x: Int = 3", "var y = x + 2")
Assert.assertEquals(prog.joinToString(sep) + sep, getProgram(*prog))
@@ -65,4 +65,4 @@ class KotlinJsr223ScriptEngineIT {
val res2 = engine.eval("x + 2")
Assert.assertEquals(5, res2)
}
-}
+}
@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.script.jsr223
-import org.jetbrains.kotlin.cli.common.KotlinVersion
+import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.junit.Assert
import org.junit.Test
import javax.script.ScriptEngine
@@ -31,15 +31,15 @@ class KotlinJsr223ScriptEngineIT {
Assert.assertNotNull(factory)
factory!!.apply {
Assert.assertEquals("kotlin", languageName)
- Assert.assertEquals(KotlinVersion.VERSION, languageVersion)
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, languageVersion)
Assert.assertEquals("kotlin", engineName)
- Assert.assertEquals(KotlinVersion.VERSION, engineVersion)
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, engineVersion)
Assert.assertEquals(listOf("kts"), extensions)
Assert.assertEquals(listOf("text/x-kotlin"), mimeTypes)
Assert.assertEquals(listOf("kotlin"), names)
Assert.assertEquals("obj.method(arg1, arg2, arg3)", getMethodCallSyntax("obj", "method", "arg1", "arg2", "arg3"))
Assert.assertEquals("print(\"Hello, world!\")", getOutputStatement("Hello, world!"))
- Assert.assertEquals(KotlinVersion.VERSION, getParameter(ScriptEngine.LANGUAGE_VERSION))
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, getParameter(ScriptEngine.LANGUAGE_VERSION))
val sep = System.getProperty("line.separator")
val prog = arrayOf("val x: Int = 3", "var y = x + 2")
Assert.assertEquals(prog.joinToString(sep) + sep, getProgram(*prog))
@@ -65,4 +65,4 @@ class KotlinJsr223ScriptEngineIT {
val res2 = engine.eval("x + 2")
Assert.assertEquals(5, res2)
}
-}
+}
@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.script.jsr223
-import org.jetbrains.kotlin.cli.common.KotlinVersion
+import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.junit.Assert
import org.junit.Test
import javax.script.ScriptEngine
@@ -31,15 +31,15 @@ class KotlinJsr223ScriptEngineIT {
Assert.assertNotNull(factory)
factory!!.apply {
Assert.assertEquals("kotlin", languageName)
- Assert.assertEquals(KotlinVersion.VERSION, languageVersion)
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, languageVersion)
Assert.assertEquals("kotlin", engineName)
- Assert.assertEquals(KotlinVersion.VERSION, engineVersion)
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, engineVersion)
Assert.assertEquals(listOf("kts"), extensions)
Assert.assertEquals(listOf("text/x-kotlin"), mimeTypes)
Assert.assertEquals(listOf("kotlin"), names)
Assert.assertEquals("obj.method(arg1, arg2, arg3)", getMethodCallSyntax("obj", "method", "arg1", "arg2", "arg3"))
Assert.assertEquals("print(\"Hello, world!\")", getOutputStatement("Hello, world!"))
- Assert.assertEquals(KotlinVersion.VERSION, getParameter(ScriptEngine.LANGUAGE_VERSION))
+ Assert.assertEquals(KotlinCompilerVersion.VERSION, getParameter(ScriptEngine.LANGUAGE_VERSION))
val sep = System.getProperty("line.separator")
val prog = arrayOf("val x: Int = 3", "var y = x + 2")
Assert.assertEquals(prog.joinToString(sep) + sep, getProgram(*prog))
@@ -65,4 +65,4 @@ class KotlinJsr223ScriptEngineIT {
val res2 = engine.eval("x + 2")
Assert.assertEquals(5, res2)
}
-}
+}
@@ -27,8 +27,8 @@
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.common.arguments.CommonCompilerArguments;
+import org.jetbrains.kotlin.config.KotlinCompilerVersion;
import org.jetbrains.kotlin.config.Services;
import java.io.File;
@@ -127,7 +127,7 @@
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
- getLog().info("Kotlin Compiler version " + KotlinVersion.VERSION);
+ getLog().info("Kotlin Compiler version " + KotlinCompilerVersion.VERSION);
if (!hasKotlinFilesInSources()) {
getLog().warn("No sources found skipping Kotlin compile");

0 comments on commit 414daef

Please sign in to comment.