Search in sources :

Example 1 with DefaultFileCollectionFactory

use of org.gradle.api.internal.file.DefaultFileCollectionFactory in project gradle by gradle.

the class DefaultExecActionFactory method immutableCopy.

@Override
public JavaForkOptionsInternal immutableCopy(JavaForkOptionsInternal options) {
    @SuppressWarnings("deprecation") Factory<PatternSet> nonCachingPatternSetFactory = PatternSets.getNonCachingPatternSetFactory();
    // NOTE: We do not want/need a decorated version of JavaForkOptions or JavaDebugOptions because
    // these immutable instances are held across builds and will retain classloaders/services in the decorated object
    DefaultFileCollectionFactory fileCollectionFactory = new DefaultFileCollectionFactory(fileResolver, DefaultTaskDependencyFactory.withNoAssociatedProject(), new DefaultDirectoryFileTreeFactory(), nonCachingPatternSetFactory, PropertyHost.NO_OP, FileSystems.getDefault());
    JavaForkOptionsInternal copy = new DefaultJavaForkOptions(fileResolver, fileCollectionFactory, new DefaultJavaDebugOptions());
    options.copyTo(copy);
    return new ImmutableJavaForkOptions(copy);
}
Also used : DefaultDirectoryFileTreeFactory(org.gradle.api.internal.file.collections.DefaultDirectoryFileTreeFactory) PatternSet(org.gradle.api.tasks.util.PatternSet) DefaultFileCollectionFactory(org.gradle.api.internal.file.DefaultFileCollectionFactory)

Example 2 with DefaultFileCollectionFactory

use of org.gradle.api.internal.file.DefaultFileCollectionFactory in project gradle by gradle.

the class DefaultExecActionFactory method root.

// Do not use this. It's here because some of the services this type needs are not easily accessed in certain cases and will be removed ay some point. Use one of the other methods instead
@Deprecated
public static DefaultExecActionFactory root(File gradleUserHome) {
    requireNonNull(gradleUserHome, "gradleUserHome");
    Factory<PatternSet> patternSetFactory = PatternSets.getNonCachingPatternSetFactory();
    FileResolver resolver = new DefaultFileLookup().getFileResolver();
    DefaultFileCollectionFactory fileCollectionFactory = new DefaultFileCollectionFactory(resolver, DefaultTaskDependencyFactory.withNoAssociatedProject(), new DefaultDirectoryFileTreeFactory(), patternSetFactory, PropertyHost.NO_OP, FileSystems.getDefault());
    GradleUserHomeDirProvider userHomeDirProvider = () -> gradleUserHome;
    TemporaryFileProvider temporaryFileProvider = new GradleUserHomeTemporaryFileProvider(userHomeDirProvider);
    return of(resolver, fileCollectionFactory, new InstantiatorBackedObjectFactory(DirectInstantiator.INSTANCE), new DefaultExecutorFactory(), new DefaultBuildCancellationToken(), temporaryFileProvider);
}
Also used : InstantiatorBackedObjectFactory(org.gradle.api.internal.model.InstantiatorBackedObjectFactory) DefaultFileLookup(org.gradle.api.internal.file.DefaultFileLookup) GradleUserHomeDirProvider(org.gradle.initialization.GradleUserHomeDirProvider) DefaultBuildCancellationToken(org.gradle.initialization.DefaultBuildCancellationToken) DefaultDirectoryFileTreeFactory(org.gradle.api.internal.file.collections.DefaultDirectoryFileTreeFactory) GradleUserHomeTemporaryFileProvider(org.gradle.api.internal.file.temp.GradleUserHomeTemporaryFileProvider) TemporaryFileProvider(org.gradle.api.internal.file.temp.TemporaryFileProvider) GradleUserHomeTemporaryFileProvider(org.gradle.api.internal.file.temp.GradleUserHomeTemporaryFileProvider) FileResolver(org.gradle.api.internal.file.FileResolver) PatternSet(org.gradle.api.tasks.util.PatternSet) DefaultFileCollectionFactory(org.gradle.api.internal.file.DefaultFileCollectionFactory) DefaultExecutorFactory(org.gradle.internal.concurrent.DefaultExecutorFactory)

Aggregations

DefaultFileCollectionFactory (org.gradle.api.internal.file.DefaultFileCollectionFactory)2 DefaultDirectoryFileTreeFactory (org.gradle.api.internal.file.collections.DefaultDirectoryFileTreeFactory)2 PatternSet (org.gradle.api.tasks.util.PatternSet)2 DefaultFileLookup (org.gradle.api.internal.file.DefaultFileLookup)1 FileResolver (org.gradle.api.internal.file.FileResolver)1 GradleUserHomeTemporaryFileProvider (org.gradle.api.internal.file.temp.GradleUserHomeTemporaryFileProvider)1 TemporaryFileProvider (org.gradle.api.internal.file.temp.TemporaryFileProvider)1 InstantiatorBackedObjectFactory (org.gradle.api.internal.model.InstantiatorBackedObjectFactory)1 DefaultBuildCancellationToken (org.gradle.initialization.DefaultBuildCancellationToken)1 GradleUserHomeDirProvider (org.gradle.initialization.GradleUserHomeDirProvider)1 DefaultExecutorFactory (org.gradle.internal.concurrent.DefaultExecutorFactory)1