Skip to content
Permalink
Browse files

[FIXED JENKINS-13458] Added an option to use previous build as a refe…

…rence.
  • Loading branch information
uhafner committed Jan 5, 2015
1 parent d36d510 commit 8c4ac1d376dfa056f60c7968d426a7a0aed0982d
@@ -29,20 +29,25 @@
* health descriptor
* @param defaultEncoding
* the default encoding to be used when reading and parsing files
* @param usePreviousBuildAsReference
* determines whether the previous build should be used as the
* reference build
* @param useStableBuildAsReference
* determines whether only stable builds should be used as
* reference builds or not
*/
public AnalysisAnnotationsAggregator(final MatrixBuild build, final Launcher launcher,
final BuildListener listener, final HealthDescriptor healthDescriptor, final String defaultEncoding,
final boolean useStableBuildAsReference) {
super(build, launcher, listener, healthDescriptor, defaultEncoding, useStableBuildAsReference);
final boolean usePreviousBuildAsReference, final boolean useStableBuildAsReference) {
super(build, launcher, listener, healthDescriptor, defaultEncoding,
usePreviousBuildAsReference, useStableBuildAsReference);
}

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

@Override
@@ -102,6 +102,9 @@
* determines whether to collect compiler warnings
* @param canRunOnFailed
* determines whether the plug-in can run for failed builds, too
* @param usePreviousBuildAsReference
* determines whether the previous build should be used as the
* reference build
* @param useStableBuildAsReference
* determines whether only stable builds should be used as reference builds or not
* @param canComputeNew
@@ -117,16 +120,16 @@ public AnalysisPublisher(final String healthy, final String unHealthy, final Str
final String unstableNewAll, final String unstableNewHigh, final String unstableNewNormal, final String unstableNewLow,
final String failedTotalAll, final String failedTotalHigh, final String failedTotalNormal, final String failedTotalLow,
final String failedNewAll, final String failedNewHigh, final String failedNewNormal, final String failedNewLow,
final boolean isCheckStyleActivated, final boolean isDryActivated,
final boolean isFindBugsActivated, final boolean isPmdActivated,
final boolean isOpenTasksActivated, final boolean isWarningsActivated,
final boolean canRunOnFailed, final boolean useStableBuildAsReference, final boolean canComputeNew) {
final boolean isCheckStyleActivated, final boolean isDryActivated, final boolean isFindBugsActivated,
final boolean isPmdActivated, final boolean isOpenTasksActivated, final boolean isWarningsActivated,
final boolean canRunOnFailed,
final boolean usePreviousBuildAsReference, final boolean useStableBuildAsReference, final boolean canComputeNew) {
super(healthy, unHealthy, thresholdLimit, defaultEncoding, useDeltaValues,
unstableTotalAll, unstableTotalHigh, unstableTotalNormal, unstableTotalLow,
unstableNewAll, unstableNewHigh, unstableNewNormal, unstableNewLow,
failedTotalAll, failedTotalHigh, failedTotalNormal, failedTotalLow,
failedNewAll, failedNewHigh, failedNewNormal, failedNewLow,
canRunOnFailed, useStableBuildAsReference, false, canComputeNew, false, "ANALYSIS-COLLECTOR");
canRunOnFailed, usePreviousBuildAsReference, useStableBuildAsReference, false, canComputeNew, false, "ANALYSIS-COLLECTOR");
isDryDeactivated = !isDryActivated;
isFindBugsDeactivated = !isFindBugsActivated;
isPmdDeactivated = !isPmdActivated;
@@ -240,8 +243,9 @@ public BuildResult perform(final AbstractBuild<?, ?> build, final PluginLogger l
}
}

AnalysisResult result = new AnalysisResult(build, getDefaultEncoding(), overallResult, useOnlyStableBuildsAsReference());
build.getActions().add(new AnalysisResultAction(build, this, result));
AnalysisResult result = new AnalysisResult(build, getDefaultEncoding(), overallResult,
usePreviousBuildAsReference(), useOnlyStableBuildsAsReference());
build.addAction(new AnalysisResultAction(build, this, result));

return result;
}
@@ -254,6 +258,7 @@ public AnalysisDescriptor getDescriptor() {
@Override
public MatrixAggregator createAggregator(final MatrixBuild build, final Launcher launcher,
final BuildListener listener) {
return new AnalysisAnnotationsAggregator(build, launcher, listener, this, getDefaultEncoding(), useOnlyStableBuildsAsReference());
return new AnalysisAnnotationsAggregator(build, launcher, listener, this, getDefaultEncoding(),
usePreviousBuildAsReference(), useOnlyStableBuildsAsReference());
}
}
@@ -36,13 +36,17 @@
* the default encoding to be used when reading and parsing files
* @param result
* the parsed result with all annotations
* @param usePreviousBuildAsReference
* determines whether the previous build should be used as the
* reference build
* @param useStableBuildAsReference
* determines whether only stable builds should be used as
* reference builds or not
*/
public AnalysisResult(final AbstractBuild<?, ?> build, final String defaultEncoding, final ParserResult result,
final boolean useStableBuildAsReference) {
this(build, new BuildHistory(build, AnalysisResultAction.class, useStableBuildAsReference), result, defaultEncoding, true);
final boolean usePreviousBuildAsReference, final boolean useStableBuildAsReference) {
this(build, new BuildHistory(build, AnalysisResultAction.class, usePreviousBuildAsReference, useStableBuildAsReference),
result, defaultEncoding, true);
}

AnalysisResult(final AbstractBuild<?, ?> build, final BuildHistory history,

0 comments on commit 8c4ac1d

Please sign in to comment.
You can’t perform that action at this time.