use of org.gradle.api.internal.changedetection.state.ImplementationSnapshot in project gradle by gradle.
the class DebuggingTaskOutputCachingBuildCacheKeyBuilder method appendTaskActionImplementations.
@Override
public void appendTaskActionImplementations(Collection<ImplementationSnapshot> taskActionImplementations) {
for (ImplementationSnapshot actionImpl : taskActionImplementations) {
log("actionType", actionImpl.getTypeName());
log("actionClassLoaderHash", actionImpl.hasUnknownClassLoader() ? null : actionImpl.getClassLoaderHash());
}
delegate.appendTaskActionImplementations(taskActionImplementations);
}
use of org.gradle.api.internal.changedetection.state.ImplementationSnapshot in project gradle by gradle.
the class DefaultTaskOutputCachingBuildCacheKeyBuilder method appendTaskActionImplementations.
@Override
public void appendTaskActionImplementations(Collection<ImplementationSnapshot> taskActionImplementations) {
ImmutableList.Builder<String> actionTypes = ImmutableList.builder();
List<HashCode> actionClassLoaderHashes = Lists.newArrayListWithCapacity(taskActionImplementations.size());
for (ImplementationSnapshot actionImpl : taskActionImplementations) {
String actionType = actionImpl.getTypeName();
actionTypes.add(actionType);
hasher.putString(actionType);
HashCode hashCode;
if (actionImpl.hasUnknownClassLoader()) {
hashCode = null;
valid = false;
} else {
hashCode = actionImpl.getClassLoaderHash();
hasher.putHash(hashCode);
}
actionClassLoaderHashes.add(hashCode);
}
this.actionTypes = actionTypes.build();
this.actionClassLoaderHashes = Collections.unmodifiableList(actionClassLoaderHashes);
}
use of org.gradle.api.internal.changedetection.state.ImplementationSnapshot in project gradle by gradle.
the class TaskTypeTaskStateChanges method addAllChanges.
@Override
protected void addAllChanges(List<TaskStateChange> changes) {
ImplementationSnapshot prevImplementation = previousExecution.getTaskImplementation();
ImplementationSnapshot taskImplementation = currentExecution.getTaskImplementation();
if (!taskImplementation.getTypeName().equals(prevImplementation.getTypeName())) {
changes.add(new DescriptiveChange("Task '%s' has changed type from '%s' to '%s'.", task.getIdentityPath(), prevImplementation.getTypeName(), taskImplementation.getTypeName()));
return;
}
if (taskImplementation.hasUnknownClassLoader()) {
changes.add(new DescriptiveChange("Task '%s' was loaded with an unknown classloader", task.getIdentityPath()));
return;
}
if (prevImplementation.hasUnknownClassLoader()) {
changes.add(new DescriptiveChange("Task '%s' was loaded with an unknown classloader during the previous execution", task.getIdentityPath()));
return;
}
if (!taskImplementation.getClassLoaderHash().equals(prevImplementation.getClassLoaderHash())) {
changes.add(new DescriptiveChange("Task '%s' class path has changed from %s to %s.", task.getIdentityPath(), prevImplementation.getClassLoaderHash(), taskImplementation.getClassLoaderHash()));
return;
}
ImmutableList<ImplementationSnapshot> taskActionImplementations = currentExecution.getTaskActionImplementations();
if (hasAnyUnknownClassLoader(taskActionImplementations)) {
changes.add(new DescriptiveChange("Task '%s' has an additional action that was loaded with an unknown classloader", task.getIdentityPath()));
return;
}
if (hasAnyUnknownClassLoader(previousExecution.getTaskActionImplementations())) {
changes.add(new DescriptiveChange("Task '%s' had an additional action that was loaded with an unknown classloader during the previous execution", task.getIdentityPath()));
return;
}
if (!taskActionImplementations.equals(previousExecution.getTaskActionImplementations())) {
changes.add(new DescriptiveChange("Task '%s' has additional actions that have changed", task.getIdentityPath()));
}
}
Aggregations