public class PmdExtension extends CodeQualityExtension
PmdPlugin
Constructor | Description |
---|---|
PmdExtension(Project project) |
Modifier and Type | Method | Description |
---|---|---|
Property<java.lang.Boolean> |
getIncrementalAnalysis() |
Controls whether to use incremental analysis or not.
|
Property<java.lang.Integer> |
getMaxFailures() |
The maximum number of failures to allow before stopping the build.
|
TextResource |
getRuleSetConfig() |
The custom rule set to be used (if any).
|
FileCollection |
getRuleSetFiles() |
The custom rule set files to be used.
|
java.util.List<java.lang.String> |
getRuleSets() |
The built-in rule sets to be used.
|
Property<java.lang.Integer> |
getRulesMinimumPriority() |
The rule priority threshold; violations for rules with a lower priority will not be reported.
|
TargetJdk |
getTargetJdk() |
The target jdk to use with pmd, 1.3, 1.4, 1.5, 1.6, 1.7 or jsp
|
Property<java.lang.Integer> |
getThreads() |
The number of threads used by PMD.
|
boolean |
isConsoleOutput() |
Whether or not to write PMD results to
System.out . |
void |
ruleSetFiles(java.lang.Object... ruleSetFiles) |
Convenience method for adding rule set files.
|
void |
ruleSets(java.lang.String... ruleSets) |
Convenience method for adding rule sets.
|
void |
setConsoleOutput(boolean consoleOutput) |
Whether or not to write PMD results to
System.out . |
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(java.util.List<java.lang.String> ruleSets) |
The built-in rule sets to be used.
|
void |
setTargetJdk(java.lang.Object value) |
Sets the target jdk used with pmd.
|
void |
setTargetJdk(TargetJdk targetJdk) |
Sets the target jdk used with pmd.
|
getReportsDir, getSourceSets, getToolVersion, isIgnoreFailures, setIgnoreFailures, setReportsDir, setSourceSets, setToolVersion
public PmdExtension(Project project)
public java.util.List<java.lang.String> getRuleSets()
ruleSets = ["category/java/errorprone.xml", "category/java/bestpractices.xml"]
public void setRuleSets(java.util.List<java.lang.String> ruleSets)
ruleSets = ["category/java/errorprone.xml", "category/java/bestpractices.xml"]
public void ruleSets(java.lang.String... ruleSets)
ruleSets "category/java/errorprone.xml", "category/java/bestpractices.xml"
ruleSets
- the rule sets to be addedpublic TargetJdk getTargetJdk()
public void setTargetJdk(TargetJdk targetJdk)
targetJdk
- The target jdkpublic Property<java.lang.Integer> getMaxFailures()
ignoreFailuresis set, this is ignored and no limit is enforced.
public void setTargetJdk(java.lang.Object value)
value
- The value for the target jdk as defined by TargetJdk.toVersion(Object)
public Property<java.lang.Integer> getRulesMinimumPriority()
rulesMinimumPriority = 3
@Nullable public TextResource getRuleSetConfig()
ruleSetFiles
, except that it does not currently support multiple rule sets.
See the official documentation for how to author a rule set.
ruleSetConfig = resources.text.fromFile("config/pmd/myRuleSet.xml")
public void setRuleSetConfig(@Nullable TextResource ruleSetConfig)
ruleSetFiles
, except that it does not currently support multiple rule sets.
See the official documentation for how to author a rule set.
ruleSetConfig = resources.text.fromFile("config/pmd/myRuleSet.xml")
public FileCollection getRuleSetFiles()
ruleSets
.
ruleSetFiles = files("config/pmd/myRuleSet.xml")
public void setRuleSetFiles(FileCollection ruleSetFiles)
getRuleSets()
.
ruleSetFiles = files("config/pmd/myRuleSets.xml")
public void ruleSetFiles(java.lang.Object... ruleSetFiles)
ruleSetFiles "config/pmd/myRuleSet.xml"
ruleSetFiles
- the rule set files to be addedpublic boolean isConsoleOutput()
System.out
.public void setConsoleOutput(boolean consoleOutput)
System.out
.public Property<java.lang.Boolean> getIncrementalAnalysis()
@Incubating public Property<java.lang.Integer> getThreads()