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 ecee21a commit 27fdfa4
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -32,7 +32,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.checkstyle.CheckStyleMavenResultAction;
import hudson.plugins.checkstyle.CheckStyleResultAction;

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

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

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractResultTokenMacro;
import hudson.plugins.analysis.tokens.AbstractAnnotationsCountTokenMacro;
import hudson.plugins.checkstyle.CheckStyleMavenResultAction;
import hudson.plugins.checkstyle.CheckStyleResultAction;

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

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

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractFixedAnnotationsTokenMacro;
import hudson.plugins.checkstyle.CheckStyleMavenResultAction;
import hudson.plugins.checkstyle.CheckStyleResultAction;

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

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

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractNewAnnotationsTokenMacro;
import hudson.plugins.checkstyle.CheckStyleMavenResultAction;
import hudson.plugins.checkstyle.CheckStyleResultAction;

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

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

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

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

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

</j:jelly>

0 comments on commit 27fdfa4

Please sign in to comment.