Examples of ProcessLauncher


Examples of com.alphacsp.cit.exec.ProcessLauncher

            throw new RuntimeException("This class (" + UnixExecutableCalculation.class + ") runs only on unix or cygwin!");
        }

        checkIntegrity(context);

        ProcessLauncher scriptLanucher = new DefaultProcessLauncher();
        scriptLanucher.addCommand("which");
        scriptLanucher.addCommand(getExecutableName());
        Process process = scriptLanucher.exec();
        String output = ProcessUtils.readOutput(process).trim();
        int exitCode = process.exitValue();
        if (exitCode != 0 || output.length() == 0) {
            throw new ValidationException("Executable " + getExecutableName() + " was not found!");
        }
View Full Code Here

Examples of com.alphacsp.cit.exec.ProcessLauncher

    public void validate(EnvironmentVariableContext environmentVariableContext) throws ValidationException {
        VariableValue varValue = environmentVariableContext.getVariableValue();
        String varName = environmentVariableContext.getVariableName();

        String output;
        ProcessLauncher processLauncher = new JavaLauncher(varValue.getAsFile());
        Map<String, String> environmentVariables = environmentVariableContext.getEnvironment().getVars(RenderHint.native_os);
        processLauncher.addEnvironmentVariables(environmentVariables);
        processLauncher.addCommand("-version");
        Process process = processLauncher.exec();
        output = ProcessUtils.readOutput(process);

        if (output == null) {
            throw new ValidationException("can not validate " + varName + ", java process returned no output!");
        }
View Full Code Here

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

Examples of ideah.util.ProcessLauncher

                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

Examples of ideah.util.ProcessLauncher

            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

Examples of ideah.util.ProcessLauncher

        }
        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

Examples of ideah.util.ProcessLauncher

            "-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

Examples of ideah.util.ProcessLauncher

        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

Examples of ideah.util.ProcessLauncher

    @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

Examples of ideah.util.ProcessLauncher

    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
Copyright © 2018 www.massapi.com. 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.