Skip to content

Commit

Permalink
Fix [JENKINS-11096] - Always process from workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Dec 31, 2011
1 parent ced2be1 commit 473c633
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
Expand Up @@ -56,11 +56,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
CppcheckParserResult parser = new CppcheckParserResult(listener, cppcheckConfig.getPattern(), cppcheckConfig.isIgnoreBlankFiles());
CppcheckReport cppcheckReport;
try {
if (cppcheckConfig.isUseWorkspaceAsRootPath()) {
cppcheckReport = build.getWorkspace().act(parser);
} else {
cppcheckReport = build.getModuleRoot().act(parser);
}
cppcheckReport = build.getWorkspace().act(parser);
} catch (Exception e) {
CppcheckLogger.log(listener, "Error on cppcheck analysis: " + e);
build.setResult(Result.FAILURE);
Expand Down
Expand Up @@ -10,16 +10,9 @@
*/
public class CppcheckConfig implements Serializable {

private transient String cppcheckReportPattern;

private String pattern;

private boolean useWorkspaceAsRootPath;

private boolean ignoreBlankFiles;

private CppcheckConfigSeverityEvaluation configSeverityEvaluation = new CppcheckConfigSeverityEvaluation();

private CppcheckConfigGraph configGraph = new CppcheckConfigGraph();

public CppcheckConfig() {
Expand All @@ -28,7 +21,6 @@ public CppcheckConfig() {
@DataBoundConstructor
@SuppressWarnings("unused")
public CppcheckConfig(String pattern,
boolean useWorkspaceAsRootPath,
boolean ignoreBlankFiles, String threshold,
String newThreshold, String failureThreshold,
String newFailureThreshold, String healthy, String unHealthy,
Expand All @@ -46,7 +38,6 @@ public CppcheckConfig(String pattern,
boolean displayInformationSeverity) {

this.pattern = pattern;
this.useWorkspaceAsRootPath = useWorkspaceAsRootPath;
this.ignoreBlankFiles = ignoreBlankFiles;
this.configSeverityEvaluation = new CppcheckConfigSeverityEvaluation(
threshold, newThreshold, failureThreshold, newFailureThreshold, healthy, unHealthy,
Expand Down Expand Up @@ -90,11 +81,18 @@ public CppcheckConfigGraph getConfigGraph() {
return configGraph;
}

/*
Backward compatibility
*/
private transient String cppcheckReportPattern;
private transient boolean useWorkspaceAsRootPath;

@SuppressWarnings("unused")
private Object readResolve() {
if (this.cppcheckReportPattern != null) {
this.pattern = cppcheckReportPattern;
}
return this;
}

}
Expand Up @@ -11,11 +11,6 @@
<f:textbox name="cppcheck.pattern" value="${config.pattern}"/>
</f:entry>

<f:entry>
<f:checkbox name="cppcheck.useWorkspaceAsRootPath" checked="${config.useWorkspaceAsRootPath}"/>
<label>${%Use the workspace as root path to look for reports}</label>
</f:entry>

<f:entry>
<f:checkbox name="cppcheck.ignoreBlankFiles" checked="${config.ignoreBlankFiles}"/>
<label>${%Ignore blank files}</label>
Expand Down

0 comments on commit 473c633

Please sign in to comment.