hudson.plugins.jacoco
Class JacocoPublisher

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Publisher
          extended by hudson.tasks.Recorder
              extended by hudson.plugins.jacoco.JacocoPublisher
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Publisher>, hudson.tasks.BuildStep

public class JacocoPublisher
extends hudson.tasks.Recorder

Publisher that captures jacoco coverage reports.

Author:
Kohsuke Kawaguchi, Jonathan Fuerth, Ognjen Bubalo

Nested Class Summary
static class JacocoPublisher.DescriptorImpl
           
 
Nested classes/interfaces inherited from class hudson.tasks.Publisher
hudson.tasks.Publisher.DescriptorExtensionListImpl
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
static hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher> DESCRIPTOR
           
 JacocoHealthReportThresholds healthReports
          HealthReport thresholds to apply.
 String includes
          Deprecated. 
 int moduleNum
          Deprecated. 
 Rule rule
          Rule to be enforced.
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
JacocoPublisher(String execPattern, String classPattern, String sourcePattern, String inclusionPattern, String exclusionPattern, String maximumInstructionCoverage, String maximumBranchCoverage, String maximumComplexityCoverage, String maximumLineCoverage, String maximumMethodCoverage, String maximumClassCoverage, String minimumInstructionCoverage, String minimumBranchCoverage, String minimumComplexityCoverage, String minimumLineCoverage, String minimumMethodCoverage, String minimumClassCoverage)
          Loads the configuration set by user.
 
Method Summary
 hudson.model.Result checkResult(JacocoBuildAction action)
           
 String getClassPattern()
           
 hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher> getDescriptor()
           
 String getExclusionPattern()
           
 String getExecPattern()
           
 String getInclusionPattern()
           
 String getMaximumBranchCoverage()
           
 String getMaximumClassCoverage()
           
 String getMaximumComplexityCoverage()
           
 String getMaximumInstructionCoverage()
           
 String getMaximumLineCoverage()
           
 String getMaximumMethodCoverage()
           
 String getMinimumBranchCoverage()
           
 String getMinimumClassCoverage()
           
 String getMinimumComplexityCoverage()
           
 String getMinimumInstructionCoverage()
           
 String getMinimumLineCoverage()
           
 String getMinimumMethodCoverage()
           
 hudson.model.Action getProjectAction(hudson.model.AbstractProject<?,?> project)
           
 hudson.tasks.BuildStepMonitor getRequiredMonitorService()
           
 String getSourcePattern()
           
 boolean perform(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
           
protected static hudson.FilePath[] resolveDirPaths(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener, String input)
           
protected static String resolveFilePaths(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener, String input)
           
protected static void saveCoverageReports(hudson.FilePath destFolder, hudson.FilePath sourceFolder)
           
 String toString()
           
 
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, needsToRun, needsToRunAfterFinalized, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectActions, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectActions, prebuild
 

Field Detail

rule

public Rule rule
Rule to be enforced. Can be null. TODO: define a configuration mechanism.


includes

@Deprecated
public transient String includes
Deprecated. 

moduleNum

@Deprecated
public transient int moduleNum
Deprecated. 

healthReports

public JacocoHealthReportThresholds healthReports
HealthReport thresholds to apply.


DESCRIPTOR

@Extension
public static final hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher> DESCRIPTOR
Constructor Detail

JacocoPublisher

@DataBoundConstructor
public JacocoPublisher(String execPattern,
                                            String classPattern,
                                            String sourcePattern,
                                            String inclusionPattern,
                                            String exclusionPattern,
                                            String maximumInstructionCoverage,
                                            String maximumBranchCoverage,
                                            String maximumComplexityCoverage,
                                            String maximumLineCoverage,
                                            String maximumMethodCoverage,
                                            String maximumClassCoverage,
                                            String minimumInstructionCoverage,
                                            String minimumBranchCoverage,
                                            String minimumComplexityCoverage,
                                            String minimumLineCoverage,
                                            String minimumMethodCoverage,
                                            String minimumClassCoverage)
Loads the configuration set by user.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

getExecPattern

public String getExecPattern()

getClassPattern

public String getClassPattern()

getSourcePattern

public String getSourcePattern()

getInclusionPattern

public String getInclusionPattern()

getExclusionPattern

public String getExclusionPattern()

getMinimumInstructionCoverage

public String getMinimumInstructionCoverage()

getMinimumBranchCoverage

public String getMinimumBranchCoverage()

getMinimumComplexityCoverage

public String getMinimumComplexityCoverage()

getMinimumLineCoverage

public String getMinimumLineCoverage()

getMinimumMethodCoverage

public String getMinimumMethodCoverage()

getMinimumClassCoverage

public String getMinimumClassCoverage()

getMaximumInstructionCoverage

public String getMaximumInstructionCoverage()

getMaximumBranchCoverage

public String getMaximumBranchCoverage()

getMaximumComplexityCoverage

public String getMaximumComplexityCoverage()

getMaximumLineCoverage

public String getMaximumLineCoverage()

getMaximumMethodCoverage

public String getMaximumMethodCoverage()

getMaximumClassCoverage

public String getMaximumClassCoverage()

saveCoverageReports

protected static void saveCoverageReports(hudson.FilePath destFolder,
                                          hudson.FilePath sourceFolder)
                                   throws IOException,
                                          InterruptedException
Throws:
IOException
InterruptedException

resolveFilePaths

protected static String resolveFilePaths(hudson.model.AbstractBuild<?,?> build,
                                         hudson.model.BuildListener listener,
                                         String input)

resolveDirPaths

protected static hudson.FilePath[] resolveDirPaths(hudson.model.AbstractBuild<?,?> build,
                                                   hudson.model.BuildListener listener,
                                                   String input)

perform

public boolean perform(hudson.model.AbstractBuild<?,?> build,
                       hudson.Launcher launcher,
                       hudson.model.BuildListener listener)
                throws InterruptedException,
                       IOException
Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer
Throws:
InterruptedException
IOException

checkResult

public hudson.model.Result checkResult(JacocoBuildAction action)

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

getRequiredMonitorService

public hudson.tasks.BuildStepMonitor getRequiredMonitorService()

getDescriptor

public hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher> getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<hudson.tasks.Publisher>
Overrides:
getDescriptor in class hudson.tasks.Recorder


Copyright © 2004-2013 Hudson. All Rights Reserved.