public static List<GHCMessage> compile( VirtualFile output, String fileName, @NotNull Module module, boolean tests) { try { CompilerLocation compiler = CompilerLocation.get(module); if (compiler == null) return Collections.emptyList(); List<String> args = compiler.getCompileOptionsList( "-m", "Compile", "-s", GHCUtil.rootsAsString(module, tests)); if (output != null) { args.addAll(Arrays.asList("-o", output.getPath())); } args.add(fileName); ProcessLauncher launcher = new ProcessLauncher(false, null, args); String stdOut = launcher.getStdOut(); return parseMessages(stdOut); } catch (Exception ex) { LOG.error(ex); return Collections.singletonList(new GHCMessage(ex.toString(), fileName)); } }
GHCDir(String name) { this.name = name; this.version = GHCUtil.getVersion(name); }