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 0b3900c commit 9ab5c22
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugin/pom.xml
Expand Up @@ -40,7 +40,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
Expand Up @@ -2,6 +2,7 @@

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractResultTokenMacro;
import hudson.plugins.findbugs.FindBugsMavenResultAction;
import hudson.plugins.findbugs.FindBugsResultAction;

/**
Expand All @@ -14,8 +15,9 @@ public class FindBugsResultTokenMacro extends AbstractResultTokenMacro {
/**
* Creates a new instance of {@link FindBugsResultTokenMacro}.
*/
@SuppressWarnings("unchecked")
public FindBugsResultTokenMacro() {
super(FindBugsResultAction.class, "FINDBUGS_RESULT");
super("FINDBUGS_RESULT", FindBugsResultAction.class, FindBugsMavenResultAction.class);
}
}

@@ -1,7 +1,8 @@
package hudson.plugins.findbugs.tokens;

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractResultTokenMacro;
import hudson.plugins.analysis.tokens.AbstractAnnotationsCountTokenMacro;
import hudson.plugins.findbugs.FindBugsMavenResultAction;
import hudson.plugins.findbugs.FindBugsResultAction;

/**
Expand All @@ -10,12 +11,13 @@
* @author Ulli Hafner
*/
@Extension(optional = true)
public class FindBugsWarningCountTokenMacro extends AbstractResultTokenMacro {
public class FindBugsWarningCountTokenMacro extends AbstractAnnotationsCountTokenMacro {
/**
* Creates a new instance of {@link FindBugsWarningCountTokenMacro}.
*/
@SuppressWarnings("unchecked")
public FindBugsWarningCountTokenMacro() {
super(FindBugsResultAction.class, "FINDBUGS_COUNT");
super("FINDBUGS_COUNT", FindBugsResultAction.class, FindBugsMavenResultAction.class);
}
}

@@ -0,0 +1,23 @@
package hudson.plugins.findbugs.tokens;

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractFixedAnnotationsTokenMacro;
import hudson.plugins.findbugs.FindBugsMavenResultAction;
import hudson.plugins.findbugs.FindBugsResultAction;

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

@@ -0,0 +1,23 @@
package hudson.plugins.findbugs.tokens;

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractNewAnnotationsTokenMacro;
import hudson.plugins.findbugs.FindBugsMavenResultAction;
import hudson.plugins.findbugs.FindBugsResultAction;

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

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

<dt>$${FINDBUGS_FIXED}</dt>
<dd>
Expands to the total number of fixed FindBugs warnings in a build.
</dd>

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

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

</j:jelly>

0 comments on commit 9ab5c22

Please sign in to comment.