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 20fe69e commit 30fcd3e
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-core</artifactId>
<version>1.23</version>
<version>1.24-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.java2html</groupId>
Expand Down
Expand Up @@ -2,6 +2,7 @@

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractResultTokenMacro;
import hudson.plugins.dry.DryMavenResultAction;
import hudson.plugins.dry.DryResultAction;

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

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

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractResultTokenMacro;
import hudson.plugins.analysis.tokens.AbstractAnnotationsCountTokenMacro;
import hudson.plugins.dry.DryMavenResultAction;
import hudson.plugins.dry.DryResultAction;

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

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

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractFixedAnnotationsTokenMacro;
import hudson.plugins.dry.DryMavenResultAction;
import hudson.plugins.dry.DryResultAction;

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

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

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractNewAnnotationsTokenMacro;
import hudson.plugins.dry.DryMavenResultAction;
import hudson.plugins.dry.DryResultAction;

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

Expand Up @@ -2,7 +2,7 @@

<dt>$${DRY_RESULT}</dt>
<dd>
Expands to the build result of the DRY plug-in.
Expands to the build result of the duplicate code scanner plug-in.
</dd>

</j:jelly>
Expand Up @@ -2,7 +2,7 @@

<dt>$${DRY_COUNT}</dt>
<dd>
Expands to the total number of DRY warnings in a build.
Expands to the total number of duplicate code warnings in a build.
</dd>

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

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

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

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

</j:jelly>

0 comments on commit 30fcd3e

Please sign in to comment.