Search in sources :

Example 1 with DefaultJavaForkOptions

use of org.gradle.process.internal.DefaultJavaForkOptions in project gradle by gradle.

the class DaemonForkOptionsBuilder method buildJavaForkOptions.

private ImmutableJavaForkOptions buildJavaForkOptions() {
    JavaForkOptionsInternal delegate = new DefaultJavaForkOptions(fileResolver);
    javaForkOptions.copyTo(delegate);
    return new ImmutableJavaForkOptions(delegate);
}
Also used : DefaultJavaForkOptions(org.gradle.process.internal.DefaultJavaForkOptions) JavaForkOptionsInternal(org.gradle.process.internal.JavaForkOptionsInternal)

Example 2 with DefaultJavaForkOptions

use of org.gradle.process.internal.DefaultJavaForkOptions in project gradle by gradle.

the class DefaultWorkerExecutor method toDaemonOptions.

private DaemonForkOptions toDaemonOptions(Class<?> actionClass, Iterable<Class<?>> paramClasses, JavaForkOptions userForkOptions, Iterable<File> classpath) {
    ImmutableSet.Builder<File> classpathBuilder = ImmutableSet.builder();
    ImmutableSet.Builder<String> sharedPackagesBuilder = ImmutableSet.builder();
    sharedPackagesBuilder.add("javax.inject");
    if (classpath != null) {
        classpathBuilder.addAll(classpath);
    }
    addVisibilityFor(actionClass, classpathBuilder, sharedPackagesBuilder, true);
    for (Class<?> paramClass : paramClasses) {
        addVisibilityFor(paramClass, classpathBuilder, sharedPackagesBuilder, false);
    }
    Iterable<File> daemonClasspath = classpathBuilder.build();
    Iterable<String> daemonSharedPackages = sharedPackagesBuilder.build();
    JavaForkOptions forkOptions = new DefaultJavaForkOptions(fileResolver);
    userForkOptions.copyTo(forkOptions);
    forkOptions.setWorkingDir(workerDirectoryProvider.getIdleWorkingDirectory());
    return new DaemonForkOptionsBuilder(fileResolver).javaForkOptions(forkOptions).classpath(daemonClasspath).sharedPackages(daemonSharedPackages).keepAliveMode(KeepAliveMode.DAEMON).build();
}
Also used : DefaultJavaForkOptions(org.gradle.process.internal.DefaultJavaForkOptions) ImmutableSet(com.google.common.collect.ImmutableSet) DefaultJavaForkOptions(org.gradle.process.internal.DefaultJavaForkOptions) JavaForkOptions(org.gradle.process.JavaForkOptions) File(java.io.File)

Aggregations

DefaultJavaForkOptions (org.gradle.process.internal.DefaultJavaForkOptions)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 File (java.io.File)1 JavaForkOptions (org.gradle.process.JavaForkOptions)1 JavaForkOptionsInternal (org.gradle.process.internal.JavaForkOptionsInternal)1