'Configure as Kotlin (java) modules' doesn't work properly if several modules depends on KotlinJavaRuntime

#KT-5595 Fixed
This commit is contained in:
Nikolay Krasko
2014-08-08 22:27:41 +04:00
parent 2dbc328693
commit 51aa70eba8
11 changed files with 147 additions and 8 deletions
@@ -147,7 +147,7 @@ public class KotlinJsModuleConfigurator extends KotlinWithLibraryConfigurator {
}
@NotNull
private static String getDefaultPathToJsFile(@NotNull Project project) {
protected String getDefaultPathToJsFile(@NotNull Project project) {
return FileUIUtils.createRelativePath(project, project.getBaseDir(), "script");
}
@@ -41,6 +41,7 @@ import java.io.File;
import static org.jetbrains.jet.plugin.configuration.ConfigureKotlinInProjectUtils.showInfoNotification;
public abstract class KotlinWithLibraryConfigurator implements KotlinProjectConfigurator {
public static final String DEFAULT_LIBRARY_DIR = "lib";
@NotNull
protected abstract String getLibraryName();
@@ -376,8 +377,8 @@ public abstract class KotlinWithLibraryConfigurator implements KotlinProjectConf
return !isProjectLibraryPresent(project) && !getFileInDir(getJarName(), defaultPath).exists();
}
protected static String getDefaultPathToJarFile(@NotNull Project project) {
return FileUIUtils.createRelativePath(project, project.getBaseDir(), "lib");
protected String getDefaultPathToJarFile(@NotNull Project project) {
return FileUIUtils.createRelativePath(project, project.getBaseDir(), DEFAULT_LIBRARY_DIR);
}
protected void showError(@NotNull String message) {
@@ -73,7 +73,7 @@ public abstract class CreateJavaLibraryDialogBase extends DialogWrapper {
@Nullable
public String getCopyIntoPath() {
return pathPanel.getPath();
return chooseLibraryPathPlace.isVisible() ? pathPanel.getPath() : null;
}
@Nullable
@@ -98,6 +98,7 @@ public abstract class CreateJavaScriptLibraryDialogBase extends DialogWrapper im
@Override
@Nullable
public String getCopyLibraryIntoPath() {
if (!copyLibraryPlace.isVisible()) return null;
return copyLibraryFilePanel.getPath();
}