From 7ff1885e8ea65c95ab42cc2e5721f2b6ef4ba9ce Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 29 May 2013 21:28:26 +0400 Subject: [PATCH] The error message now tells the user about jps.kotlin.home For TeamCity users --- compiler/util/src/org/jetbrains/jet/utils/PathUtil.java | 4 +++- .../jetbrains/jet/compiler/runner/CompilerEnvironment.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/util/src/org/jetbrains/jet/utils/PathUtil.java b/compiler/util/src/org/jetbrains/jet/utils/PathUtil.java index cbafebff153..0c7f7924327 100644 --- a/compiler/util/src/org/jetbrains/jet/utils/PathUtil.java +++ b/compiler/util/src/org/jetbrains/jet/utils/PathUtil.java @@ -27,6 +27,8 @@ import java.io.File; public class PathUtil { + public static final String JPS_KOTLIN_HOME_PROPERTY = "jps.kotlin.home"; + public static final String JS_LIB_JAR_NAME = "kotlin-jslib.jar"; public static final String JS_LIB_JS_NAME = "kotlinEcma3.js"; public static final String JDK_ANNOTATIONS_JAR = "kotlin-jdk-annotations.jar"; @@ -46,7 +48,7 @@ public class PathUtil { public static KotlinPaths getKotlinPathsForJpsPlugin() { // When JPS is run on TeamCity, it can not rely on Kotlin plugin layout, // so the path to Kotlin is specified in a system property - String jpsKotlinHome = System.getProperty("jps.kotlin.home"); + String jpsKotlinHome = System.getProperty(JPS_KOTLIN_HOME_PROPERTY); if (jpsKotlinHome != null) { return new KotlinPathsFromHomeDir(new File(jpsKotlinHome)); } diff --git a/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerEnvironment.java b/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerEnvironment.java index c2bc4431392..a633c4f5f24 100644 --- a/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerEnvironment.java +++ b/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerEnvironment.java @@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.cli.common.messages.MessageCollector; import org.jetbrains.jet.utils.KotlinPaths; +import org.jetbrains.jet.utils.PathUtil; import java.io.File; @@ -61,7 +62,8 @@ public final class CompilerEnvironment { messageCollector.report(ERROR, "[Internal Error] No output directory", NO_LOCATION); } if (!kotlinPaths.getHomePath().exists()) { - messageCollector.report(ERROR, "Cannot find kotlinc home: " + kotlinPaths.getHomePath() + ". Make sure plugin is properly installed", NO_LOCATION); + messageCollector.report(ERROR, "Cannot find kotlinc home: " + kotlinPaths.getHomePath() + ". Make sure plugin is properly installed, " + + "or specify " + PathUtil.JPS_KOTLIN_HOME_PROPERTY + " system property", NO_LOCATION); } }