final RunConfiguration runConfig = scope.getUserData(CompileStepBeforeRun.RUN_CONFIGURATION);
if (runConfig == null) {
throw new ExecutionException("'Run Configuration' not found. If you're trying to compile without running, that's not yet supported");
}
final RustConfiguration rustConfiguration = (RustConfiguration) runConfig;
final CompilerModuleExtension compilerModuleExtension = CompilerModuleExtension.getInstance(rustConfiguration.getModules()[0]);
if (compilerModuleExtension == null) {
throw new ExecutionException("Cannot find compiler module extension from module");
}
final String outputPathUrl = CompilerPaths.getModuleOutputPath(rustConfiguration.getModules()[0], false);
File outputPathFile = new File(outputPathUrl);
if (!outputPathFile.exists()) {
if (!outputPathFile.mkdirs()) {
throw new ExecutionException("Cannot create output path '" + outputPathUrl + "'");
}
}
cmdLine.setWorkDirectory(new File(project.getBasePath()));
cmdLine.setExePath(RustSdkUtil.testRustSdk(defaultSdk.getHomePath()).pathRustc);
cmdLine.addParameter(rustConfiguration.mainFile);
cmdLine.addParameters("-o", outputPathUrl.concat("/").concat(rustConfiguration.getName()));
final Process process = cmdLine.createProcess();
return new OSProcessHandler(process, null, mySystemCharset) {
@Override