improve error texts

This commit is contained in:
Maxim Manuylov
2012-07-22 21:31:38 +04:00
committed by Evgeny Gerashchenko
parent b6258beb87
commit 715f4ad0db
4 changed files with 11 additions and 12 deletions
@@ -66,7 +66,7 @@ public class OutdatedKotlinRuntimeNotification implements ModuleComponent {
String runtimeVersion = getRuntimeVersion(getKotlinRuntimeJar()); String runtimeVersion = getRuntimeVersion(getKotlinRuntimeJar());
if (runtimeVersion == null) return; // runtime is not present in project if (runtimeVersion == null) return; // runtime is not present in project
final String sdkVersion = getRuntimeVersion(getRuntimeFromSdk()); final String sdkVersion = getRuntimeVersion(getRuntimeFromSdk());
if (sdkVersion == null || "snapshot".equals(sdkVersion)) return; // plugin is run from sources, can't compare versions if (sdkVersion == null || "snapshot".equals(sdkVersion)) return; // plugin is run from sources or SDK is not configured for the module, can't compare versions
// user already clicked suppress // user already clicked suppress
if (sdkVersion.equals(PropertiesComponent.getInstance(myModule.getProject()).getValue(mySuppressedPropertyName))) return; if (sdkVersion.equals(PropertiesComponent.getInstance(myModule.getProject()).getValue(mySuppressedPropertyName))) return;
@@ -110,7 +110,7 @@ public class OutdatedKotlinRuntimeNotification implements ModuleComponent {
File runtimePath = PluginPathUtil.getRuntimePath(myModule); File runtimePath = PluginPathUtil.getRuntimePath(myModule);
if (runtimePath == null) { if (runtimePath == null) {
Messages.showErrorDialog(myModule.getProject(), Messages.showErrorDialog(myModule.getProject(),
"kotlin-runtime.jar is not found. Make sure plugin is properly installed.", "\"kotlin-runtime.jar\" is not found. Make sure Kotlin SDK is configured for module \"" + myModule.getName() + "\".",
"No Runtime Found"); "No Runtime Found");
return; return;
} }
@@ -37,15 +37,15 @@ public final class CompilerEnvironment {
VirtualFile mainOutput = compileContext.getModuleOutputDirectory(module); VirtualFile mainOutput = compileContext.getModuleOutputDirectory(module);
final VirtualFile outputDir = tests ? compileContext.getModuleOutputDirectoryForTests(module) : mainOutput; final VirtualFile outputDir = tests ? compileContext.getModuleOutputDirectoryForTests(module) : mainOutput;
File kotlinHome = KotlinSdkUtil.getSDKHomeFor(module); File kotlinHome = KotlinSdkUtil.getSDKHomeFor(module);
return new CompilerEnvironment(kotlinHome, outputDir); return new CompilerEnvironment(module.getName(), kotlinHome, outputDir);
} }
@Nullable @NotNull private final String moduleName;
private final File kotlinHome; @Nullable private final File kotlinHome;
@Nullable @Nullable private final VirtualFile output;
private final VirtualFile output;
public CompilerEnvironment(@Nullable File home, @Nullable VirtualFile output) { public CompilerEnvironment(@NotNull String moduleName, @Nullable File home, @Nullable VirtualFile output) {
this.moduleName = moduleName;
this.kotlinHome = home; this.kotlinHome = home;
this.output = output; this.output = output;
} }
@@ -71,8 +71,7 @@ public final class CompilerEnvironment {
compileContext.addMessage(ERROR, "[Internal Error] No output directory", "", -1, -1); compileContext.addMessage(ERROR, "[Internal Error] No output directory", "", -1, -1);
} }
if (kotlinHome == null) { if (kotlinHome == null) {
compileContext.addMessage(ERROR, "Cannot find kotlinc home. Make sure plugin is properly installed", "", -1, -1); compileContext.addMessage(ERROR, "Cannot find Kotlin SDK home. Make sure Kotlin SDK is configured for module \"" + moduleName + "\".", "", -1, -1);
} }
} }
} }
@@ -118,7 +118,7 @@ public class ConfigureKotlinLibraryNotificationProvider implements EditorNotific
File runtimePath = PluginPathUtil.getRuntimePath(module); File runtimePath = PluginPathUtil.getRuntimePath(module);
if (runtimePath == null) { if (runtimePath == null) {
Messages.showErrorDialog(myProject, "kotlin-runtime.jar is not found. Make sure plugin is properly installed.", Messages.showErrorDialog(myProject, "\"kotlin-runtime.jar\" is not found. Make sure Kotlin SDK is configured for module \"" + module.getName() + "\".",
"No Runtime Found"); "No Runtime Found");
return null; return null;
} }
@@ -113,7 +113,7 @@ public final class JsModuleSetUp {
File jsLibJarPath = PluginPathUtil.getJsLibJarPath(module); File jsLibJarPath = PluginPathUtil.getJsLibJarPath(module);
File jsLibJsPath = PluginPathUtil.getJsLibJsPath(module); File jsLibJsPath = PluginPathUtil.getJsLibJsPath(module);
if ((jsLibJarPath == null) || (jsLibJsPath == null)) { if ((jsLibJarPath == null) || (jsLibJsPath == null)) {
notifyFailure("JavaScript library not found. Make sure plugin is installed properly."); notifyFailure("JavaScript library not found. Make sure Kotlin SDK is configured for module \"" + module.getName() + "\".");
return false; return false;
} }