Comparable<Task>
, org.gradle.api.internal.DynamicObjectAware
, org.gradle.api.internal.IConventionAware
, org.gradle.api.internal.TaskInternal
, ExtensionAware
, Reporting<CodeNarcReports>
, Task
, PatternFilterable
, VerificationTask
, org.gradle.util.Configurable<Task>
@CacheableTask public class CodeNarc extends SourceTask implements VerificationTask, Reporting<CodeNarcReports>
Task.Namer
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor | Description |
---|---|
CodeNarc() |
Modifier and Type | Method | Description |
---|---|---|
org.gradle.api.internal.project.IsolatedAntBuilder |
getAntBuilder() |
|
FileCollection |
getCodenarcClasspath() |
The class path containing the CodeNarc library to be used.
|
FileCollection |
getCompilationClasspath() |
The class path to be used by CodeNarc when compiling classes during analysis.
|
TextResource |
getConfig() |
The CodeNarc configuration to use.
|
File |
getConfigFile() |
The CodeNarc configuration file to use.
|
boolean |
getIgnoreFailures() |
Whether the build should break when the verifications performed by this task fail.
|
int |
getMaxPriority1Violations() |
The maximum number of priority 1 violations allowed before failing the build.
|
int |
getMaxPriority2Violations() |
The maximum number of priority 2 violations allowed before failing the build.
|
int |
getMaxPriority3Violations() |
The maximum number of priority 3 violations allowed before failing the build.
|
protected ObjectFactory |
getObjectFactory() |
|
CodeNarcReports |
getReports() |
The reports to be generated by this task.
|
FileTree |
getSource() |
Returns the source for this task, after the include and exclude patterns have been applied.
|
CodeNarcReports |
reports(Closure closure) |
Configures the reports to be generated by this task.
|
CodeNarcReports |
reports(Action<? super CodeNarcReports> configureAction) |
Configures the reports to be generated by this task.
|
void |
run() |
|
void |
setCodenarcClasspath(FileCollection codenarcClasspath) |
The class path containing the CodeNarc library to be used.
|
void |
setCompilationClasspath(FileCollection compilationClasspath) |
The class path to be used by CodeNarc when compiling classes during analysis.
|
void |
setConfig(TextResource config) |
The CodeNarc configuration to use.
|
void |
setConfigFile(File configFile) |
The CodeNarc configuration file to use.
|
void |
setIgnoreFailures(boolean ignoreFailures) |
Whether the build should break when the verifications performed by this task fail.
|
void |
setMaxPriority1Violations(int maxPriority1Violations) |
The maximum number of priority 1 violations allowed before failing the build.
|
void |
setMaxPriority2Violations(int maxPriority2Violations) |
The maximum number of priority 2 violations allowed before failing the build.
|
void |
setMaxPriority3Violations(int maxPriority3Violations) |
The maximum number of priority 3 violations allowed before failing the build.
|
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, source
conventionMapping, conventionMapping, getConventionMapping
newInputDirectory, newInputFile, newOutputDirectory, newOutputFile
appendParallelSafeAction, compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString
@PathSensitive(RELATIVE) public FileTree getSource()
The PathSensitivity
for the sources is configured to be PathSensitivity.ABSOLUTE
.
If your sources are less strict, please change it accordingly by overriding this method in your subclass.
getSource
in class SourceTask
public void setConfigFile(File configFile)
@Inject protected ObjectFactory getObjectFactory()
@Inject public org.gradle.api.internal.project.IsolatedAntBuilder getAntBuilder()
public void run()
public CodeNarcReports reports(Closure closure)
reports
in interface Reporting<CodeNarcReports>
closure
- The configurationpublic CodeNarcReports reports(Action<? super CodeNarcReports> configureAction)
reports
in interface Reporting<CodeNarcReports>
configureAction
- The configuration@Classpath public FileCollection getCodenarcClasspath()
public void setCodenarcClasspath(FileCollection codenarcClasspath)
@Incubating @Classpath public FileCollection getCompilationClasspath()
@Incubating public void setCompilationClasspath(FileCollection compilationClasspath)
public TextResource getConfig()
configFile
property.public void setConfig(TextResource config)
configFile
property.@Input public int getMaxPriority1Violations()
public void setMaxPriority1Violations(int maxPriority1Violations)
@Input public int getMaxPriority2Violations()
public void setMaxPriority2Violations(int maxPriority2Violations)
@Input public int getMaxPriority3Violations()
public void setMaxPriority3Violations(int maxPriority3Violations)
public CodeNarcReports getReports()
getReports
in interface Reporting<CodeNarcReports>
public boolean getIgnoreFailures()
getIgnoreFailures
in interface VerificationTask
public void setIgnoreFailures(boolean ignoreFailures)
setIgnoreFailures
in interface VerificationTask
ignoreFailures
- false to break the build on failure, true to ignore the failures. The default is false.