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.get(key);
201                 if (values == null) {
202                     values = new ArrayList<>();
203                     args.put(key, values);
204                 }
205                 values.addAll(newValues);
206             }
207         }
208     }
209 
210     /**
211      * Add a value to the key in the argument list.
212      * If the key does not exist, adds it.
213      * @param key the key for the map.
214      * @param value the value to set.
215      */
216     protected void addArg(String key, String value) {
217         if (StringUtils.isNotBlank(value)) {
218             if (validateSet(key)) {
219                 List<String> values = args.get(key);
220                 if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {
221                     DefaultLog.getInstance().debug(String.format("Adding [%s] to %s", String.join(", ", Arrays.asList(value)), key));
222                 }
223                 if (values == null) {
224                     values = new ArrayList<>();
225                     args.put(key, values);
226                 }
227                 values.add(value);
228             }
229         }
230     }
231 
232     /**
233      * Remove a key from the argument list.
234      * @param key the key to remove from the map.
235      */
236     protected void removeArg(String key) {
237         args.remove(key);
238     }
239 
240  ///////////////////////// End common Arg manipulation code
241 
242     protected BaseAntTask() {
243         setDeprecationReporter();
244     }
245 
246     /*  GENERATED METHODS */
247 
248     /**
249      * The copyright message to use in the license headers.
250      * @param copyright Copyright message to use in the license headers.
251      * @deprecated Deprecated for removal since 0.17: Use editCopyright attribute instead.
252      */
253     public void setCopyright(String copyright) {
254         setArg("copyright", copyright);
255 
256     }
257 
258     /**
259      * The copyright message to use in the license headers. Usually in the form of &quot;Copyright 2008 Foo&quot;.  Only valid with editLicense attribute
260      * @param editCopyright Copyright message to use in the license headers.
261      */
262     public void setEditCopyright(String editCopyright) {
263         setArg("edit-copyright", editCopyright);
264 
265     }
266 
267     /**
268      * Forces any changes in files to be written directly to the source files so that new files are not created.
269      * @param force The state
270      * @deprecated Deprecated for removal since 0.17: Use editOverwrite attribute instead.
271      */
272     public void setForce(boolean force) {
273         if (force) { setArg("force", null); } else { removeArg("force"); }
274     }
275 
276     /**
277      * 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.
278      * @param editOverwrite The state
279      */
280     public void setEditOverwrite(boolean editOverwrite) {
281         if (editOverwrite) { setArg("edit-overwrite", null); } else { removeArg("edit-overwrite"); }
282     }
283 
284     /**
285      * Add the default license header to any file with an unknown license that is not in the exclusion list.
286      * @param addLicense The state
287      * @deprecated Deprecated for removal since 0.17: Use editLicense attribute instead.
288      */
289     public void setAddLicense(boolean addLicense) {
290         if (addLicense) { setArg("addLicense", null); } else { removeArg("addLicense"); }
291     }
292 
293     /**
294      * Add the default 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.
295      * @param editLicense The state
296      */
297     public void setEditLicense(boolean editLicense) {
298         if (editLicense) { setArg("edit-license", null); } else { removeArg("edit-license"); }
299     }
300 
301     /**
302      * Ignore default configuration.
303      * @param configurationNoDefaults The state
304      */
305     public void setConfigurationNoDefaults(boolean configurationNoDefaults) {
306         if (configurationNoDefaults) { setArg("configuration-no-defaults", null); } else { removeArg("configuration-no-defaults"); }
307     }
308 
309     /**
310      * Ignore default configuration.
311      * @param noDefaultLicenses The state
312      * @deprecated Deprecated for removal since 0.17: Use configurationNoDefaults attribute instead.
313      */
314     public void setNoDefaultLicenses(boolean noDefaultLicenses) {
315         if (noDefaultLicenses) { setArg("no-default-licenses", null); } else { removeArg("no-default-licenses"); }
316     }
317 
318     /**
319      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
320      * @param excludeFile &lt;Expression&gt; entries from a file.
321      * @deprecated Deprecated for removal since 0.17: Use inputExcludeFile attribute instead.
322      */
323     public void setExcludeFile(String excludeFile) {
324         setArg("exclude-file", excludeFile);
325 
326     }
327 
328     /**
329      * Excludes files with sizes less than the given argument. Argument should be a Integer. (See Argument Types for clarification)
330      * @param inputExcludeSize Files with sizes less than the given argument.
331      */
332     public void setInputExcludeSize(String inputExcludeSize) {
333         setArg("input-exclude-size", inputExcludeSize);
334 
335     }
336 
337     /**
338      * Reads &lt;Expression&gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
339      * @param includesFile &lt;Expression&gt; entries from a file.
340      * @deprecated Deprecated for removal since 0.17: Use inputIncludeFile attribute instead.
341      */
342     public void setIncludesFile(String includesFile) {
343         setArg("includes-file", includesFile);
344 
345     }
346 
347     /**
348      * Scans hidden directories.
349      * @param scanHiddenDirectories The state
350      * @deprecated Deprecated for removal since 0.17: Use &lt;inputIncludeStd&gt; with 'HIDDEN_DIR' argument instead.
351      */
352     public void setScanHiddenDirectories(boolean scanHiddenDirectories) {
353         if (scanHiddenDirectories) { setArg("scan-hidden-directories", null); } else { removeArg("scan-hidden-directories"); }
354     }
355 
356     /**
357      * 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)
358      * @param outputStyle Stylesheet to use when creating the report.
359      */
360     public void setOutputStyle(String outputStyle) {
361         setArg("output-style", outputStyle);
362 
363     }
364 
365     /**
366      * XSLT stylesheet to use when creating the report. Argument should be a StyleSheet. (See Argument Types for clarification)
367      * @param stylesheet Stylesheet to use when creating the report.
368      * @deprecated Deprecated for removal since 0.17: Use outputStyle attribute instead.
369      */
370     public void setStylesheet(String stylesheet) {
371         setArg("stylesheet", stylesheet);
372 
373     }
374 
375     /**
376      * forces XML output rather than the textual report.
377      * @param xml The state
378      * @deprecated Deprecated for removal since 0.17: Use outputStyle attribute with the 'xml' argument instead.
379      */
380     public void setXml(boolean xml) {
381         if (xml) { setArg("xml", null); } else { removeArg("xml"); }
382     }
383 
384     /**
385      * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
386      * @param outputLicenses The defined licenses.
387      */
388     public void setOutputLicenses(String outputLicenses) {
389         setArg("output-licenses", outputLicenses);
390 
391     }
392 
393     /**
394      * List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
395      * @param listLicenses The defined licenses.
396      * @deprecated Deprecated for removal since 0.17: Use outputLicenses attribute instead.
397      */
398     public void setListLicenses(String listLicenses) {
399         setArg("list-licenses", listLicenses);
400 
401     }
402 
403     /**
404      * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
405      * @param outputFamilies The defined license families.
406      */
407     public void setOutputFamilies(String outputFamilies) {
408         setArg("output-families", outputFamilies);
409 
410     }
411 
412     /**
413      * List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
414      * @param listFamilies The defined license families.
415      * @deprecated Deprecated for removal since 0.17: Use outputFamilies attribute instead.
416      */
417     public void setListFamilies(String listFamilies) {
418         setArg("list-families", listFamilies);
419 
420     }
421 
422     /**
423      * If set do not update the files but generate the reports.
424      * @param dryRun The state
425      */
426     public void setDryRun(boolean dryRun) {
427         if (dryRun) { setArg("dry-run", null); } else { removeArg("dry-run"); }
428     }
429 
430     /**
431      * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
432      * @param out The output file where to write a report to.
433      * @deprecated Deprecated for removal since 0.17: Use outputFile attribute instead.
434      */
435     public void setOut(String out) {
436         setArg("out", out);
437 
438     }
439 
440     /**
441      * Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
442      * @param outputFile The output file where to write a report to.
443      */
444     public void setOutputFile(String outputFile) {
445         setArg("output-file", outputFile);
446 
447     }
448 
449     /**
450      * Specifies the level of detail in ARCHIVE file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
451      * @param outputArchive The level of detail in ARCHIVE file reporting.
452      */
453     public void setOutputArchive(String outputArchive) {
454         setArg("output-archive", outputArchive);
455 
456     }
457 
458     /**
459      * Specifies the level of detail in STANDARD file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
460      * @param outputStandard The level of detail in STANDARD file reporting.
461      */
462     public void setOutputStandard(String outputStandard) {
463         setArg("output-standard", outputStandard);
464 
465     }
466 
467     /**
468      * Print information about registered licenses.
469      * @param helpLicenses The state
470      */
471     public void setHelpLicenses(boolean helpLicenses) {
472         if (helpLicenses) { setArg("help-licenses", null); } else { removeArg("help-licenses"); }
473     }
474 
475 
476 
477     /*  GENERATED CLASSES */
478 
479     /**
480      * File names for system configuration.
481      */
482     public Config createConfig() {
483         return new Config();
484     }
485 
486     public class Config {
487         Config() { }
488 
489         public void addConfiguredFileset(FileSet fileSet) {
490             for (Resource resource : fileSet) {
491                 if (resource.isFilesystemOnly()) {
492                     addArg("config", ((FileResource) resource).getFile().getAbsolutePath());
493                 }
494             }
495         }
496 
497     }
498     /**
499      * File names for system configuration.
500      * @deprecated Deprecated for removal since 0.17: Use &lt;config&gt; instead.
501      */
502     public Licenses createLicenses() {
503         return new Licenses();
504     }
505 
506     public class Licenses {
507         Licenses() { }
508 
509         public void addConfiguredFileset(FileSet fileSet) {
510             for (Resource resource : fileSet) {
511                 if (resource.isFilesystemOnly()) {
512                     addArg("licenses", ((FileResource) resource).getFile().getAbsolutePath());
513                 }
514             }
515         }
516 
517     }
518     /**
519      * A comma separated list of approved License IDs. These licenses will be added to the list of approved licenses.
520      */
521     public LicensesApproved createLicensesApproved() {
522         return new LicensesApproved();
523     }
524 
525     public class LicensesApproved {
526         LicensesApproved() { }
527 
528         public void addConfiguredFileset(FileSet fileSet) {
529             for (Resource resource : fileSet) {
530                 if (resource.isFilesystemOnly()) {
531                     addArg("licenses-approved-file", ((FileResource) resource).getFile().getAbsolutePath());
532                 }
533             }
534         }
535 
536         public void addConfiguredLst(Lst licenseID) {
537             addArg("licenses-approved", licenseID.value);
538         }
539 
540     }
541     /**
542      * A comma separated list of approved license family IDs. These license families will be added to the list of approved license families.
543      */
544     public LicenseFamiliesApproved createLicenseFamiliesApproved() {
545         return new LicenseFamiliesApproved();
546     }
547 
548     public class LicenseFamiliesApproved {
549         LicenseFamiliesApproved() { }
550 
551         public void addConfiguredFileset(FileSet fileSet) {
552             for (Resource resource : fileSet) {
553                 if (resource.isFilesystemOnly()) {
554                     addArg("license-families-approved-file", ((FileResource) resource).getFile().getAbsolutePath());
555                 }
556             }
557         }
558 
559         public void addConfiguredLst(Lst familyID) {
560             addArg("license-families-approved", familyID.value);
561         }
562 
563     }
564     /**
565      * 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.
566      */
567     public LicensesDenied createLicensesDenied() {
568         return new LicensesDenied();
569     }
570 
571     public class LicensesDenied {
572         LicensesDenied() { }
573 
574         public void addConfiguredFileset(FileSet fileSet) {
575             for (Resource resource : fileSet) {
576                 if (resource.isFilesystemOnly()) {
577                     addArg("licenses-denied-file", ((FileResource) resource).getFile().getAbsolutePath());
578                 }
579             }
580         }
581 
582         public void addConfiguredLst(Lst licenseID) {
583             addArg("licenses-denied", licenseID.value);
584         }
585 
586     }
587     /**
588      * 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.
589      */
590     public LicenseFamiliesDenied createLicenseFamiliesDenied() {
591         return new LicenseFamiliesDenied();
592     }
593 
594     public class LicenseFamiliesDenied {
595         LicenseFamiliesDenied() { }
596 
597         public void addConfiguredFileset(FileSet fileSet) {
598             for (Resource resource : fileSet) {
599                 if (resource.isFilesystemOnly()) {
600                     addArg("license-families-denied-file", ((FileResource) resource).getFile().getAbsolutePath());
601                 }
602             }
603         }
604 
605         public void addConfiguredLst(Lst familyID) {
606             addArg("license-families-denied", familyID.value);
607         }
608 
609     }
610     /**
611      * The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number.
612      */
613     public CounterMax createCounterMax() {
614         return new CounterMax();
615     }
616 
617     public class CounterMax {
618         CounterMax() { }
619 
620         public void addConfiguredCntr(Cntr counterPattern) {
621             addArg("counter-max", counterPattern.value);
622         }
623 
624     }
625     /**
626      * The minimum number for the specified counter.
627      */
628     public CounterMin createCounterMin() {
629         return new CounterMin();
630     }
631 
632     public class CounterMin {
633         CounterMin() { }
634 
635         public void addConfiguredCntr(Cntr counterPattern) {
636             addArg("counter-min", counterPattern.value);
637         }
638 
639     }
640     /**
641      * Excludes files matching &lt;Expression&gt;.
642      * @deprecated Deprecated for removal since 0.17: Use &lt;inputExclude&gt; instead.
643      */
644     public Exclude createExclude() {
645         return new Exclude();
646     }
647 
648     public class Exclude {
649         Exclude() { }
650 
651         public void addConfiguredExpr(Expr expression) {
652             addArg("exclude", expression.value);
653         }
654 
655     }
656     /**
657      * Excludes files matching &lt;Expression&gt;.
658      */
659     public InputExclude createInputExclude() {
660         return new InputExclude();
661     }
662 
663     public class InputExclude {
664         InputExclude() { }
665 
666         public void addConfiguredFileset(FileSet fileSet) {
667             for (Resource resource : fileSet) {
668                 if (resource.isFilesystemOnly()) {
669                     addArg("input-exclude-file", ((FileResource) resource).getFile().getAbsolutePath());
670                 }
671             }
672         }
673 
674         public void addConfiguredStd(Std standardCollection) {
675             addArg("input-exclude-std", standardCollection.value);
676         }
677 
678         public void addConfiguredExpr(Expr expression) {
679             addArg("input-exclude", expression.value);
680         }
681 
682     }
683     /**
684      * Includes files matching &lt;Expression&gt;. Will override excluded files.
685      */
686     public InputInclude createInputInclude() {
687         return new InputInclude();
688     }
689 
690     public class InputInclude {
691         InputInclude() { }
692 
693         public void addConfiguredFileset(FileSet fileSet) {
694             for (Resource resource : fileSet) {
695                 if (resource.isFilesystemOnly()) {
696                     addArg("input-include-file", ((FileResource) resource).getFile().getAbsolutePath());
697                 }
698             }
699         }
700 
701         public void addConfiguredStd(Std standardCollection) {
702             addArg("input-include-std", standardCollection.value);
703         }
704 
705         public void addConfiguredExpr(Expr expression) {
706             addArg("input-include", expression.value);
707         }
708 
709     }
710     /**
711      * Includes files matching &lt;Expression&gt;. Will override excluded files.
712      * @deprecated Deprecated for removal since 0.17: Use &lt;inputInclude&gt; instead.
713      */
714     public Include createInclude() {
715         return new Include();
716     }
717 
718     public class Include {
719         Include() { }
720 
721         public void addConfiguredExpr(Expr expression) {
722             addArg("include", expression.value);
723         }
724 
725     }
726     /**
727      * Parse SCM based exclusion files to exclude specified files and directories.
728      */
729     public InputExcludeParsedScm createInputExcludeParsedScm() {
730         return new InputExcludeParsedScm();
731     }
732 
733     public class InputExcludeParsedScm {
734         InputExcludeParsedScm() { }
735 
736         public void addConfiguredStd(Std standardCollection) {
737             addArg("input-exclude-parsed-scm", standardCollection.value);
738         }
739 
740     }
741 
742     /* TYPE CLASSES */
743 
744     protected static class TxtValue {
745         protected TxtValue() { }
746 
747         public String value;
748 
749         public void addText(String text) {
750             value = text.trim();
751         }
752     }
753 
754     public static class Std extends TxtValue {
755         public Std() { }
756     }
757 
758     public static class Expr extends TxtValue {
759         public Expr() { }
760     }
761 
762     public static class Cntr extends TxtValue {
763         public Cntr() { }
764     }
765 
766     public static class Filename extends TxtValue {
767         public Filename() { }
768     }
769 
770     public static class Lst extends TxtValue {
771         public Lst() { }
772     }
773 }