Search in sources :

Example 1 with WorkerProcessBuilder

use of org.gradle.process.internal.worker.WorkerProcessBuilder in project gradle by gradle.

the class PlayApplicationRunner method createWorkerProcess.

private static WorkerProcess createWorkerProcess(File workingDir, WorkerProcessFactory workerFactory, PlayRunSpec spec, VersionedPlayRunAdapter adapter) {
    WorkerProcessBuilder builder = workerFactory.create(new PlayWorkerServer(spec, adapter));
    builder.setBaseName("Gradle Play Worker");
    builder.sharedPackages("org.gradle.play.internal.run");
    JavaExecHandleBuilder javaCommand = builder.getJavaCommand();
    javaCommand.setWorkingDir(workingDir);
    javaCommand.setMinHeapSize(spec.getForkOptions().getMemoryInitialSize());
    javaCommand.setMaxHeapSize(spec.getForkOptions().getMemoryMaximumSize());
    javaCommand.setJvmArgs(spec.getForkOptions().getJvmArgs());
    return builder.build();
}
Also used : JavaExecHandleBuilder(org.gradle.process.internal.JavaExecHandleBuilder) WorkerProcessBuilder(org.gradle.process.internal.worker.WorkerProcessBuilder)

Example 2 with WorkerProcessBuilder

use of org.gradle.process.internal.worker.WorkerProcessBuilder in project gradle by gradle.

the class ForkingTestClassProcessor method forkProcess.

RemoteTestClassProcessor forkProcess() {
    WorkerProcessBuilder builder = workerFactory.create(new TestWorker(processorFactory));
    builder.setBaseName("Gradle Test Executor");
    builder.setImplementationClasspath(getTestWorkerImplementationClasspath());
    builder.applicationClasspath(classPath);
    options.copyTo(builder.getJavaCommand());
    buildConfigAction.execute(builder);
    workerProcess = builder.build();
    workerProcess.start();
    ObjectConnection connection = workerProcess.getConnection();
    connection.useParameterSerializers(TestEventSerializer.create());
    connection.addIncoming(TestResultProcessor.class, resultProcessor);
    RemoteTestClassProcessor remoteProcessor = connection.addOutgoing(RemoteTestClassProcessor.class);
    connection.connect();
    remoteProcessor.startProcessing();
    return remoteProcessor;
}
Also used : WorkerProcessBuilder(org.gradle.process.internal.worker.WorkerProcessBuilder) ObjectConnection(org.gradle.internal.remote.ObjectConnection)

Aggregations

WorkerProcessBuilder (org.gradle.process.internal.worker.WorkerProcessBuilder)2 ObjectConnection (org.gradle.internal.remote.ObjectConnection)1 JavaExecHandleBuilder (org.gradle.process.internal.JavaExecHandleBuilder)1