|
|
@@ -1,24 +1,24 @@ |
|
|
package hudson.plugins.dry; |
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
import org.kohsuke.stapler.DataBoundConstructor; |
|
|
|
|
|
import hudson.Launcher; |
|
|
import hudson.matrix.MatrixAggregator; |
|
|
import hudson.matrix.MatrixBuild; |
|
|
import hudson.model.Action; |
|
|
import hudson.model.BuildListener; |
|
|
import hudson.model.AbstractBuild; |
|
|
import hudson.model.AbstractProject; |
|
|
import hudson.model.Action; |
|
|
import hudson.model.BuildListener; |
|
|
import hudson.plugins.analysis.core.BuildResult; |
|
|
import hudson.plugins.analysis.core.FilesParser; |
|
|
import hudson.plugins.analysis.core.HealthAwarePublisher; |
|
|
import hudson.plugins.analysis.core.ParserResult; |
|
|
import hudson.plugins.analysis.core.BuildResult; |
|
|
import hudson.plugins.analysis.util.PluginLogger; |
|
|
import hudson.plugins.dry.parser.DuplicationParserRegistry; |
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
import org.kohsuke.stapler.DataBoundConstructor; |
|
|
|
|
|
/** |
|
|
* Publishes the results of the duplicate code analysis (freestyle project type). |
|
|
* |
|
@@ -94,6 +94,8 @@ |
|
|
* annotation threshold |
|
|
* @param canRunOnFailed |
|
|
* determines whether the plug-in can run for failed builds, too |
|
|
* @param usePreviousBuildAsReference |
|
|
* determines whether to always use the previous build as the reference build |
|
|
* @param useStableBuildAsReference |
|
|
* determines whether only stable builds should be used as reference builds or not |
|
|
* @param shouldDetectModules |
|
@@ -117,14 +119,16 @@ public DryPublisher(final String healthy, final String unHealthy, final String t |
|
|
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 canRunOnFailed, final boolean useStableBuildAsReference, final boolean shouldDetectModules, |
|
|
final boolean canRunOnFailed, final boolean usePreviousBuildAsReference, |
|
|
final boolean useStableBuildAsReference, final boolean shouldDetectModules, |
|
|
final boolean canComputeNew, final String pattern, final int highThreshold, final int normalThreshold) { |
|
|
super(healthy, unHealthy, thresholdLimit, defaultEncoding, useDeltaValues, |
|
|
unstableTotalAll, unstableTotalHigh, unstableTotalNormal, unstableTotalLow, |
|
|
unstableNewAll, unstableNewHigh, unstableNewNormal, unstableNewLow, |
|
|
failedTotalAll, failedTotalHigh, failedTotalNormal, failedTotalLow, |
|
|
failedNewAll, failedNewHigh, failedNewNormal, failedNewLow, |
|
|
canRunOnFailed, useStableBuildAsReference, shouldDetectModules, canComputeNew, true, PLUGIN_NAME); |
|
|
canRunOnFailed, usePreviousBuildAsReference, useStableBuildAsReference, shouldDetectModules, |
|
|
canComputeNew, true, PLUGIN_NAME); |
|
|
this.pattern = pattern; |
|
|
this.highThreshold = highThreshold; |
|
|
this.normalThreshold = normalThreshold; |
|
@@ -175,8 +179,9 @@ public BuildResult perform(final AbstractBuild<?, ?> build, final PluginLogger l |
|
|
ParserResult project = build.getWorkspace().act(dryCollector); |
|
|
logger.logLines(project.getLogMessages()); |
|
|
|
|
|
DryResult result = new DryResult(build, getDefaultEncoding(), project, useOnlyStableBuildsAsReference()); |
|
|
build.getActions().add(new DryResultAction(build, this, result)); |
|
|
DryResult result = new DryResult(build, getDefaultEncoding(), project, |
|
|
usePreviousBuildAsReference(), useOnlyStableBuildsAsReference()); |
|
|
build.addAction(new DryResultAction(build, this, result)); |
|
|
|
|
|
return result; |
|
|
} |
|
@@ -189,6 +194,7 @@ public DryDescriptor getDescriptor() { |
|
|
@Override |
|
|
public MatrixAggregator createAggregator(final MatrixBuild build, final Launcher launcher, |
|
|
final BuildListener listener) { |
|
|
return new DryAnnotationsAggregator(build, launcher, listener, this, getDefaultEncoding(), useOnlyStableBuildsAsReference()); |
|
|
return new DryAnnotationsAggregator(build, launcher, listener, this, getDefaultEncoding(), |
|
|
usePreviousBuildAsReference(), useOnlyStableBuildsAsReference()); |
|
|
} |
|
|
} |