hudson.plugins.findbugs
Class FindBugsPublisher

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Publisher
          extended by hudson.plugins.findbugs.util.HealthAwarePublisher
              extended by hudson.plugins.findbugs.FindBugsPublisher
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Publisher>, hudson.tasks.BuildStep

public class FindBugsPublisher
extends HealthAwarePublisher

Publishes the results of the FindBugs analysis.

Author:
Ulli Hafner

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
static FindBugsDescriptor FIND_BUGS_DESCRIPTOR
          Descriptor of this publisher.
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
FindBugsPublisher(java.lang.String pattern, java.lang.String threshold, java.lang.String healthy, java.lang.String unHealthy)
          Creates a new instance of FindBugsPublisher.
 
Method Summary
 hudson.model.Descriptor<hudson.tasks.Publisher> getDescriptor()
          
 hudson.model.Action getProjectAction(hudson.model.AbstractProject<?,?> project)
          
 boolean perform(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          Scans the workspace and parses all found FindBugs XML files.
 
Methods inherited from class hudson.plugins.findbugs.util.HealthAwarePublisher
createHealthReporter, getHealthy, getHealthyAnnotations, getMinimumAnnotations, getPattern, getThreshold, getUnHealthy, getUnHealthyAnnotations, isHealthyReportEnabled, isThresholdEnabled
 
Methods inherited from class hudson.tasks.Publisher
getProjectAction, needsToRunAfterFinalized, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
prebuild
 

Field Detail

FIND_BUGS_DESCRIPTOR

public static final FindBugsDescriptor FIND_BUGS_DESCRIPTOR
Descriptor of this publisher.

Constructor Detail

FindBugsPublisher

public FindBugsPublisher(java.lang.String pattern,
                         java.lang.String threshold,
                         java.lang.String healthy,
                         java.lang.String unHealthy)
Creates a new instance of FindBugsPublisher.

Parameters:
pattern - Ant file-set pattern to scan for FindBugs files
threshold - Bug threshold to be reached if a build should be considered as unstable.
healthy - Report health as 100% when the number of warnings is less than this value
unHealthy - Report health as 0% when the number of warnings is greater than this value
Method Detail

getProjectAction

public hudson.model.Action getProjectAction(hudson.model.AbstractProject<?,?> project)

Specified by:
getProjectAction in interface hudson.tasks.BuildStep
Overrides:
getProjectAction in class hudson.tasks.BuildStepCompatibilityLayer

perform

public boolean perform(hudson.model.AbstractBuild<?,?> build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
                throws java.lang.InterruptedException,
                       java.io.IOException
Scans the workspace and parses all found FindBugs XML files. Then, the annotations of all files are merged and persisted for a build. Finally, the number of bugs are counted and the result of the build is set accordingly (HealthAwarePublisher.getThreshold().

Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer
Parameters:
build - the build
launcher - the launcher
listener - the build listener
Returns:
true if the build could continue
Throws:
java.io.IOException - if the files could not be copied
java.lang.InterruptedException - if user cancels the operation

getDescriptor

public hudson.model.Descriptor<hudson.tasks.Publisher> getDescriptor()



Copyright © 2008. All Rights Reserved.