Package org.gradle.api.plugins.quality
Klasse Pmd
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.SourceTask
org.gradle.api.plugins.quality.AbstractCodeQualityTask
org.gradle.api.plugins.quality.Pmd
- Alle implementierten Schnittstellen:
Comparable<Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.IConventionAware,org.gradle.api.internal.TaskInternal,Named,ExtensionAware,Reporting<PmdReports>,Task,PatternFilterable,VerificationTask,Configurable<Task>
@CacheableTask
public abstract class Pmd
extends AbstractCodeQualityTask
implements Reporting<PmdReports>
Runs a set of static code analysis rules on Java source code files and generates a report of problems found.
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.gradle.api.Task
Task.Namer -
Feldübersicht
Von Schnittstelle geerbte Felder org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungCompile class path for the classes to be analyzed.Controls whether to use incremental analysis or not.Path to the incremental cache file, if incremental analysis is used.The maximum number of failures to allow before stopping the build.The class path containing the PMD library to be used.final PmdReportsThe reports to be generated by this task.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.Specifies the rule priority threshold.Returns the source for this task, after the include and exclude patterns have been applied.The target JDK to use with PMD.Specifies the number of threads used by PMD.booleanWhether or not to write PMD results toSystem.out.Configures the reports to be generated by this task.reports(Action<? super PmdReports> configureAction) Configures the reports to be generated by this task.voidrun()voidsetClasspath(FileCollection classpath) Compile class path for the classes to be analyzed.voidsetConsoleOutput(boolean consoleOutput) Whether or not to write PMD results toSystem.out.voidsetPmdClasspath(FileCollection pmdClasspath) The class path containing the PMD library to be used.voidsetRuleSetConfig(TextResource ruleSetConfig) The custom rule set to be used (if any).voidsetRuleSetFiles(FileCollection ruleSetFiles) The custom rule set files to be used.voidsetRuleSets(List<String> ruleSets) The built-in rule sets to be used.voidsetTargetJdk(TargetJdk targetJdk) The target JDK to use with PMD.booleanstatic voidvalidate(int value) Validates the value is a valid PMD rules minimum priority (1-5)Von Klasse geerbte Methoden org.gradle.api.plugins.quality.AbstractCodeQualityTask
configureForkOptions, getIgnoreFailures, getIgnoreFailuresProperty, getJavaLauncher, getMaxHeapSize, getMinHeapSize, getObjectFactory, getToolchainService, getWorkerExecutor, setIgnoreFailuresVon Klasse geerbte Methoden org.gradle.api.tasks.SourceTask
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSet, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, sourceVon Klasse geerbte Methoden org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMappingVon Klasse geerbte Methoden org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceVon Klasse geerbte Methoden org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Konstruktordetails
-
Pmd
public Pmd()
-
-
Methodendetails
-
run
public void run() -
stdOutIsAttachedToTerminal
public boolean stdOutIsAttachedToTerminal() -
reports
Configures the reports to be generated by this task.- Angegeben von:
reportsin SchnittstelleReporting<PmdReports>- Parameter:
closure- The configuration- Gibt zurück:
- The report container
-
reports
Configures the reports to be generated by this task.- Angegeben von:
reportsin SchnittstelleReporting<PmdReports>- Parameter:
configureAction- The configuration- Gibt zurück:
- The report container
- Seit:
- 3.0
-
validate
public static void validate(int value) Validates the value is a valid PMD rules minimum priority (1-5)- Parameter:
value- rules minimum priority threshold
-
getSource
Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.The
PathSensitivityfor the sources is configured to bePathSensitivity.ABSOLUTE. If your sources are less strict, please change it accordingly by overriding this method in your subclass.- Setzt außer Kraft:
getSourcein KlasseSourceTask- Gibt zurück:
- The source.
-
getPmdClasspath
The class path containing the PMD library to be used. -
setPmdClasspath
The class path containing the PMD library to be used. -
getRuleSets
The built-in rule sets to be used. See the official list of built-in rule sets.ruleSets = ["basic", "braces"] -
setRuleSets
The built-in rule sets to be used. See the official list of built-in rule sets.ruleSets = ["basic", "braces"] -
getTargetJdk
The target JDK to use with PMD. -
setTargetJdk
The target JDK to use with PMD. -
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.ruleSetConfig = resources.text.fromFile(resources.file("config/pmd/myRuleSets.xml"))- Seit:
- 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.ruleSetConfig = resources.text.fromFile(resources.file("config/pmd/myRuleSets.xml"))- Seit:
- 2.2
-
getRuleSetFiles
The custom rule set files to be used. See the official documentation for how to author a rule set file. If you want to only use custom rule sets, you must clearruleSets.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. This adds to the default rule sets defined bygetRuleSets().ruleSetFiles = files("config/pmd/myRuleSets.xml") -
getReports
The reports to be generated by this task.- Angegeben von:
getReportsin SchnittstelleReporting<PmdReports>- Gibt zurück:
- The report container
-
getMaxFailures
The maximum number of failures to allow before stopping the build. Defaults to 0, which will stop the build on any failure. Values 0 and above are valid. IfignoreFailures
is set, this is ignored and the build will continue (infinite failures allowed).- Seit:
- 6.4
-
getRulesMinimumPriority
Specifies the rule priority threshold.- Seit:
- 6.8
- Siehe auch:
-
isConsoleOutput
Whether or not to write PMD results toSystem.out.- Seit:
- 2.1
-
setConsoleOutput
public void setConsoleOutput(boolean consoleOutput) Whether or not to write PMD results toSystem.out.- Seit:
- 2.1
-
getClasspath
Compile class path for the classes to be analyzed. The classes on this class path are used during analysis but aren't analyzed themselves. This is only well supported for PMD 5.2.1 or better.- Seit:
- 2.8
-
setClasspath
Compile class path for the classes to be analyzed. The classes on this class path are used during analysis but aren't analyzed themselves. This is only well supported for PMD 5.2.1 or better.- Seit:
- 2.8
-
getIncrementalAnalysis
Controls whether to use incremental analysis or not. This is only supported for PMD 6.0.0 or better. See for more details.- Seit:
- 5.6
-
getIncrementalCacheFile
Path to the incremental cache file, if incremental analysis is used.- Seit:
- 5.6
-
getThreads
Specifies the number of threads used by PMD.- Seit:
- 7.5
- Siehe auch:
-