net.sf.alchim.mojo.yuicompressor.JSLintMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yuicompressor-maven-plugin Show documentation
Show all versions of yuicompressor-maven-plugin Show documentation
To compress (Minify + Ofuscate) Javascript files and CSS files (using YUI Compressor from Julien Lecomte) and/or
to check Javascript files with jslint.
package net.sf.alchim.mojo.yuicompressor;
import java.io.File;
/**
* Check JS files with jslint.
*
* @goal jslint
*
* @author David Bernard
* @created 2007-08-29
*/
// @SuppressWarnings("unchecked")
public class JSLintMojo extends MojoSupport {
private JSLintChecker jslint_;
@Override
protected String[] getDefaultIncludes() throws Exception {
return new String[] { "**/**.js" };
}
@Override
public void beforeProcess() throws Exception {
jslint_ = new JSLintChecker();
}
@Override
public void afterProcess() throws Exception {
}
@Override
protected void processFile(SourceFile src, File destRoot) throws Exception {
getLog().info("check file :" + src.toFile());
jslint_.check(src.toFile(), jsErrorReporter_);
}
}