Package org.gradle.process.internal

Examples of org.gradle.process.internal.ExecHandleBuilder.build()


        builder.args(getAllArgs());

        LOG.info(String.format("Execute in %s with: %s %s", builder.getWorkingDir(), builder.getExecutable(),
                builder.getArgs()));

        ExecHandle proc = builder.build();
        int exitValue = proc.start().waitForFinish().getExitValue();

        String output = outStream.toString();
        String error = errStream.toString();
        boolean failed = exitValue != 0;
View Full Code Here


                    builder.commandLine((Object[]) executionInfo.getCommandLineArguments());
                    builder.environment(executionInfo.getEnvironmentVariables());
                    output = new ByteArrayOutputStream();
                    builder.setStandardOutput(output);
                    builder.setErrorOutput(output);
                    execHandle = builder.build();
                    setExternalProcess(execHandle);

                    execHandle.start();
                }
                catch (Throwable e) {
View Full Code Here

                    builder.commandLine((Object[]) executionInfo.getCommandLineArguments());
                    builder.environment(executionInfo.getEnvironmentVariables());
                    output = new ByteArrayOutputStream();
                    builder.setStandardOutput(output);
                    builder.setErrorOutput(output);
                    execHandle = builder.build();
                    setExternalProcess(execHandle);

                    execHandle.start();
                } catch (Throwable e) {
                    LOGGER.error("Starting external process", e);
View Full Code Here

            execHandleBuilder.commandLine("/usr/libexec/java_home", "-V");
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            // verbose output is written to stderr for some reason
            execHandleBuilder.setErrorOutput(outputStream);
            execHandleBuilder.setStandardOutput(new ByteArrayOutputStream());
            execHandleBuilder.build().start().waitForFinish().assertNormalExitValue();
            return new OsXJavaHomeParser().parse(new InputStreamReader(new ByteArrayInputStream(outputStream.toByteArray())));
        } catch (Exception e) {
            throw new GradleException("Could not locate installed JVMs.", e);
        }
    }
View Full Code Here

        ExecHandleBuilder builder = new ExecHandleBuilder();
        builder.setWorkingDir(new File(".").getAbsolutePath());
        builder.setCommandLine(parameters.getEffectiveJavaExecutable(), "-version");
        builder.setStandardOutput(new ByteArrayOutputStream());
        builder.setErrorOutput(outputStream);
        builder.build().start().waitForFinish().assertNormalExitValue();

        JavaVersion javaVersion = parseJavaVersionCommandOutput(new BufferedReader(new InputStreamReader(new ByteArrayInputStream(outputStream.toByteArray()))));
        if (!javaVersion.isJava6Compatible()) {
            throw UnsupportedJavaRuntimeException.configuredWithUnsupportedVersion("Gradle", JavaVersion.VERSION_1_6, javaVersion);
        }
View Full Code Here

        ExecHandleBuilder builder = new ExecHandleBuilder();
        builder.setWorkingDir(spec.getWorkingDir());
        builder.setExecutable(executable);
        argumentsGenerator.collectArguments(spec, new ExecSpecBackedArgCollector(builder));
        builder.setIgnoreExitValue(true);
        return builder.build();
    }

    private void executeCompiler(ExecHandle handle) {
        handle.start();
        ExecResult result = handle.waitForFinish();
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.