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   * @threadSafe
13   */
14  // @SuppressWarnings("unchecked")
15  public class JSLintMojo extends MojoSupport {
16      private JSLintChecker jslint_;
17  
18      @Override
19      protected String[] getDefaultIncludes() throws Exception {
20          return new String[] { "**/**.js" };
21      }
22  
23      @Override
24      public void beforeProcess() throws Exception {
25          jslint_ = new JSLintChecker();
26      }
27  
28      @Override
29      public void afterProcess() throws Exception {
30      }
31  
32      @Override
33      protected void processFile(SourceFile src) throws Exception {
34          getLog().info("check file :" + src.toFile());
35          jslint_.check(src.toFile(), jsErrorReporter_);
36      }
37  }