Search in sources :

Example 1 with PathToFileResolver

use of org.gradle.internal.file.PathToFileResolver in project gradle by gradle.

the class DefaultTaskExecutionPlan method getResolvedTaskMutationInfo.

private TaskMutationInfo getResolvedTaskMutationInfo(TaskInfo taskInfo) {
    TaskInternal task = taskInfo.getTask();
    TaskMutationInfo taskMutationInfo = taskMutations.get(taskInfo);
    if (!taskMutationInfo.resolved) {
        ProjectInternal project = (ProjectInternal) task.getProject();
        ServiceRegistry serviceRegistry = project.getServices();
        PathToFileResolver resolver = serviceRegistry.get(PathToFileResolver.class);
        PropertyWalker propertyWalker = serviceRegistry.get(PropertyWalker.class);
        TaskProperties taskProperties = DefaultTaskProperties.resolve(propertyWalker, resolver, task);
        taskMutationInfo.outputPaths.addAll(getOutputPaths(canonicalizedFileCache, taskInfo, taskProperties.getOutputFiles(), taskProperties.getLocalStateFiles()));
        taskMutationInfo.destroyablePaths.addAll(getDestroyablePaths(canonicalizedFileCache, taskInfo, taskProperties.getDestroyableFiles()));
        taskMutationInfo.hasFileInputs = !taskProperties.getInputFileProperties().isEmpty();
        taskMutationInfo.hasOutputs = taskProperties.hasDeclaredOutputs();
        taskMutationInfo.hasLocalState = !taskProperties.getLocalStateFiles().isEmpty();
        taskMutationInfo.resolved = true;
    }
    return taskMutationInfo;
}
Also used : PathToFileResolver(org.gradle.internal.file.PathToFileResolver) PropertyWalker(org.gradle.api.internal.tasks.properties.PropertyWalker) TaskInternal(org.gradle.api.internal.TaskInternal) ProjectInternal(org.gradle.api.internal.project.ProjectInternal) TaskProperties(org.gradle.api.internal.tasks.execution.TaskProperties) DefaultTaskProperties(org.gradle.api.internal.tasks.execution.DefaultTaskProperties) ServiceRegistry(org.gradle.internal.service.ServiceRegistry)

Aggregations

TaskInternal (org.gradle.api.internal.TaskInternal)1 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)1 DefaultTaskProperties (org.gradle.api.internal.tasks.execution.DefaultTaskProperties)1 TaskProperties (org.gradle.api.internal.tasks.execution.TaskProperties)1 PropertyWalker (org.gradle.api.internal.tasks.properties.PropertyWalker)1 PathToFileResolver (org.gradle.internal.file.PathToFileResolver)1 ServiceRegistry (org.gradle.internal.service.ServiceRegistry)1