public class CodeNarc extends SourceTask implements VerificationTask, Reporting<CodeNarcReports>
Task.Namer
source
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor and Description |
---|
CodeNarc() |
Modifier and Type | Method and Description |
---|---|
org.gradle.api.internal.project.IsolatedAntBuilder |
getAntBuilder() |
FileCollection |
getCodenarcClasspath()
The class path containing the CodeNarc library to be used.
|
TextResource |
getConfig()
The CodeNarc configuration to use.
|
File |
getConfigFile()
The CodeNarc configuration file to use.
|
boolean |
getIgnoreFailures()
Whether or not the build should break when the verifications performed by this task fail.
|
org.gradle.internal.reflect.Instantiator |
getInstantiator() |
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.
|
CodeNarcReports |
getReports()
The reports to be generated by this task.
|
CodeNarcReports |
reports(Action<? super CodeNarcReports> configureAction)
Configures the reports to be generated by this task.
|
CodeNarcReports |
reports(Closure closure)
Configures the reports to be generated by this task.
|
void |
run() |
void |
setCodenarcClasspath(FileCollection codenarcClasspath) |
void |
setConfig(TextResource config) |
void |
setConfigFile(File configFile)
The CodeNarc configuration file to use.
|
void |
setIgnoreFailures(boolean ignoreFailures)
Specifies whether the build should break when the verifications performed by this task fail.
|
void |
setMaxPriority1Violations(int maxPriority1Violations) |
void |
setMaxPriority2Violations(int maxPriority2Violations) |
void |
setMaxPriority3Violations(int maxPriority3Violations) |
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
public void setConfigFile(File configFile)
@Inject public org.gradle.internal.reflect.Instantiator getInstantiator()
@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@OrderSensitive @InputFiles public FileCollection getCodenarcClasspath()
public void setCodenarcClasspath(FileCollection codenarcClasspath)
@Incubating public TextResource getConfig()
configFile
property.public void setConfig(TextResource config)
@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>
@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.