Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[FIXED JENKINS-10027] Added new tokens for new and fixed warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jul 6, 2011
1 parent 5b1b2c0 commit 716e061
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.23</version>
<version>1.24-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
Expand Down
@@ -0,0 +1,22 @@
package hudson.plugins.analysis.collector.tokens;

import hudson.Extension;
import hudson.plugins.analysis.collector.AnalysisResultAction;
import hudson.plugins.analysis.tokens.AbstractFixedAnnotationsTokenMacro;

/**
* Provides a token that evaluates to the number of new warnings.
*
* @author Ulli Hafner
*/
@Extension(optional = true)
public class FixedWarningsCountTokenMacro extends AbstractFixedAnnotationsTokenMacro {
/**
* Creates a new instance of {@link FixedWarningsCountTokenMacro}.
*/
@SuppressWarnings("unchecked")
public FixedWarningsCountTokenMacro() {
super("ANALYSIS_FIXED", AnalysisResultAction.class);
}
}

@@ -0,0 +1,22 @@
package hudson.plugins.analysis.collector.tokens;

import hudson.Extension;
import hudson.plugins.analysis.collector.AnalysisResultAction;
import hudson.plugins.analysis.tokens.AbstractNewAnnotationsTokenMacro;

/**
* Provides a token that evaluates to the number of new warnings.
*
* @author Ulli Hafner
*/
@Extension(optional = true)
public class NewWarningsCountTokenMacro extends AbstractNewAnnotationsTokenMacro {
/**
* Creates a new instance of {@link NewWarningsCountTokenMacro}.
*/
@SuppressWarnings("unchecked")
public NewWarningsCountTokenMacro() {
super("ANALYSIS_NEW", AnalysisResultAction.class);
}
}

Expand Up @@ -2,20 +2,21 @@

import hudson.Extension;
import hudson.plugins.analysis.collector.AnalysisResultAction;
import hudson.plugins.analysis.tokens.AbstractResultTokenMacro;
import hudson.plugins.analysis.tokens.AbstractAnnotationsCountTokenMacro;

/**
* Provides a token that evaluates to the number of warnings.
*
* @author Ulli Hafner
*/
@Extension(optional = true)
public class WarningsCountTokenMacro extends AbstractResultTokenMacro {
public class WarningsCountTokenMacro extends AbstractAnnotationsCountTokenMacro {
/**
* Creates a new instance of {@link WarningsCountTokenMacro}.
*/
@SuppressWarnings("unchecked")
public WarningsCountTokenMacro() {
super(AnalysisResultAction.class, "ANALYSIS_COUNT");
super("ANALYSIS_COUNT", AnalysisResultAction.class);
}
}

Expand Up @@ -14,8 +14,9 @@ public class WarningsResultTokenMacro extends AbstractResultTokenMacro {
/**
* Creates a new instance of {@link WarningsResultTokenMacro}.
*/
@SuppressWarnings("unchecked")
public WarningsResultTokenMacro() {
super(WarningsResultAction.class, "ANALYSIS_RESULT");
super("ANALYSIS_RESULT", WarningsResultAction.class);
}
}

@@ -0,0 +1,8 @@
<j:jelly xmlns:j="jelly:core">

<dt>$${ANALYSIS_FIXED}</dt>
<dd>
Expands to the total number of new warnings in a build.
</dd>

</j:jelly>
@@ -0,0 +1,8 @@
<j:jelly xmlns:j="jelly:core">

<dt>$${ANALYSIS_NEW}</dt>
<dd>
Expands to the total number of new warnings in a build.
</dd>

</j:jelly>

0 comments on commit 716e061

Please sign in to comment.