1 package eu.simuline.m2latex.antTask;
2
3 import org.apache.tools.ant.BuildException;
4
5 import eu.simuline.m2latex.core.BuildFailureException;
6 import eu.simuline.m2latex.core.ParameterAdapter;
7 import eu.simuline.m2latex.core.Target;
8 import eu.simuline.m2latex.core.LatexProcessor;
9
10 import java.util.SortedSet;
11
12 public class LatexCfgTask extends AbstractLatexTask {
13
14 // api-docs inherited from ParameterAdapter
15 public SortedSet<Target> getTargetSet() {
16 return this.settings.getTargetSet();
17 }
18
19 /**
20 * Invoked by ant executing the task.
21 * <p>
22 * Logging:
23 * <ul>
24 * <li> WFU01: Cannot read directory...
25 * <li> WFU03: cannot close
26 * <li> EFU07, EFU08, EFU09: if filtering a file fails.
27 * <li> WPP02: tex file may be latex main file
28 * <li> WPP03: Skipped processing of files with suffixes ...
29 * <li> EEX01, EEX02, EEX03, WEX04, WEX05:
30 * applications for preprocessing graphic files
31 * or processing a latex main file fails.
32 * </ul>
33 * @throws BuildException
34 * <ul>
35 * <li> TSS01 if
36 * the tex source directory does either not exist
37 * or is not a directory.
38 * <li> TSS02 if
39 * the tex source processing directory does either not exist
40 * or is not a directory.
41 * <li> TSS03 if
42 * the output directory exists and is no directory.
43 * <li> TEX01 if
44 * invocation of applications for preprocessing graphic files
45 * or processing a latex main file fails
46 * <li> TFU01 if
47 * the target directory that would be returned
48 * exists already as a regular file.
49 * <li> TFU03, TFU04, TFU05, TFU06 if
50 * copy of output files to target folder fails.
51 * For details see {@link LatexProcessor#create()}.
52 * </ul>
53 */
54 public void execute() throws BuildException {
55 initialize();
56 try {
57 // may throw BuildFailureException
58 // TSS01, TSS02, TSS03, TEX01, TFU01, TFU03, TFU04, TFU05, TFU06
59 // may log WFU01, WFU03, EFU05, EFU07, EFU08, EFU09
60 // WPP02, WPP03,
61 // EEX01, EEX02, EEX03, WEX04, WEX05
62 this.latexProcessor.create();
63 } catch (BuildFailureException e) {
64 throw new BuildException(e.getMessage(), e.getCause());
65 }
66 }
67 }