|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectTask
net.happygiraffe.jslint.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:net.happygiraffe.jslint">
<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.
encodinghaltOnFailureoptionsOption names. No default.
FormatterElement| Constructor Summary | |
|---|---|
JSLintTask()
|
|
| Method Summary | |
|---|---|
void |
addConfiguredFormatter(FormatterElement fe)
Add in a ResultFormatter through the medium of a
FormatterElement. |
void |
addFileset(FileSet fileset)
Check the contents of this FileSet. |
void |
execute()
Scan the specified directories for JavaScript files and lint them. |
void |
init()
Create a new JSLint object. |
void |
setEncoding(String encoding)
Set the encoding of the source files that JSLint will read. |
void |
setHaltOnFailure(boolean haltOnFailure)
Should the build stop if JSLint fails? Defaults to true. |
void |
setOptions(String optionList)
Set the options for running JSLint. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JSLintTask()
| Method Detail |
|---|
public void addConfiguredFormatter(FormatterElement fe)
ResultFormatter through the medium of a
FormatterElement.
fe - public void addFileset(FileSet fileset)
FileSet.
fileset -
public void execute()
throws BuildException
BuildException
public void init()
throws BuildException
JSLint object.
BuildExceptionpublic void setHaltOnFailure(boolean haltOnFailure)
haltOnFailure - public void setEncoding(String encoding)
file.encoding property). If that isn't present, default to
UTF-8.
encoding - a valid charset identifier.
public void setOptions(String optionList)
throws BuildException
Option names. The names are case-insensitive.
BuildException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||