Log version in JPS plugin
CompilerVersion.java is moved to cli-common (shared between compiler and JPS plugin) and renamed to KotlinVersion This is needed because on TeamCity a JPS plugin is configured separately from the compiler, so it may happen that JPS plugin version X tries to run compiler version X+100, and causes trouble.
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
<property name="plugin.xml.bk" value="${plugin.xml}.bk"/>
|
<property name="plugin.xml.bk" value="${plugin.xml}.bk"/>
|
||||||
<property name="plugin.xml.versioned" value="${plugin.xml}.versioned" />
|
<property name="plugin.xml.versioned" value="${plugin.xml}.versioned" />
|
||||||
|
|
||||||
<property name="compiler.version.java" value="compiler/cli/src/org/jetbrains/jet/cli/common/CompilerVersion.java"/>
|
<property name="compiler.version.java" value="compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/KotlinVersion.java"/>
|
||||||
<property name="compiler.version.java.bk" value="${compiler.version.java}.bk"/>
|
<property name="compiler.version.java.bk" value="${compiler.version.java}.bk"/>
|
||||||
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned" />
|
<property name="compiler.version.java.versioned" value="${compiler.version.java}.versioned" />
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.cli.common;
|
package org.jetbrains.jet.cli.common;
|
||||||
|
|
||||||
public class CompilerVersion {
|
public class KotlinVersion {
|
||||||
// The value of this constant is generated by the build script
|
// The value of this constant is generated by the build script
|
||||||
// DON'T MODIFY IT
|
// DON'T MODIFY IT
|
||||||
public static final String VERSION = "@snapshot@";
|
public static final String VERSION = "@snapshot@";
|
||||||
@@ -157,7 +157,7 @@ public abstract class CLICompiler<A extends CompilerArguments> {
|
|||||||
@NotNull MessageRenderer messageRenderer) {
|
@NotNull MessageRenderer messageRenderer) {
|
||||||
if (arguments.isVersion()) {
|
if (arguments.isVersion()) {
|
||||||
String versionMessage = messageRenderer.render(CompilerMessageSeverity.INFO,
|
String versionMessage = messageRenderer.render(CompilerMessageSeverity.INFO,
|
||||||
"Kotlin Compiler version " + CompilerVersion.VERSION,
|
"Kotlin Compiler version " + KotlinVersion.VERSION,
|
||||||
CompilerMessageLocation.NO_LOCATION);
|
CompilerMessageLocation.NO_LOCATION);
|
||||||
errStream.println(versionMessage);
|
errStream.println(versionMessage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
|||||||
import com.intellij.util.Function;
|
import com.intellij.util.Function;
|
||||||
import com.intellij.util.containers.ContainerUtil;
|
import com.intellij.util.containers.ContainerUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.cli.common.KotlinVersion;
|
||||||
import org.jetbrains.jet.cli.common.messages.CompilerMessageLocation;
|
import org.jetbrains.jet.cli.common.messages.CompilerMessageLocation;
|
||||||
import org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity;
|
import org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity;
|
||||||
import org.jetbrains.jet.cli.common.messages.MessageCollector;
|
import org.jetbrains.jet.cli.common.messages.MessageCollector;
|
||||||
@@ -39,6 +40,7 @@ import java.util.Collection;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity.EXCEPTION;
|
import static org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity.EXCEPTION;
|
||||||
|
import static org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity.INFO;
|
||||||
import static org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity.WARNING;
|
import static org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity.WARNING;
|
||||||
|
|
||||||
public class KotlinBuilder extends ModuleLevelBuilder {
|
public class KotlinBuilder extends ModuleLevelBuilder {
|
||||||
@@ -69,9 +71,10 @@ public class KotlinBuilder extends ModuleLevelBuilder {
|
|||||||
DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder,
|
DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder,
|
||||||
OutputConsumer outputConsumer
|
OutputConsumer outputConsumer
|
||||||
) throws ProjectBuildException, IOException {
|
) throws ProjectBuildException, IOException {
|
||||||
|
|
||||||
MessageCollector messageCollector = new MessageCollectorAdapter(context);
|
MessageCollector messageCollector = new MessageCollectorAdapter(context);
|
||||||
|
|
||||||
|
messageCollector.report(INFO, "Kotlin JPS plugin version " + KotlinVersion.VERSION, CompilerMessageLocation.NO_LOCATION);
|
||||||
|
|
||||||
if (chunk.getModules().size() > 1) {
|
if (chunk.getModules().size() > 1) {
|
||||||
// We do not support circular dependencies, but if they are present, we should not break the build,
|
// We do not support circular dependencies, but if they are present, we should not break the build,
|
||||||
// so we simply yield a warning and report NOTHING_DONE
|
// so we simply yield a warning and report NOTHING_DONE
|
||||||
|
|||||||
Reference in New Issue
Block a user