All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.plugins.analysis.collector.AnalysisAnnotationsAggregator Maven / Gradle / Ivy

Go to download

This plug-in is an add-on for the plug-ins Checkstyle, Dry, FindBugs, PMD, Tasks, and Warnings: the plug-in collects the different analysis results and shows the results in a combined trend graph. Additionally, the plug-in provides health reporting and build stability based on these combined results.

There is a newer version: 1.28-h-1
Show newest version
package hudson.plugins.analysis.collector;

import hudson.Launcher;
import hudson.matrix.MatrixRun;
import hudson.matrix.MatrixBuild;
import hudson.model.Action;
import hudson.model.BuildListener;
import hudson.plugins.analysis.core.AnnotationsAggregator;
import hudson.plugins.analysis.core.HealthDescriptor;
import hudson.plugins.analysis.core.ParserResult;

/**
 * Aggregates {@link AnalysisResultAction}s of {@link MatrixRun}s into
 * {@link MatrixBuild}.
 *
 * @author Ulli Hafner
 */
public class AnalysisAnnotationsAggregator extends AnnotationsAggregator {
    /**
     * Creates a new instance of {@link AnnotationsAggregator}.
     *
     * @param build
     *            the matrix build
     * @param launcher
     *            the launcher
     * @param listener
     *            the build listener
     * @param healthDescriptor
     *            health descriptor
     * @param defaultEncoding
     *            the default encoding to be used when reading and parsing files
     */
    public AnalysisAnnotationsAggregator(final MatrixBuild build, final Launcher launcher,
            final BuildListener listener, final HealthDescriptor healthDescriptor, final String defaultEncoding) {
        super(build, launcher, listener, healthDescriptor, defaultEncoding);
    }

    @Override
    protected Action createAction(final HealthDescriptor healthDescriptor, final String defaultEncoding, final ParserResult aggregatedResult) {
        return new AnalysisResultAction(build, healthDescriptor,
                new AnalysisResult(build, defaultEncoding, aggregatedResult));
    }

    @Override
    protected boolean hasResult(final MatrixRun run) {
        return getAction(run) != null;
    }

    @Override
    protected AnalysisResult getResult(final MatrixRun run) {
        return getAction(run).getResult();
    }

    private AnalysisResultAction getAction(final MatrixRun run) {
        return run.getAction(AnalysisResultAction.class);
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy