|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.googlecode.jslint4java.ant.JSLintTask
public class JSLintTask
Run JSLint
over a tree of files in order to pick holes in your
JavaScript.
Example build.xml usage:
<project name="build-test" xmlns:jsl="antlib:com.googlecode.jslint4java"> <target name="jslint"> <jsl:jslint options="undef"> <formatter type="plain" /> <fileset dir="." includes="*.js" excludes="*.pack.js" /> </jsl:jslint> </target> </project
You have to specify one or more nested fileset elements. You may optionally specify a formatter element in order to generate output (as opposed to just a build failed message). Usually, you will want the plain formatter, but in case you want to generate a report, the xml formatter mighht be useful.
encoding
haltOnFailure
options
Option
names. No default.timeout
FormatterElement
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
JSLintTask()
|
Method Summary | |
---|---|
void |
add(org.apache.tools.ant.types.ResourceCollection rc)
Check the contents of this ResourceCollection . |
void |
addConfiguredFormatter(FormatterElement fe)
Add in a ResultFormatter through the medium of a
FormatterElement . |
void |
addPredef(PredefElement predef)
Capture a predef element. |
void |
applyOptions(JSLint lint)
|
void |
execute()
Scan the specified directories for JavaScript files and lint them. |
JSLint |
makeLint()
Create a new JSLint object. |
void |
setEncoding(String encoding)
Set the encoding of the source files that JSLint will read. |
void |
setFailureProperty(String failureProperty)
The name of a property to set upon failure. |
void |
setHaltOnFailure(boolean haltOnFailure)
Should the build stop if JSLint fails? Defaults to true. |
void |
setJslint(File jslint)
Specify an alternative version of jslint. |
void |
setOptions(String optionList)
Set the options for running JSLint. |
void |
setTimeout(long timeout)
Set the maximum time JSLint can run for in seconds. |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSLintTask()
Method Detail |
---|
public void add(org.apache.tools.ant.types.ResourceCollection rc)
ResourceCollection
.
rc
- Any kind of resource collection, e.g. fileset.public void addConfiguredFormatter(FormatterElement fe)
ResultFormatter
through the medium of a
FormatterElement
.
fe
- public void addPredef(PredefElement predef)
public void applyOptions(JSLint lint)
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
public JSLint makeLint() throws org.apache.tools.ant.BuildException
JSLint
object.
org.apache.tools.ant.BuildException
public void setEncoding(String encoding)
file.encoding
property). If that isn't present, default to
UTF-8
.
encoding
- a valid charset identifier.public void setFailureProperty(String failureProperty)
public void setJslint(File jslint)
public void setHaltOnFailure(boolean haltOnFailure)
haltOnFailure
- public void setOptions(String optionList) throws org.apache.tools.ant.BuildException
Option
names. The names are case-insensitive.
NB: If you want to put an Option.PREDEF
in here, you should use a
<predef>
child element instead. Otherwise, it could be difficult
to specify a comma separated list as an element of a comma separated
list…
org.apache.tools.ant.BuildException
public void setTimeout(long timeout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |