View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  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,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.rat.anttasks;
21  
22  import org.apache.commons.cli.Option;
23  import org.apache.commons.lang3.StringUtils;
24  import org.apache.rat.commandline.Arg;
25  import org.apache.rat.DeprecationReporter;
26  import org.apache.rat.utils.CasedString;
27  import org.apache.rat.utils.DefaultLog;
28  import org.apache.rat.utils.Log;
29  import org.apache.tools.ant.Task;
30  import org.apache.tools.ant.types.FileSet;
31  import org.apache.tools.ant.types.Resource;
32  import org.apache.tools.ant.types.resources.FileResource;
33  
34  import java.util.ArrayList;
35  import java.util.Arrays;
36  import java.util.Collections;
37  import java.util.HashMap;
38  import java.util.List;
39  import java.util.Locale;
40  import java.util.Map;
41  import java.util.Objects;
42  import java.util.stream.Collectors;
43  /**
44   * Generated class to provide Ant support for standard RAT command line options.
45   *
46   * DO NOT EDIT - GENERATED FILE
47   */
48  public abstract class BaseAntTask extends Task {
49  
50      private static final Map<String, String> xlateName = new HashMap<>();
51  
52      private static final List<String> unsupportedArgs = new ArrayList<>();
53  
54      private static final Map<String, String> deprecatedArgs = new HashMap<>();
55  
56      static {
57          xlateName.put("addLicense", "add-license");
58          unsupportedArgs.add("a");
59          unsupportedArgs.add("input-include-file");
60          unsupportedArgs.add("input-source");
61          unsupportedArgs.add("input-exclude-file");
62          unsupportedArgs.add("log-level");
63          unsupportedArgs.add("license-families-approved-file");
64          unsupportedArgs.add("input-exclude-std");
65          unsupportedArgs.add("help");
66          unsupportedArgs.add("dir");
67          unsupportedArgs.add("license-families-denied-file");
68          unsupportedArgs.add("licenses-denied-file");
69          unsupportedArgs.add("licenses-approved-file");
70          unsupportedArgs.add("input-include-std");
71          deprecatedArgs.put("copyright", "Use of deprecated option 'copyright'. Deprecated for removal since 0.17: Use editCopyright attribute instead.");
72          deprecatedArgs.put("force", "Use of deprecated option 'force'. Deprecated for removal since 0.17: Use editOverwrite attribute instead.");
73          deprecatedArgs.put("addLicense", "Use of deprecated option 'addLicense'. Deprecated for removal since 0.17: Use editLicense attribute instead.");
74          deprecatedArgs.put("licenses", "Use of deprecated option 'licenses'. Deprecated for removal since 0.17: Use <config> instead.");
75          deprecatedArgs.put("no-default-licenses", "Use of deprecated option 'noDefaultLicenses'. Deprecated for removal since 0.17: Use configurationNoDefaults attribute instead.");
76          deprecatedArgs.put("exclude", "Use of deprecated option 'exclude'. Deprecated for removal since 0.17: Use <inputExclude> instead.");
77          deprecatedArgs.put("exclude-file", "Use of deprecated option 'excludeFile'. Deprecated for removal since 0.17: Use inputExcludeFile attribute instead.");
78          deprecatedArgs.put("include", "Use of deprecated option 'include'. Deprecated for removal since 0.17: Use <inputInclude> instead.");
79          deprecatedArgs.put("includes-file", "Use of deprecated option 'includesFile'. Deprecated for removal since 0.17: Use inputIncludeFile attribute instead.");
80          deprecatedArgs.put("scan-hidden-directories", "Use of deprecated option 'scanHiddenDirectories'. Deprecated for removal since 0.17: Use <inputIncludeStd> with 'HIDDEN_DIR' argument instead.");
81          deprecatedArgs.put("stylesheet", "Use of deprecated option 'stylesheet'. Deprecated for removal since 0.17: Use outputStyle attribute instead.");
82          deprecatedArgs.put("xml", "Use of deprecated option 'xml'. Deprecated for removal since 0.17: Use outputStyle attribute with the 'xml' argument instead.");
83          deprecatedArgs.put("list-licenses", "Use of deprecated option 'listLicenses'. Deprecated for removal since 0.17: Use outputLicenses attribute instead.");
84          deprecatedArgs.put("list-families", "Use of deprecated option 'listFamilies'. Deprecated for removal since 0.17: Use outputFamilies attribute instead.");
85          deprecatedArgs.put("out", "Use of deprecated option 'out'. Deprecated for removal since 0.17: Use outputFile attribute instead.");
86      }
87  
88      public static String createName(String longOpt) {
89          String name = StringUtils.defaultIfEmpty(xlateName.get(longOpt), longOpt).toLowerCase(Locale.ROOT);
90          return new CasedString(CasedString.StringCase.KEBAB, name).toCase(CasedString.StringCase.CAMEL);
91      }
92  
93      public static List<String> unsupportedArgs() {
94          return Collections.unmodifiableList(unsupportedArgs);
95      }
96  
97      ///////////////////////// Start common Arg manipulation code
98  
99      /**
100      * Sets the deprecation report method.
101      */
102     private static void setDeprecationReporter() {
103         DeprecationReporter.setLogReporter(opt -> {
104             String msg = deprecatedArgs.get(argsKey(opt));
105             if (msg == null) {
106                 DeprecationReporter.getDefault().accept(opt);
107             } else {
108                 DefaultLog.getInstance().warn(msg);
109             }
110         });
111     }
112 
113     private static String argsKey(Option opt) {
114         return StringUtils.defaultIfEmpty(opt.getLongOpt(), opt.getKey());
115     }
116 
117     /**
118      * A map of CLI-based arguments to values.
119      */
120     protected final Map<String, List<String>> args = new HashMap<>();
121 
122     /**
123      * Gets the list of arguments prepared for the CLI code to parse.
124      * @return the List of arguments for the CLI command line.
125      */
126     protected List<String> args() {
127         List<String> result = new ArrayList<>();
128         for (Map.Entry<String, List<String>> entry : args.entrySet()) {
129             result.add("--" + entry.getKey());
130             result.addAll(entry.getValue().stream().filter(Objects::nonNull).collect(Collectors.toList()));
131         }
132         return result;
133     }
134 
135     private boolean validateSet(String key) {
136         Arg arg = Arg.findArg(key);
137         if (arg != null) {
138             Option opt = arg.find(key);
139             Option main = arg.option();
140             if (opt.isDeprecated()) {
141                 args.remove(argsKey(main));
142                 // deprecated options must be explicitly set so let it go.
143                 return true;
144             }
145             // non-deprecated options may have default so ignore it if another option has already been set.
146             for (Option o : arg.group().getOptions()) {
147                 if (!o.equals(main)) {
148                     if (args.containsKey(argsKey(o))) {
149                         return false;
150                     }
151                 }
152             }
153             return true;
154         }
155         return false;
156     }
157 
158     /**
159      * Set a key and value into the argument list.
160      * Replaces any existing value.
161      * @param key the key for the map.
162      * @param value the value to set.
163      */
164     protected void setArg(String key, String value) {
165         if (value == null || StringUtils.isNotBlank(value)) {
166             if (validateSet(key)) {
167                 List<String> values = new ArrayList<>();
168                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
169                     DefaultLog.getInstance().debug(String.format("Setting %s to '%s'", key, value));
170                 }
171                 values.add(value);
172                 args.put(key, values);
173             }
174         }
175     }
176 
177     /**
178      * Get the list of values for a key.
179      * @param key the key for the map.
180      * @return the list of values for the key or {@code null} if not set.
181      */
182     public List<String> getArg(String key) {
183         return args.get(key);
184     }
185 
186     /**
187      * Add values to the key in the argument list.
188      * empty values are ignored. If no non-empty values are present no change is made.
189      * If the key does not exist, adds it.
190      * @param key the key for the map.
191      * @param value the array of values to set.
192      */
193     protected void addArg(String key, String[] value) {
194         List<String> newValues = Arrays.stream(value).filter(StringUtils::isNotBlank).collect(Collectors.toList());
195         if (!newValues.isEmpty()) {
196             if (validateSet(key)) {
197                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
198                     DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));
199                 }
200                 List<String> values = args.computeIfAbsent(key, k -> new ArrayList<>());
201                 values.addAll(newValues);
202             }
203         }
204     }
205 
206     /**
207      * Add a value to the key in the argument list.
208      * If the key does not exist, adds it.
209      * @param key the key for the map.
210      * @param value the value to set.
211      */
212     protected void addArg(String key, String value) {
213         if (StringUtils.isNotBlank(value)) {
214             if (validateSet(key)) {
215                 List<String> values = args.get(key);
216                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
217                     DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));
218                 }
219                 if (values == null) {
220                     values = new ArrayList<>();
221                     args.put(key, values);
222                 }
223                 values.add(value);
224             }
225         }
226     }
227 
228     /**
229      * Remove a key from the argument list.
230      * @param key the key to remove from the map.
231      */
232     protected void removeArg(String key) {
233         args.remove(key);
234     }
235 
236  ///////////////////////// End common Arg manipulation code
237 
238     protected BaseAntTask() {
239         setDeprecationReporter();
240     }
241 
242     /*  GENERATED METHODS */
243 
244     /**
245      * The copyright message to use in the license headers.
246      * @param copyright Copyright message to use in the license headers.
247      * @deprecated Deprecated for removal since 0.17: Use editCopyright attribute instead.
248      */
249     public void setCopyright(String copyright) {
250         setArg("copyright", copyright);
251 
252     }
253 
254     /**
255      * The copyright message to use in the license headers. Usually in the form of &quot;Copyright 2008 Foo&quot;.  Only valid with editLicense attribute
256      * @param editCopyright Copyright message to use in the license headers.
257      */
258     public void setEditCopyright(String editCopyright) {
259         setArg("edit-copyright", editCopyright);
260 
261     }
262 
263     /**
264      * Forces any changes in files to be written directly to the source files so that new files are not created.
265      * @param force The state
266      * @deprecated Deprecated for removal since 0.17: Use editOverwrite attribute instead.
267      */
268     public void setForce(boolean force) {
269         if (force) { setArg("force", null); } else { removeArg("force"); }
270     }
271 
272     /**
273      * Forces any changes in files to be written directly to the source files so that new files are not created. Only valid with editLicense attribute.
274      * @param editOverwrite The state
275      */
276     public void setEditOverwrite(boolean editOverwrite) {
277         if (editOverwrite) { setArg("edit-overwrite", null); } else { removeArg("edit-overwrite"); }
278     }
279 
280     /**
281      * Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list.
282      * @param addLicense The state
283      * @deprecated Deprecated for removal since 0.17: Use editLicense attribute instead.
284      */
285     public void setAddLicense(boolean addLicense) {
286         if (addLicense) { setArg("addLicense", null); } else { removeArg("addLicense"); }
287     }
288 
289     /**
290      * Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list. By default new files will be created with the license header, to force the modification of existing files use the editOverwrite attribute option.
291      * @param editLicense The state
292      */
293     public void setEditLicense(boolean editLicense) {
294         if (editLicense) { setArg("edit-license", null); } else { removeArg("edit-license"); }
295     }
296 
297     /**
298      * Ignore default configuration.
299      * @param configurationNoDefaults The state
300      */
301     public void setConfigurationNoDefaults(boolean configurationNoDefaults) {
302         if (configurationNoDefaults) { setArg("configuration-no-defaults", null); } else { removeArg("configuration-no-defaults"); }
303     }
304 
305     /**
306      * Ignore default configuration.
307      * @param noDefaultLicenses The state
308      * @deprecated Deprecated for removal since 0.17: Use configurationNoDefaults attribute instead.
309      */
310     public void setNoDefaultLicenses(boolean noDefaultLicenses) {
311         if (noDefaultLicenses) { setArg("no-default-licenses", null); } else { removeArg("no-default-licenses"); }
312     }
313 
314     /**
315      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
316      * @param excludeFile &lt;Expression&gt; entries from a file.
317      * @deprecated Deprecated for removal since 0.17: Use inputExcludeFile attribute instead.
318      */
319     public void setExcludeFile(String excludeFile) {
320         setArg("exclude-file", excludeFile);
321 
322     }
323 
324     /**
325      * Excludes files with sizes less than the number of bytes specified. Argument should be a Integer. (See Argument Types for clarification)
326      * @param inputExcludeSize Files with sizes less than the number of bytes specified.
327      */
328     public void setInputExcludeSize(String inputExcludeSize) {
329         setArg("input-exclude-size", inputExcludeSize);
330 
331     }
332 
333     /**
334      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
335      * @param includesFile &lt;Expression&gt; entries from a file.
336      * @deprecated Deprecated for removal since 0.17: Use inputIncludeFile attribute instead.
337      */
338     public void setIncludesFile(String includesFile) {
339         setArg("includes-file", includesFile);
340 
341     }
342 
343     /**
344      * Scans hidden directories.
345      * @param scanHiddenDirectories The state
346      * @deprecated Deprecated for removal since 0.17: Use &lt;inputIncludeStd&gt; with 'HIDDEN_DIR' argument instead.
347      */
348     public void setScanHiddenDirectories(boolean scanHiddenDirectories) {
349         if (scanHiddenDirectories) { setArg("scan-hidden-directories", null); } else { removeArg("scan-hidden-directories"); }
350     }
351 
352     /**
353      * XSLT stylesheet to use when creating the report. Either an external xsl file may be specified or one of the internal named sheets. Argument should be a StyleSheet. (See Argument Types for clarification)
354      * @param outputStyle Stylesheet to use when creating the report.
355      */
356     public void setOutputStyle(String outputStyle) {
357         setArg("output-style", outputStyle);
358 
359     }
360 
361     /**
362      * XSLT stylesheet to use when creating the report. Argument should be a StyleSheet. (See Argument Types for clarification)
363      * @param stylesheet Stylesheet to use when creating the report.
364      * @deprecated Deprecated for removal since 0.17: Use outputStyle attribute instead.
365      */
366     public void setStylesheet(String stylesheet) {
367         setArg("stylesheet", stylesheet);
368 
369     }
370 
371     /**
372      * forces XML output rather than the textual report.
373      * @param xml The state
374      * @deprecated Deprecated for removal since 0.17: Use outputStyle attribute with the 'xml' argument instead.
375      */
376     public void setXml(boolean xml) {
377         if (xml) { setArg("xml", null); } else { removeArg("xml"); }
378     }
379 
380     /**
381      * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
382      * @param outputLicenses The defined licenses.
383      */
384     public void setOutputLicenses(String outputLicenses) {
385         setArg("output-licenses", outputLicenses);
386 
387     }
388 
389     /**
390      * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
391      * @param listLicenses The defined licenses.
392      * @deprecated Deprecated for removal since 0.17: Use outputLicenses attribute instead.
393      */
394     public void setListLicenses(String listLicenses) {
395         setArg("list-licenses", listLicenses);
396 
397     }
398 
399     /**
400      * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
401      * @param outputFamilies The defined license families.
402      */
403     public void setOutputFamilies(String outputFamilies) {
404         setArg("output-families", outputFamilies);
405 
406     }
407 
408     /**
409      * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
410      * @param listFamilies The defined license families.
411      * @deprecated Deprecated for removal since 0.17: Use outputFamilies attribute instead.
412      */
413     public void setListFamilies(String listFamilies) {
414         setArg("list-families", listFamilies);
415 
416     }
417 
418     /**
419      * If set do not update the files but generate the reports.
420      * @param dryRun The state
421      */
422     public void setDryRun(boolean dryRun) {
423         if (dryRun) { setArg("dry-run", null); } else { removeArg("dry-run"); }
424     }
425 
426     /**
427      * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
428      * @param out The output file where to write a report to.
429      * @deprecated Deprecated for removal since 0.17: Use outputFile attribute instead.
430      */
431     public void setOut(String out) {
432         setArg("out", out);
433 
434     }
435 
436     /**
437      * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
438      * @param outputFile The output file where to write a report to.
439      */
440     public void setOutputFile(String outputFile) {
441         setArg("output-file", outputFile);
442 
443     }
444 
445     /**
446      * Specifies the level of detail in ARCHIVE file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
447      * @param outputArchive The level of detail in ARCHIVE file reporting.
448      */
449     public void setOutputArchive(String outputArchive) {
450         setArg("output-archive", outputArchive);
451 
452     }
453 
454     /**
455      * Specifies the level of detail in STANDARD file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
456      * @param outputStandard The level of detail in STANDARD file reporting.
457      */
458     public void setOutputStandard(String outputStandard) {
459         setArg("output-standard", outputStandard);
460 
461     }
462 
463     /**
464      * Print information about registered licenses.
465      * @param helpLicenses The state
466      */
467     public void setHelpLicenses(boolean helpLicenses) {
468         if (helpLicenses) { setArg("help-licenses", null); } else { removeArg("help-licenses"); }
469     }
470 
471 
472 
473     /*  GENERATED CLASSES */
474 
475     /**
476      * File names for system configuration.
477      */
478     public Config createConfig() {
479         return new Config();
480     }
481 
482     public class Config {
483         Config() { }
484 
485         public void addConfiguredFileset(FileSet fileSet) {
486             for (Resource resource : fileSet) {
487                 if (resource.isFilesystemOnly()) {
488                     addArg("config", ((FileResource) resource).getFile().getAbsolutePath());
489                 }
490             }
491         }
492 
493     }
494     /**
495      * File names for system configuration.
496      * @deprecated Deprecated for removal since 0.17: Use &lt;config&gt; instead.
497      */
498     public Licenses createLicenses() {
499         return new Licenses();
500     }
501 
502     public class Licenses {
503         Licenses() { }
504 
505         public void addConfiguredFileset(FileSet fileSet) {
506             for (Resource resource : fileSet) {
507                 if (resource.isFilesystemOnly()) {
508                     addArg("licenses", ((FileResource) resource).getFile().getAbsolutePath());
509                 }
510             }
511         }
512 
513     }
514     /**
515      * A comma separated list of approved License IDs. These licenses will be added to the list of approved licenses.
516      */
517     public LicensesApproved createLicensesApproved() {
518         return new LicensesApproved();
519     }
520 
521     public class LicensesApproved {
522         LicensesApproved() { }
523 
524         public void addConfiguredFileset(FileSet fileSet) {
525             for (Resource resource : fileSet) {
526                 if (resource.isFilesystemOnly()) {
527                     addArg("licenses-approved-file", ((FileResource) resource).getFile().getAbsolutePath());
528                 }
529             }
530         }
531 
532         public void addConfiguredLst(Lst licenseID) {
533             addArg("licenses-approved", licenseID.value);
534         }
535 
536     }
537     /**
538      * A comma separated list of approved license family IDs. These license families will be added to the list of approved license families.
539      */
540     public LicenseFamiliesApproved createLicenseFamiliesApproved() {
541         return new LicenseFamiliesApproved();
542     }
543 
544     public class LicenseFamiliesApproved {
545         LicenseFamiliesApproved() { }
546 
547         public void addConfiguredFileset(FileSet fileSet) {
548             for (Resource resource : fileSet) {
549                 if (resource.isFilesystemOnly()) {
550                     addArg("license-families-approved-file", ((FileResource) resource).getFile().getAbsolutePath());
551                 }
552             }
553         }
554 
555         public void addConfiguredLst(Lst familyID) {
556             addArg("license-families-approved", familyID.value);
557         }
558 
559     }
560     /**
561      * A comma separated list of denied License IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back.
562      */
563     public LicensesDenied createLicensesDenied() {
564         return new LicensesDenied();
565     }
566 
567     public class LicensesDenied {
568         LicensesDenied() { }
569 
570         public void addConfiguredFileset(FileSet fileSet) {
571             for (Resource resource : fileSet) {
572                 if (resource.isFilesystemOnly()) {
573                     addArg("licenses-denied-file", ((FileResource) resource).getFile().getAbsolutePath());
574                 }
575             }
576         }
577 
578         public void addConfiguredLst(Lst licenseID) {
579             addArg("licenses-denied", licenseID.value);
580         }
581 
582     }
583     /**
584      * A comma separated list of denied License family IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back.
585      */
586     public LicenseFamiliesDenied createLicenseFamiliesDenied() {
587         return new LicenseFamiliesDenied();
588     }
589 
590     public class LicenseFamiliesDenied {
591         LicenseFamiliesDenied() { }
592 
593         public void addConfiguredFileset(FileSet fileSet) {
594             for (Resource resource : fileSet) {
595                 if (resource.isFilesystemOnly()) {
596                     addArg("license-families-denied-file", ((FileResource) resource).getFile().getAbsolutePath());
597                 }
598             }
599         }
600 
601         public void addConfiguredLst(Lst familyID) {
602             addArg("license-families-denied", familyID.value);
603         }
604 
605     }
606     /**
607      * The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number.
608      */
609     public CounterMax createCounterMax() {
610         return new CounterMax();
611     }
612 
613     public class CounterMax {
614         CounterMax() { }
615 
616         public void addConfiguredCntr(Cntr counterPattern) {
617             addArg("counter-max", counterPattern.value);
618         }
619 
620     }
621     /**
622      * The minimum number for the specified counter.
623      */
624     public CounterMin createCounterMin() {
625         return new CounterMin();
626     }
627 
628     public class CounterMin {
629         CounterMin() { }
630 
631         public void addConfiguredCntr(Cntr counterPattern) {
632             addArg("counter-min", counterPattern.value);
633         }
634 
635     }
636     /**
637      * Excludes files matching &lt;Expression&gt;.
638      * @deprecated Deprecated for removal since 0.17: Use &lt;inputExclude&gt; instead.
639      */
640     public Exclude createExclude() {
641         return new Exclude();
642     }
643 
644     public class Exclude {
645         Exclude() { }
646 
647         public void addConfiguredExpr(Expr expression) {
648             addArg("exclude", expression.value);
649         }
650 
651     }
652     /**
653      * Excludes files matching &lt;Expression&gt;.
654      */
655     public InputExclude createInputExclude() {
656         return new InputExclude();
657     }
658 
659     public class InputExclude {
660         InputExclude() { }
661 
662         public void addConfiguredStd(Std standardCollection) {
663             addArg("input-exclude-std", standardCollection.value);
664         }
665 
666         public void addConfiguredExpr(Expr expression) {
667             addArg("input-exclude", expression.value);
668         }
669 
670         public void addConfiguredFileset(FileSet fileSet) {
671             for (Resource resource : fileSet) {
672                 if (resource.isFilesystemOnly()) {
673                     addArg("input-exclude-file", ((FileResource) resource).getFile().getAbsolutePath());
674                 }
675             }
676         }
677 
678     }
679     /**
680      * Includes files matching &lt;Expression&gt;. Will override excluded files.
681      */
682     public InputInclude createInputInclude() {
683         return new InputInclude();
684     }
685 
686     public class InputInclude {
687         InputInclude() { }
688 
689         public void addConfiguredStd(Std standardCollection) {
690             addArg("input-include-std", standardCollection.value);
691         }
692 
693         public void addConfiguredExpr(Expr expression) {
694             addArg("input-include", expression.value);
695         }
696 
697         public void addConfiguredFileset(FileSet fileSet) {
698             for (Resource resource : fileSet) {
699                 if (resource.isFilesystemOnly()) {
700                     addArg("input-include-file", ((FileResource) resource).getFile().getAbsolutePath());
701                 }
702             }
703         }
704 
705     }
706     /**
707      * Includes files matching &lt;Expression&gt;. Will override excluded files.
708      * @deprecated Deprecated for removal since 0.17: Use &lt;inputInclude&gt; instead.
709      */
710     public Include createInclude() {
711         return new Include();
712     }
713 
714     public class Include {
715         Include() { }
716 
717         public void addConfiguredExpr(Expr expression) {
718             addArg("include", expression.value);
719         }
720 
721     }
722     /**
723      * Parse SCM based exclusion files to exclude specified files and directories. This action can apply to any standard collection that implements a file processor.
724      */
725     public InputExcludeParsedScm createInputExcludeParsedScm() {
726         return new InputExcludeParsedScm();
727     }
728 
729     public class InputExcludeParsedScm {
730         InputExcludeParsedScm() { }
731 
732         public void addConfiguredStd(Std standardCollection) {
733             addArg("input-exclude-parsed-scm", standardCollection.value);
734         }
735 
736     }
737 
738     /* TYPE CLASSES */
739 
740     protected static class TxtValue {
741         protected TxtValue() { }
742 
743         public String value;
744 
745         public void addText(String text) {
746             value = text.trim();
747         }
748     }
749 
750     public static class Std extends TxtValue {
751         public Std() { }
752     }
753 
754     public static class Expr extends TxtValue {
755         public Expr() { }
756     }
757 
758     public static class Cntr extends TxtValue {
759         public Cntr() { }
760     }
761 
762     public static class Filename extends TxtValue {
763         public Filename() { }
764     }
765 
766     public static class Lst extends TxtValue {
767         public Lst() { }
768     }
769 }