Package ideah.util

Examples of ideah.util.ProcessLauncher


            "-m", "AllImportsWithPkgs",
            path
        );
        args.addAll(otherFiles);
        try {
            ProcessLauncher launcher = new ProcessLauncher(false, null, args);
            String stdOut = launcher.getStdOut();
            SortedSet<String> localImports = new TreeSet<String>();
            SortedSet<String> externalImports = new TreeSet<String>();
            BufferedReader rdr = new BufferedReader(new StringReader(stdOut));
            parseLocals(localImports, rdr);
            parseLocals(externalImports, rdr);
View Full Code Here


                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));
        }
View Full Code Here

            return null;
        List<String> args = compiler.getCompileOptionsList(
            "-m", "ParseTree",
            virtualFile.getPath()
        );
        ProcessLauncher launcher = new ProcessLauncher(false, virtualFile.getInputStream(), args);
        String stdOut = launcher.getStdOut();
        if (stdOut.trim().isEmpty())
            return null;
        RangeFactory factory = new RangeFactory() {

            public IRange parse(String str) {
View Full Code Here

        }
        List<String> args = compiler.getCompileOptionsList(
            "-m", "CheckMain",
            file.getPath()
        );
        ProcessLauncher launcher = new ProcessLauncher(false, file.getInputStream(), args);
        String stdOut = launcher.getStdOut();
        return stdOut != null && stdOut.contains("t");
    }
View Full Code Here

            "-m", "AllImports",
            path
        );
        Map<Import, LineColRange> ranges = new HashMap<Import, LineColRange>();
        try {
            ProcessLauncher launcher = new ProcessLauncher(true, null, args);
            BufferedReader bf = new BufferedReader(new StringReader(launcher.getStdOut()));
            String line = bf.readLine();
            while (line != null) {
                if (line.startsWith(ProcessLauncher.NEW_MSG_INDICATOR)) {
                    String moduleName = bf.readLine();
                    if (moduleName == null)
View Full Code Here

        String ghcLib = null;
        try {
            String ghcCommandPath = GHCUtil.getGhcCommandPath(ghcHome);
            if (ghcCommandPath == null)
                return null;
            ProcessLauncher getLibdirLauncher = new ProcessLauncher(true, null, ghcCommandPath, "--print-libdir");
            ghcLib = getLibdirLauncher.getStdOut().trim();
        } catch (Exception e) {
            LOG.error(e);
        }
        return ghcLib;
    }
View Full Code Here

    @Nullable
    private static String suggestCabalPath(@Nullable String libPath) {
        String cabalExe = GHCUtil.getExeName("cabal");
        if (SystemInfo.isUnix) {
            try {
                ProcessLauncher getCabalDir = new ProcessLauncher(true, null, "which", "cabal");
                File cabal = new File(getCabalDir.getStdOut().trim(), cabalExe);
                if (cabal.isFile())
                    return cabal.getPath();
            } catch (Exception e) {
                LOG.error(e.getMessage());
            }
View Full Code Here

    public static String getGhcVersion(String homePath) {
        if (homePath == null || !new File(homePath).isDirectory()) {
            return null;
        }
        try {
            String output = new ProcessLauncher(
                false, null,
                homePath + File.separator + "bin" + File.separator + "ghc",
                "--numeric-version"
            ).getStdOut();
            return output.trim();
View Full Code Here

TOP

Related Classes of ideah.util.ProcessLauncher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.