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();
}
};
return GradleTasks.createAsyncGradleTask(project, taskDefFactory, new CommandCompleteListener() {
@Override
public void onComplete(Throwable error) {
try {
CustomCommandActions customActions = customActionsRef.get();
if (customActions != null) {
CommandCompleteListener completeListener
= customActions.getCommandCompleteListener();
if (completeListener != null) {
completeListener.onComplete(error);
}
}
} finally {