throw new InvalidUserDataException("The task name must be provided.");
}
Class<? extends TaskInternal> type = (Class) actualArgs.get(Task.TASK_TYPE);
Boolean generateSubclass = Boolean.valueOf(actualArgs.get(GENERATE_SUBCLASS).toString());
TaskInternal task = createTaskObject(project, type, name, generateSubclass);
Object dependsOnTasks = actualArgs.get(Task.TASK_DEPENDS_ON);
if (dependsOnTasks != null) {
task.dependsOn(dependsOnTasks);
}
Object description = actualArgs.get(Task.TASK_DESCRIPTION);
if (description != null) {
task.setDescription(description.toString());
}
Object action = actualArgs.get(Task.TASK_ACTION);
if (action instanceof Action) {
Action<? super Task> taskAction = (Action<? super Task>) action;
task.doFirst(taskAction);
} else if (action != null) {
Closure closure = (Closure) action;
task.doFirst(closure);
}
return task;
}