Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package net.saliman.gradle.plugin.cobertura
import org.gradle.api.Project
import org.gradle.api.file.FileCollection
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.tasks.TaskCollection
import org.gradle.api.tasks.testing.Test
/**
* Extension class for configuring the Cobertura plugin. Most of the properties
* in this extension match options in Cobertura itself.
*/
class CoberturaExtension {
static ENCODING_UNDEFINED = 'undefined'
/**
* Version of cobertura to use for the plugin. Defaults to 2.1.1
*/
String coberturaVersion = '2.1.1'
/**
* Directories under the base directory containing classes to be
* instrumented. Defaults to [project.sourceSets.main.classesDir.path]
*/
List coverageDirs
/**
* Path to the data file to produce during instrumentation. This file is used
* to determine if instrumentation is up to date, so it cannot be used during
* the tests themselves. Defaults to
* ${project.buildDir.path}/cobertura/coberturaInput.ser
*/
File coverageInputDatafile
/**
* Path to the data file to use during tests. The contents of this file are
* changed by testing, so a new copy is made from the input datafile before
* each test run. Defaults to
* ${project.buildDir.path}/cobertura/cobertura.ser
*/
File coverageOutputDatafile
/**
* Path to report directory for coverage report. Defaults to
* ${project.reportsDir.path}/cobertura
*/
File coverageReportDir
/**
* Formats of cobertura report. Default is a single report in 'html'
* format.
*/
Set coverageFormats = ['html']
/**
* The character encoding to use when generating coverage reports. If no
* encoding is specified, the plugin uses the system default.
*/
// For some reason, Gradle doesn't seem to like nulls in @Input properties.
String coverageEncoding = ENCODING_UNDEFINED
/**
* Directories of source files to use. The default is to look for and include
* each of the following, if present:
* project.sourceSets.main.java.srcDirs,
* project.sourceSets.main.groovy.srcDirs,
* and project.sourceSets.main.scala.srcDirs
*/
Set coverageSourceDirs
/**
* List of include patterns
*/
List coverageIncludes = []
/**
* List of exclude patterns
*/
List coverageExcludes = []
/**
* List of ignore patterns
*/
List coverageIgnores = []
/**
* The classpath when instrumenting.
* Defaults to
* project.sourceSets.main.output.classesDir,
* project.sourceSets.main.compileClasspath,
*/
FileCollection auxiliaryClasspath
/**
* Whether or not to ignore trivial methods like simple getters and setters.
* Available in in Cobertura 2.0.0 and later. Private to force use of the
* setter method.
*/
private boolean coverageIgnoreTrivial = false;
/**
* List of fully qualified annotation names that, if present on a method,
* will cause it to be ignored by Cobertura for coverage purposes.
* Available in Cobertura 2.0.0 and later. Private to force use of the
* setter method
*/
private List coverageIgnoreMethodAnnotations = []
/**
* Closure that returns the tasks that produce the classes that need to be
* instrumented. The default is the "classes" task.
*/
private Closure coverageClassesTasksSpec
/**
* Closure that returns all the tasks in the project that test the code of
* interest. The default is all tasks of type "Test".
*/
private Closure coverageTestTasksSpec
// -----------------------------------------------------------------------
// properties used for coverage checks. Many of them are private to force
// using the "set" methods which check the value range.
/**
* The minimum acceptable branch coverage rate needed by each class. This
* should be an integer value between 0 and 100.
*/
private Integer coverageCheckBranchRate
/**
* The minimum acceptable line coverage rate needed by each class. This should
* be an integer value between 0 and 100.
*/
private Integer coverageCheckLineRate
/**
* The minimum acceptable average branch coverage rate needed by each package.
* This should be an integer value between 0 and 100.
*/
private Integer coverageCheckPackageBranchRate
/**
* The minimum acceptable average line coverage rate needed by each package.
* This should be an integer value between 0 and 100.
*/
private Integer coverageCheckPackageLineRate
/**
* The minimum acceptable average branch coverage rate needed by the project
* as a whole. This should be an integer value between 0 and 100.
*/
private Integer coverageCheckTotalBranchRate
/**
* The minimum acceptable average line coverage rate needed by the project as
* a whole. This should be an integer value between 0 and 100.
*/
private Integer coverageCheckTotalLineRate
/**
* For finer grained control, you can optionally specify minimum branch and
* line coverage rates for individual classes using any number of regular
* expressions. Each expression is a map with 3 keys:
*
*
regex - a regular expression identifying classes classes that
* need special rates
*
branchRate - the branch rate for the selected classes
*
lineRate - the line rate for the selected classes
*
* The branch and line rates need to be numbers from 0 to 100.
* Example:
*