Package org.xtext.builddsl.lib

Examples of org.xtext.builddsl.lib.TaskDef


    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);
    }
  }
View Full Code Here


    Map<String, TaskDef> _tasks = this.getTasks();
    boolean _containsKey = _tasks.containsKey(name);
    if (_containsKey) {
      throw new IllegalArgumentException((("A task \'" + name) + "\' is laready registered."));
    }
    final TaskDef task = new TaskDef();
    init.apply(task);
    Map<String, TaskDef> _tasks_1 = this.getTasks();
    _tasks_1.put(name, task);
  }
View Full Code Here

TOP

Related Classes of org.xtext.builddsl.lib.TaskDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.