Search in sources :

Example 1 with FileResolver

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

the class AbstractCopyTask method createRootSpec.

protected CopySpecInternal createRootSpec() {
    Instantiator instantiator = getInstantiator();
    FileResolver fileResolver = getFileResolver();
    return instantiator.newInstance(DefaultCopySpec.class, fileResolver, instantiator);
}
Also used : Instantiator(org.gradle.internal.reflect.Instantiator) FileResolver(org.gradle.api.internal.file.FileResolver)

Example 2 with FileResolver

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

the class Sync method createRootSpec.

@Override
protected CopySpecInternal createRootSpec() {
    Instantiator instantiator = getInstantiator();
    FileResolver fileResolver = getFileResolver();
    return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec());
}
Also used : Instantiator(org.gradle.internal.reflect.Instantiator) FileResolver(org.gradle.api.internal.file.FileResolver)

Example 3 with FileResolver

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

the class ValidatingTaskExecuter method execute.

public void execute(TaskInternal task, TaskStateInternal state, TaskExecutionContext context) {
    List<String> messages = Lists.newArrayList();
    FileResolver resolver = ((ProjectInternal) task.getProject()).getFileResolver();
    final TaskValidationContext validationContext = new DefaultTaskValidationContext(resolver, messages);
    try {
        context.getTaskProperties().validate(validationContext);
    } catch (Exception ex) {
        throw new TaskExecutionException(task, ex);
    }
    if (!messages.isEmpty()) {
        List<String> firstMessages = messages.subList(0, Math.min(5, messages.size()));
        if (!validationContext.getHighestSeverity().report(task, firstMessages, state)) {
            return;
        }
    }
    executer.execute(task, state, context);
}
Also used : TaskExecutionException(org.gradle.api.tasks.TaskExecutionException) DefaultTaskValidationContext(org.gradle.api.internal.tasks.DefaultTaskValidationContext) TaskValidationContext(org.gradle.api.internal.tasks.TaskValidationContext) DefaultTaskValidationContext(org.gradle.api.internal.tasks.DefaultTaskValidationContext) ProjectInternal(org.gradle.api.internal.project.ProjectInternal) FileResolver(org.gradle.api.internal.file.FileResolver) TaskExecutionException(org.gradle.api.tasks.TaskExecutionException)

Example 4 with FileResolver

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

the class GroovyCompile method getCompiler.

private Compiler<GroovyJavaJointCompileSpec> getCompiler(GroovyJavaJointCompileSpec spec) {
    if (compiler == null) {
        ProjectInternal projectInternal = (ProjectInternal) getProject();
        WorkerDaemonFactory workerDaemonFactory = getServices().get(WorkerDaemonFactory.class);
        IsolatedClassloaderWorkerFactory inProcessWorkerFactory = getServices().get(IsolatedClassloaderWorkerFactory.class);
        FileResolver fileResolver = getServices().get(FileResolver.class);
        GroovyCompilerFactory groovyCompilerFactory = new GroovyCompilerFactory(projectInternal, workerDaemonFactory, inProcessWorkerFactory, fileResolver);
        Compiler<GroovyJavaJointCompileSpec> delegatingCompiler = groovyCompilerFactory.newCompiler(spec);
        compiler = new CleaningGroovyCompiler(delegatingCompiler, getOutputs());
    }
    return compiler;
}
Also used : GroovyCompilerFactory(org.gradle.api.internal.tasks.compile.GroovyCompilerFactory) IsolatedClassloaderWorkerFactory(org.gradle.workers.internal.IsolatedClassloaderWorkerFactory) ProjectInternal(org.gradle.api.internal.project.ProjectInternal) GroovyJavaJointCompileSpec(org.gradle.api.internal.tasks.compile.GroovyJavaJointCompileSpec) DefaultGroovyJavaJointCompileSpec(org.gradle.api.internal.tasks.compile.DefaultGroovyJavaJointCompileSpec) CleaningGroovyCompiler(org.gradle.api.internal.tasks.compile.CleaningGroovyCompiler) FileResolver(org.gradle.api.internal.file.FileResolver) WorkerDaemonFactory(org.gradle.workers.internal.WorkerDaemonFactory)

Example 5 with FileResolver

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

the class Copy method createRootSpec.

@Override
protected CopySpecInternal createRootSpec() {
    Instantiator instantiator = getInstantiator();
    FileResolver fileResolver = getFileResolver();
    return instantiator.newInstance(DestinationRootCopySpec.class, fileResolver, super.createRootSpec());
}
Also used : Instantiator(org.gradle.internal.reflect.Instantiator) FileResolver(org.gradle.api.internal.file.FileResolver)

Aggregations

FileResolver (org.gradle.api.internal.file.FileResolver)8 Instantiator (org.gradle.internal.reflect.Instantiator)4 File (java.io.File)2 InstantiatorBackedObjectFactory (org.gradle.api.internal.model.InstantiatorBackedObjectFactory)2 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)2 DefaultFileCollectionFactory (org.gradle.api.internal.file.DefaultFileCollectionFactory)1 DefaultFileLookup (org.gradle.api.internal.file.DefaultFileLookup)1 FileCollectionFactory (org.gradle.api.internal.file.FileCollectionFactory)1 FileLookup (org.gradle.api.internal.file.FileLookup)1 HasScriptServices (org.gradle.api.internal.file.HasScriptServices)1 DefaultDirectoryFileTreeFactory (org.gradle.api.internal.file.collections.DefaultDirectoryFileTreeFactory)1 GradleUserHomeTemporaryFileProvider (org.gradle.api.internal.file.temp.GradleUserHomeTemporaryFileProvider)1 TemporaryFileProvider (org.gradle.api.internal.file.temp.TemporaryFileProvider)1 StartScriptGenerator (org.gradle.api.internal.plugins.StartScriptGenerator)1 DefaultTaskValidationContext (org.gradle.api.internal.tasks.DefaultTaskValidationContext)1 TaskValidationContext (org.gradle.api.internal.tasks.TaskValidationContext)1 CleaningGroovyCompiler (org.gradle.api.internal.tasks.compile.CleaningGroovyCompiler)1 DefaultGroovyJavaJointCompileSpec (org.gradle.api.internal.tasks.compile.DefaultGroovyJavaJointCompileSpec)1 GroovyCompilerFactory (org.gradle.api.internal.tasks.compile.GroovyCompilerFactory)1 GroovyJavaJointCompileSpec (org.gradle.api.internal.tasks.compile.GroovyJavaJointCompileSpec)1