Package org.sonar.api.task

Examples of org.sonar.api.task.TaskDefinition$Builder


  }

  private void checkDuplicatedClasses() {
    Map<Class<? extends Task>, TaskDefinition> byClass = Maps.newHashMap();
    for (TaskDefinition def : definitions()) {
      TaskDefinition other = byClass.get(def.taskClass());
      if (other == null) {
        byClass.put(def.taskClass(), def);
      } else {
        throw new SonarException("Task '" + def.taskClass().getName() + "' is defined twice: first by '" + other.key() + "' and then by '" + def.key() + "'");
      }
    }
  }
View Full Code Here


  @Override
  public void doAfterStart() {
    // default value is declared in CorePlugin
    String taskKey = StringUtils.defaultIfEmpty(taskProperties.get(CoreProperties.TASK), CoreProperties.SCAN_TASK);

    TaskDefinition def = getComponentByType(Tasks.class).definition(taskKey);
    if (def == null) {
      throw MessageException.of("Task " + taskKey + " does not exist");
    }
    Task task = getComponentByType(def.taskClass());
    if (task != null) {
      task.execute();
    } else {
      throw new IllegalStateException("Task " + taskKey + " is badly defined");
    }
View Full Code Here

TOP

Related Classes of org.sonar.api.task.TaskDefinition$Builder

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.