The error message now tells the user about jps.kotlin.home

For TeamCity users
This commit is contained in:
Andrey Breslav
2013-05-29 21:28:26 +04:00
parent 6465abe7eb
commit 7ff1885e8e
2 changed files with 6 additions and 2 deletions
@@ -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));
}
@@ -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);
}
}