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 585be41 commit 1178ba9
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 4 deletions.
@@ -0,0 +1,22 @@
package hudson.plugins.warnings.tokens;

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractFixedAnnotationsTokenMacro;
import hudson.plugins.warnings.WarningsResultAction;

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

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

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractNewAnnotationsTokenMacro;
import hudson.plugins.warnings.WarningsResultAction;

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

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

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractResultTokenMacro;
import hudson.plugins.analysis.tokens.AbstractAnnotationsCountTokenMacro;
import hudson.plugins.warnings.WarningsResultAction;

/**
Expand All @@ -10,12 +10,13 @@
* @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(WarningsResultAction.class, "WARNINGS_COUNT");
super("WARNINGS_COUNT", WarningsResultAction.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, "WARNINGS_RESULT");
super("WARNINGS_RESULT", WarningsResultAction.class);
}
}

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

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

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

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

</j:jelly>

0 comments on commit 1178ba9

Please sign in to comment.