TaskOutputKey outputDefKey = outputDef.getKey();
String outputDefCaption = outputDef.getCaption();
try (IOTabRef<TaskIOTab> ioRef = IOTabs.taskTabs().getTab(outputDefKey, outputDefCaption)) {
TaskIOTab tab = ioRef.getTab();
tab.setLastTask(buildItem.getSourceTaskDef(), adjust(taskDef));
tab.taskStarted();
BuildExecutionSupport.registerRunningItem(buildItem);
try {
OutputWriter buildOutput = tab.getIo().getOutRef();
if (GlobalGradleSettings.getAlwaysClearOutput().getValue()