Package org.gradle.api.plugins.quality
Class PmdExtension
java.lang.Object
org.gradle.api.plugins.quality.CodeQualityExtension
org.gradle.api.plugins.quality.PmdExtension
Configuration options for the PMD plugin.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
The rule priority threshold; violations for rules with a lower priority will not be reported.The custom rule set to be used (if any).The custom rule set files to be used.The built-in rule sets to be used.The target jdk to use with pmd, 1.3, 1.4, 1.5, 1.6, 1.7 or jspboolean
Whether or not to write PMD results toSystem.out
.void
ruleSetFiles
(Object... ruleSetFiles) Convenience method for adding rule set files.void
Convenience method for adding rule sets.void
setConsoleOutput
(boolean consoleOutput) Whether or not to write PMD results toSystem.out
.void
setRulePriority
(int intValue) Sets the rule priority threshold.void
setRuleSetConfig
(TextResource ruleSetConfig) The custom rule set to be used (if any).void
setRuleSetFiles
(FileCollection ruleSetFiles) The custom rule set files to be used.void
setRuleSets
(List<String> ruleSets) The built-in rule sets to be used.void
setTargetJdk
(Object value) Sets the target jdk used with pmd.void
setTargetJdk
(TargetJdk targetJdk) Sets the target jdk used with pmd.Methods inherited from class org.gradle.api.plugins.quality.CodeQualityExtension
getReportsDir, getSourceSets, getToolVersion, isIgnoreFailures, setIgnoreFailures, setReportsDir, setSourceSets, setToolVersion
-
Constructor Details
-
PmdExtension
-
-
Method Details
-
getRuleSets
The built-in rule sets to be used. See the official list of built-in rule sets. Example: ruleSets = ["basic", "braces"] -
setRuleSets
The built-in rule sets to be used. See the official list of built-in rule sets. Example: ruleSets = ["basic", "braces"] -
ruleSets
Convenience method for adding rule sets. Example: ruleSets "basic", "braces"- Parameters:
ruleSets
- the rule sets to be added
-
getTargetJdk
The target jdk to use with pmd, 1.3, 1.4, 1.5, 1.6, 1.7 or jsp -
setTargetJdk
Sets the target jdk used with pmd.- Parameters:
targetJdk
- The target jdk- Since:
- 4.0
-
setTargetJdk
Sets the target jdk used with pmd.- Parameters:
value
- The value for the target jdk as defined byTargetJdk.toVersion(Object)
-
getRulePriority
The rule priority threshold; violations for rules with a lower priority will not be reported. Default value is 5, which means that all violations will be reported. This is equivalent to PMD's Ant task minimumPriority property. See the official documentation for the list of priorities. Example: rulePriority = 3 -
setRulePriority
Sets the rule priority threshold. -
getRuleSetConfig
The custom rule set to be used (if any). ReplacesruleSetFiles
, except that it does not currently support multiple rule sets. See the official documentation for how to author a rule set. Example: ruleSetConfig = resources.text.fromFile("config/pmd/myRuleSet.xml")- Since:
- 2.2
-
setRuleSetConfig
The custom rule set to be used (if any). ReplacesruleSetFiles
, except that it does not currently support multiple rule sets. See the official documentation for how to author a rule set. Example: ruleSetConfig = resources.text.fromFile("config/pmd/myRuleSet.xml")- Since:
- 2.2
-
getRuleSetFiles
The custom rule set files to be used. See the official documentation for how to author a rule set file. Example: ruleSetFiles = files("config/pmd/myRuleSet.xml") -
setRuleSetFiles
The custom rule set files to be used. See the official documentation for how to author a rule set file. Example: ruleSetFiles = files("config/pmd/myRuleSet.xml") -
ruleSetFiles
Convenience method for adding rule set files. Example: ruleSetFiles "config/pmd/myRuleSet.xml"- Parameters:
ruleSetFiles
- the rule set files to be added
-
isConsoleOutput
Whether or not to write PMD results toSystem.out
. -
setConsoleOutput
Whether or not to write PMD results toSystem.out
.
-