use of org.gradle.api.internal.tasks.TaskValidationContext 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);
}
Aggregations