View Javadoc

1   package net_alchim31_maven_yuicompressor;
2   
3   
4   /**
5    * Check JS files with jslint.
6    *
7    * @goal jslint
8    * @phase process-resources
9    *
10   * @author David Bernard
11   * @created 2007-08-29
12   */
13  // @SuppressWarnings("unchecked")
14  public class JSLintMojo extends MojoSupport {
15      private JSLintChecker jslint_;
16  
17      @Override
18      protected String[] getDefaultIncludes() throws Exception {
19          return new String[] { "**/**.js" };
20      }
21  
22      @Override
23      public void beforeProcess() throws Exception {
24          jslint_ = new JSLintChecker();
25      }
26  
27      @Override
28      public void afterProcess() throws Exception {
29      }
30  
31      @Override
32      protected void processFile(SourceFile src) throws Exception {
33          getLog().info("check file :" + src.toFile());
34          jslint_.check(src.toFile(), jsErrorReporter_);
35      }
36  }