Package org.gradle.process.internal

Examples of org.gradle.process.internal.JavaExecHandleBuilder


    private void expectWorkerProcessStarted() {
        context.checking(new Expectations() {{
            WorkerProcessBuilder builder = context.mock(WorkerProcessBuilder.class);
            ObjectConnection connection = context.mock(ObjectConnection.class);
            JavaExecHandleBuilder javaCommandBuilder = context.mock(JavaExecHandleBuilder.class);

            one(workerFactory).create();
            will(returnValue(builder));

            one(builder).worker(with(notNullValue(TestWorker.class)));
View Full Code Here


        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("Executing Sonar Runner with properties:\n[{}]", Joiner.on(", ").withKeyValueSeparator(": ").join(properties));
        }

        JavaExecHandleBuilder javaExec = new JavaExecHandleBuilder(getFileResolver());
        getForkOptions().copyTo(javaExec);

        FileCollection sonarRunnerConfiguration = getProject().getConfigurations().getAt(SonarRunnerExtension.SONAR_RUNNER_CONFIGURATION_NAME);

        Properties propertiesObject = new Properties();
        propertiesObject.putAll(properties);
        File propertyFile = new File(getTemporaryDir(), "sonar-project.properties");
        GUtil.saveProperties(propertiesObject, propertyFile);

        return javaExec
                .systemProperty("project.settings", propertyFile.getAbsolutePath())

                // This value is set in the properties file, but Sonar Runner 2.4 requires it on the command line as well
                // http://forums.gradle.org/gradle/topics/gradle-2-2-nightly-sonarrunner-task-fails-with-toolversion-2-4
                .systemProperty("project.home", getProject().getProjectDir().getAbsolutePath())
View Full Code Here

        if (antlrClasspath != null) {
            builder.applicationClasspath(antlrClasspath);
        }
        builder.sharedPackages(new String[] {"antlr", "org.antlr"});
        JavaExecHandleBuilder javaCommand = builder.getJavaCommand();
        javaCommand.setWorkingDir(workingDir);
        javaCommand.setMaxHeapSize(spec.getMaxHeapSize());
        javaCommand.systemProperty("ANTLR_DO_NOT_EXIT", "true");
        javaCommand.redirectErrorStream();
        return builder.worker(new AntlrWorkerServer(spec)).build();
    }
View Full Code Here

    @Override
    protected GradleHandle doStart() {
        return new ForkingGradleHandle(getResultAssertion(), getDefaultCharacterEncoding(), new Factory<JavaExecHandleBuilder>() {
            public JavaExecHandleBuilder create() {
                JavaExecHandleBuilder builder = new JavaExecHandleBuilder(TestFiles.resolver());
                builder.workingDir(getWorkingDir());
                Set<File> classpath = new DefaultModuleRegistry().getFullClasspath();
                builder.classpath(classpath);
                builder.setMain(Main.class.getName());
                builder.args(getAllArgs());
                return builder;
            }
        }).start();
    }
View Full Code Here

        Clock clock = new Clock();
        WorkerProcessBuilder builder = workerFactory.create();
        builder.setLogLevel(startParameter.getLogLevel()); // NOTE: might make sense to respect per-compile-task log level
        builder.applicationClasspath(forkOptions.getClasspath());
        builder.sharedPackages(forkOptions.getSharedPackages());
        JavaExecHandleBuilder javaCommand = builder.getJavaCommand();
        javaCommand.setMinHeapSize(forkOptions.getMinHeapSize());
        javaCommand.setMaxHeapSize(forkOptions.getMaxHeapSize());
        javaCommand.setJvmArgs(forkOptions.getJvmArgs());
        javaCommand.setWorkingDir(workingDir);
        WorkerProcess process = builder.worker(new CompilerDaemonServer()).setBaseName("Gradle Compiler Daemon").build();
        process.start();

        CompilerDaemonServerProtocol server = process.getConnection().addOutgoing(CompilerDaemonServerProtocol.class);
        CompilerDaemonClient client = new CompilerDaemonClient(forkOptions, process, server);
View Full Code Here

        builder.setBaseName("Gradle Rhino Worker");
        builder.setLogLevel(logLevel);
        builder.applicationClasspath(rhinoClasspath);
        builder.sharedPackages("org.mozilla.javascript");

        JavaExecHandleBuilder javaCommand = builder.getJavaCommand();
        if (javaExecSpecAction != null) {
            javaExecSpecAction.execute(javaCommand);
        }

        WorkerProcess workerProcess = builder.worker(new RhinoServer<R, P>(workerSpec)).build();
View Full Code Here

TOP

Related Classes of org.gradle.process.internal.JavaExecHandleBuilder

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.