api / org.gradle.api.plugins.quality / CodeQualityExtension

CodeQualityExtension

abstract class CodeQualityExtension

Base Code Quality Extension.

Constructors

<init>

CodeQualityExtension()

Base Code Quality Extension.

Functions

getReportsDir

open fun getReportsDir(): File

The directory where reports will be generated.

getSourceSets

open fun getSourceSets(): MutableCollection<SourceSet>

The source sets to be analyzed as part of the check and build tasks.

getToolVersion

open fun getToolVersion(): String

The version of the code quality tool to be used.

isIgnoreFailures

open fun isIgnoreFailures(): Boolean

Whether to allow the build to continue if there are warnings. Example: ignoreFailures = true

setIgnoreFailures

open fun setIgnoreFailures(ignoreFailures: Boolean): Unit

Whether to allow the build to continue if there are warnings. Example: ignoreFailures = true

setReportsDir

open fun setReportsDir(reportsDir: File): Unit

The directory where reports will be generated.

setSourceSets

open fun setSourceSets(sourceSets: MutableCollection<SourceSet>): Unit

The source sets to be analyzed as part of the check and build tasks.

setToolVersion

open fun setToolVersion(toolVersion: String): Unit

The version of the code quality tool to be used.

Inheritors

CheckstyleExtension

open class CheckstyleExtension : CodeQualityExtension

Configuration options for the Checkstyle plugin.

CodeNarcExtension

open class CodeNarcExtension : CodeQualityExtension

Configuration options for the CodeNarc plugin.

FindBugsExtension

open class FindBugsExtension : CodeQualityExtension

Configuration options for the FindBugs plugin. All options have sensible defaults. See the FindBugs Manual for additional information on these options.

Below is a full configuration example. Since all properties have sensible defaults, typically only selected properties will be configured.

 apply plugin: "java" apply plugin: "findbugs" findbugs { toolVersion = "2.0.1" sourceSets = [sourceSets.main] ignoreFailures = true reportsDir = file("$project.buildDir/findbugsReports") effort = "max" showProgress = true reportLevel = "high" visitors = ["FindSqlInjection", "SwitchFallthrough"] omitVisitors = ["FindNonShortCircuit"] includeFilter = file("$rootProject.projectDir/config/findbugs/includeFilter.xml") excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml") excludeBugsFilter = file("$rootProject.projectDir/config/findbugs/excludeBugsFilter.xml") } 

JDependExtension

open class JDependExtension : CodeQualityExtension

Configuration options for the JDepend plugin.

PmdExtension

open class PmdExtension : CodeQualityExtension

Configuration options for the PMD plugin.