Skip to content

Commit

Permalink
Land #855: Use SmallIDE setting for SDK path for elixir path
Browse files Browse the repository at this point in the history
  • Loading branch information
KronicDeth committed Oct 19, 2017
2 parents f0f183f + efcd574 commit 4ce77ac
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/org/elixir_lang/mix/runner/MixRunningStateUtil.java
Expand Up @@ -22,6 +22,7 @@
import org.elixir_lang.jps.model.JpsElixirSdkType;
import org.elixir_lang.jps.model.JpsErlangSdkType;
import org.elixir_lang.mix.settings.MixSettings;
import org.elixir_lang.sdk.elixir.ForSmallIdes;
import org.elixir_lang.sdk.elixir.Type;
import org.elixir_lang.utils.ElixirExternalToolsNotificationListener;
import org.jetbrains.annotations.NotNull;
Expand All @@ -31,6 +32,7 @@
import java.nio.file.Paths;

import static org.apache.commons.lang.StringUtils.isBlank;
import static org.elixir_lang.sdk.ProcessOutput.isSmallIde;
import static org.elixir_lang.sdk.elixir.Type.addDocumentationPaths;
import static org.elixir_lang.sdk.elixir.Type.addSourcePaths;
import static org.elixir_lang.sdk.elixir.Type.putDefaultErlangSdk;
Expand Down Expand Up @@ -243,7 +245,9 @@ static OSProcessHandler runMix(Project project, GeneralCommandLine commandLine)
new Notification(
"Mix run configuration",
"Mix settings",
"Mix executable path is " + (isEmpty ? "empty" : "not specified correctly") + "<br><a href='configure'>Configure</a></br>",
"Mix executable path, elixir executable path, or erl executable path is " +
(isEmpty ? "empty" : "not specified correctly") +
"<br><a href='configure'>Configure</a></br>",
NotificationType.ERROR,
new ElixirExternalToolsNotificationListener(project)
)
Expand Down Expand Up @@ -302,6 +306,17 @@ private static void setElixir(@NotNull GeneralCommandLine commandLine,
commandLine.addParameter("-extra");
}
}
} else if (isSmallIde()) {
String sdkHome = ForSmallIdes.getSdkHome(project);
String elixir;

if (sdkHome != null) {
elixir = JpsElixirSdkType.getScriptInterpreterExecutable(sdkHome).toString();
} else {
elixir = JpsElixirSdkType.getExecutableFileName("elixir");
}

commandLine.setExePath(elixir);
}
} else {
String elixir = JpsElixirSdkType.getExecutableFileName("elixir");
Expand Down

0 comments on commit 4ce77ac

Please sign in to comment.