View Javadoc
1   /*
2    * The akquinet maven-latex-plugin project
3    *
4    * Copyright (c) 2011 by akquinet tech@spree GmbH
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package eu.simuline.m2latex.mojo;
20  
21  import eu.simuline.m2latex.core.Target;
22  
23  import org.apache.maven.plugins.annotations.Mojo;
24  
25  import java.util.SortedSet;
26  import java.util.TreeSet;
27  
28  
29  // documentation occurs in latex:help
30  /**
31   * Checks all latex main files after having created all graphical files. 
32   */
33  @Mojo(name = "chk") // maybe , defaultPhase = LifecyclePhase.POST-SITE
34  // https://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.html
35  public class ChkMojo extends CfgLatexMojo {
36  
37     public SortedSet<Target> getTargetSet() {
38         SortedSet<Target> res = new TreeSet<Target>();
39         res.add(Target.chk);
40         return res;
41         //return EnumSet.of(Target.dvi);
42     }
43  }
44  // public class ChkMojo extends AbstractLatexMojo {
45  
46  //   /**
47  //    * Invoked by maven executing the plugin. 
48  //    * <p>
49  //    * Logging: 
50  //    * <ul>
51  //    * <li>WPP02: tex file may be latex main file 
52  //    * <li>WPP05: Included tex files which are no latex main files 
53  //    * <li>WPP06: Included tex files which are no latex main files 
54  //    * <li>WPP07: inluded/excluded files not identified by their names.
55  //    * <li>WFU01: Cannot read directory...
56  //    * <li>WFU03: cannot close tex file 
57  //    * <li>EFU05: Failed to delete file 
58  //    * <li>EFU07, EFU08, EFU09: if filtering a file fails. 
59  //    * </ul>
60  //    *
61  //    * @throws BuildFailureException 
62  //    *    TSS02 if the tex source processing directory does either not exist 
63  //    *    or is not a directory. 
64  //    */
65  //   public void execute() throws MojoFailureException {
66  //     initialize();
67  //     try {
68  //       // may throw BuildFailureException TSS02 
69  //       // may log warnings WPP02, WPP05, WPP06, WPP07, 
70  //       // WFU01, WFU03, EFU05 
71  //       // EFU07, EFU08, EFU09: if filtering a file fails. 
72  //       this.latexProcessor.checkAll();
73  //     } catch (BuildFailureException e) {
74  //       throw new MojoFailureException(e.getMessage(), e.getCause());
75  //     }
76  //   }
77  
78  // }