public AbstractProject<?, ?> findProject(final String projectName) { checkProjectName(projectName); // Handle matrix-project/configuration projects. // First part is matrix-project name, second part is // matrix-configuration name String[] parts = projectName.split("/", 2); if (parts.length == 2) { log.debug("Detected matrix name: {}", projectName); AbstractProject<?, ?> parent = findProject(parts[0]); if (parent instanceof MatrixProject) { for (MatrixConfiguration config : ((MatrixProject) parent).getItems()) { if (parts[1].equals(config.getName())) { log.debug("Selected matrix configuration: {}", config); // config.checkPermission(Item.READ); // TODO needed? return config; } } } } if (!getProjectNames().contains(projectName)) { log.debug("Project {} not in the list of job names.", projectName); return null; } AbstractProject<?, ?> project = getProjectByFullName(projectName); log.debug("Selected project: {}", project); return project; }
public AbstractProject<?, ?> findProject(final String projectName) { checkProjectName(projectName); // Handle matrix-project/configuration projects. // First part is matrix-project name, second part is // matrix-configuration name String[] parts = projectName.split("/", 2); if (parts.length == 2) { log.debug("Detected matrix name: {}", projectName); AbstractProject<?, ?> parent = findProject(parts[0]); if (parent instanceof MatrixProject) { for (MatrixConfiguration config : ((MatrixProject) parent).getItems()) { if (parts[1].equals(config.getName())) { log.debug("Selected matrix configuration: {}", config); // config.checkPermission(Item.READ); // TODO needed? return config; } } } } if (!getProjectNames().contains(projectName)) { log.debug("Project {} not in the list of job names.", projectName); return null; } AbstractProject<?, ?> project = getProjectByFullName(projectName); log.debug("Selected project: {}", project); return project; }
@Override public Collection<? extends Action> getProjectActions(AbstractProject<?, ?> project) { if (this.reportTargets.isEmpty()) { return Collections.emptyList(); } else { ArrayList<Action> actions = new ArrayList<Action>(); for (HtmlPublisherTarget target : this.reportTargets) { actions.add(target.getProjectAction(project)); if (project instanceof MatrixProject && ((MatrixProject) project).getActiveConfigurations() != null){ for (MatrixConfiguration mc : ((MatrixProject) project).getActiveConfigurations()){ try { mc.onLoad(mc.getParent(), mc.getName()); } catch (IOException e){ //Could not reload the configuration. } } } } return actions; } }
@Override public boolean endRun(final MatrixRun run) { aggregationTableLock.lock(); try { names.add(run.getParent().getName()); List<ResultAction> actions = run.getActions(ResultAction.class); if (results.isEmpty()) { initializeMap(actions); } else { updateMap(actions); } run.getWorkspace(); } finally { aggregationTableLock.unlock(); } return true; }
@Override public boolean endRun(final MatrixRun run) throws InterruptedException, IOException { List<WarningsResultAction> actions = run.getActions(WarningsResultAction.class); if (!actions.isEmpty()) { for (WarningsResultAction action : actions) { initializeParser(action.getParser()); ParserResult aggregation = totalsPerParser.get(action.getParser()); String configurationName = run.getParent().getName(); WarningsResult result = action.getResult(); addAllWarnings(aggregation, result, configurationName); aggregation.addModules(appendConfigurationNameToModule(result, configurationName)); } } return true; }