This repository has been archived by the owner on Apr 6, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-10027] Added new tokens for new and fixed warnings.
- Loading branch information
Showing
5 changed files
with
82 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/hudson/plugins/analysis/tokens/AbstractFixedAnnotationsTokenMacro.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package hudson.plugins.analysis.tokens; | ||
|
||
import hudson.plugins.analysis.core.BuildResult; | ||
import hudson.plugins.analysis.core.ResultAction; | ||
|
||
/** | ||
* Provides a token that evaluates to the number of fixed annotations found by a | ||
* plug-in. | ||
* | ||
* @author Ulli Hafner | ||
*/ | ||
public class AbstractFixedAnnotationsTokenMacro extends AbstractTokenMacro { | ||
/** | ||
* Creates a new instance of {@link AbstractFixedAnnotationsTokenMacro}. | ||
* @param tokenName | ||
* the name of the token | ||
* @param resultActions | ||
* associated actions containing the build result | ||
*/ | ||
public AbstractFixedAnnotationsTokenMacro(final String tokenName, | ||
final Class<? extends ResultAction<? extends BuildResult>>... resultActions) { | ||
super(tokenName, resultActions); | ||
} | ||
|
||
@Override | ||
protected String evaluate(final BuildResult result) { | ||
return String.valueOf(result.getNumberOfFixedWarnings()); | ||
} | ||
} | ||
|
30 changes: 30 additions & 0 deletions
30
src/main/java/hudson/plugins/analysis/tokens/AbstractNewAnnotationsTokenMacro.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package hudson.plugins.analysis.tokens; | ||
|
||
import hudson.plugins.analysis.core.BuildResult; | ||
import hudson.plugins.analysis.core.ResultAction; | ||
|
||
/** | ||
* Provides a token that evaluates to the number of new annotations found by a | ||
* plug-in. | ||
* | ||
* @author Ulli Hafner | ||
*/ | ||
public class AbstractNewAnnotationsTokenMacro extends AbstractTokenMacro { | ||
/** | ||
* Creates a new instance of {@link AbstractNewAnnotationsTokenMacro}. | ||
* @param tokenName | ||
* the name of the token | ||
* @param resultActions | ||
* associated actions containing the build result | ||
*/ | ||
public AbstractNewAnnotationsTokenMacro(final String tokenName, | ||
final Class<? extends ResultAction<? extends BuildResult>>... resultActions) { | ||
super(tokenName, resultActions); | ||
} | ||
|
||
@Override | ||
protected String evaluate(final BuildResult result) { | ||
return String.valueOf(result.getNumberOfNewWarnings()); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters