public class Pmd extends SourceTask implements VerificationTask, Reporting<PmdReports>
PmdPlugin
,
PmdExtension
Task.Namer
source
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor and Description |
---|
Pmd() |
Modifier and Type | Method and Description |
---|---|
org.gradle.api.internal.project.IsolatedAntBuilder |
getAntBuilder() |
FileCollection |
getClasspath()
Compile class path for the classes to be analyzed.
|
boolean |
getIgnoreFailures()
Whether or not to allow the build to continue if there are warnings.
|
org.gradle.internal.reflect.Instantiator |
getInstantiator() |
FileCollection |
getPmdClasspath()
The class path containing the PMD library to be used.
|
PmdReports |
getReports()
The reports to be generated by this task.
|
int |
getRulePriority()
Specifies the rule priority threshold.
|
TextResource |
getRuleSetConfig()
The custom rule set to be used (if any).
|
FileCollection |
getRuleSetFiles()
The custom rule set files to be used.
|
List<String> |
getRuleSets()
The built-in rule sets to be used.
|
TargetJdk |
getTargetJdk()
The target JDK to use with PMD.
|
boolean |
isConsoleOutput()
Whether or not to write PMD results to
System.out . |
PmdReports |
reports(Action<? super PmdReports> configureAction)
Configures the reports to be generated by this task.
|
PmdReports |
reports(Closure closure)
Configures the reports to be generated by this task.
|
void |
run() |
void |
setClasspath(FileCollection classpath) |
void |
setConsoleOutput(boolean consoleOutput) |
void |
setIgnoreFailures(boolean ignoreFailures)
Specifies whether the build should break when the verifications performed by this task fail.
|
void |
setPmdClasspath(FileCollection pmdClasspath) |
void |
setRulePriority(int intValue)
Sets the rule priority threshold.
|
void |
setRuleSetConfig(TextResource ruleSetConfig) |
void |
setRuleSetFiles(FileCollection ruleSetFiles) |
void |
setRuleSets(List<String> ruleSets) |
void |
setTargetJdk(TargetJdk targetJdk) |
boolean |
stdOutIsAttachedToTerminal() |
static void |
validate(int value)
Validates the value is a valid PMD RulePriority (1-5)
|
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, getSource, include, include, include, include, setExcludes, setIncludes, setSource, source
conventionMapping, conventionMapping, getConventionMapping
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActionClassLoaders, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString
@Incubating public void setRulePriority(int intValue)
@Inject public org.gradle.internal.reflect.Instantiator getInstantiator()
@Inject public org.gradle.api.internal.project.IsolatedAntBuilder getAntBuilder()
public void run()
public boolean stdOutIsAttachedToTerminal()
public PmdReports reports(@DelegatesTo(value=PmdReports.class,strategy=1) Closure closure)
reports
in interface Reporting<PmdReports>
closure
- The configurationpublic PmdReports reports(Action<? super PmdReports> configureAction)
reports
in interface Reporting<PmdReports>
configureAction
- The configurationpublic static void validate(int value)
value
- rule priority threshold@InputFiles public FileCollection getPmdClasspath()
public void setPmdClasspath(FileCollection pmdClasspath)
@Input public List<String> getRuleSets()
public void setTargetJdk(TargetJdk targetJdk)
@Incubating @Optional 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.
Example: ruleSetConfig = resources.text.fromFile(resources.file("config/pmd/myRuleSets.xml"))public void setRuleSetConfig(TextResource ruleSetConfig)
@InputFiles public FileCollection getRuleSetFiles()
public void setRuleSetFiles(FileCollection ruleSetFiles)
public final PmdReports getReports()
getReports
in interface Reporting<PmdReports>
@Input public boolean getIgnoreFailures()
getIgnoreFailures
in interface VerificationTask
public void setIgnoreFailures(boolean ignoreFailures)
VerificationTask
setIgnoreFailures
in interface VerificationTask
ignoreFailures
- false to break the build on failure, true to ignore the failures. The default is false.@Input @Incubating public int getRulePriority()
PmdExtension.rulePriority
@Input @Incubating public boolean isConsoleOutput()
System.out
.public void setConsoleOutput(boolean consoleOutput)
@InputFiles @Optional @Incubating public FileCollection getClasspath()
public void setClasspath(FileCollection classpath)