MutableProperty<PredefinedTask> builtInTask = properties.tryGetBuiltInTask(command);
if (builtInTask == null) {
return null;
}
final PredefinedTask task = builtInTask.getValue();
if (task == null) {
LOGGER.log(Level.WARNING, "Property returns null for built-in command: {0}", command);
return null;
}
CustomCommandActions customActions = getCommandActions(appliedConfig, command);
if (customActions == null) {
customActions = CustomCommandActions.OTHER;
}
customActionsRef.set(customActions);
String displayName = tryGetDisplayNameOfCommand(command);
if (displayName == null) {
displayName = task.getDisplayName();
}
return GradleTaskDef.createFromTemplate(project,
task.toCommandTemplate(displayName),
customActions,
appliedContext).create();
}
};