return BuildScript.OK;
}
public void _executeTask(final String name) {
Map<String, TaskDef> _tasks = this.getTasks();
final TaskDef task = _tasks.get(name);
boolean _equals = Objects.equal(task, null);
if (_equals) {
throw new UnsupportedOperationException((("A task \'" + name) + "\' does not exist."));
}
boolean _isExecuted = task.isExecuted();
if (_isExecuted) {
return;
}
boolean _isIsExecuting = task.isIsExecuting();
if (_isIsExecuting) {
throw new IllegalStateException((("Recursion detected : The task \'" + name) + "\' already running."));
}
try {
task.setIsExecuting(true);
List<String> _prerequisitedTasks = task.getPrerequisitedTasks();
final Procedure1<String> _function = new Procedure1<String>() {
public void apply(final String it) {
BuildScript.this._executeTask(it);
}
};
IterableExtensions.<String>forEach(_prerequisitedTasks, _function);
StringConcatenation _builder = new StringConcatenation();
_builder.append("[Task \'");
_builder.append(name, "");
_builder.append("\']");
InputOutput.<String>println(_builder.toString());
Procedure0 _runnable = task.getRunnable();
if (_runnable!=null) {
_runnable.apply();
}
} finally {
task.setExecuted(true);
task.setIsExecuting(false);
}
}