use of org.jetbrains.jps.model.JpsDummyElement in project intellij-elixir by KronicDeth.
the class ElixirBuilder method doBuildWithMix.
private static void doBuildWithMix(ElixirTarget target, CompileContext context, JpsModule module, ElixirCompilerOptions compilerOptions) throws ProjectBuildException, IOException {
String mixPath = getMixExecutablePath(module.getProject());
if (mixPath == null) {
String errorMessage = "Mix path is not set.";
context.processMessage(new CompilerMessage(MIX_NAME, BuildMessage.Kind.ERROR, errorMessage));
throw new ProjectBuildException(errorMessage);
}
JpsSdk<JpsDummyElement> sdk = ElixirTargetBuilderUtil.getSdk(context, module);
String elixirPath = JpsElixirSdkType.getScriptInterpreterExecutable(sdk.getHomePath()).getAbsolutePath();
for (String contentRootUrl : module.getContentRootsList().getUrls()) {
String contentRootPath = new URL(contentRootUrl).getPath();
File contentRootDir = new File(contentRootPath);
File mixConfigFile = new File(contentRootDir, MIX_CONFIG_FILE_NAME);
if (!mixConfigFile.exists())
continue;
runMix(target, elixirPath, mixPath, contentRootPath, compilerOptions, context);
}
}
Aggregations