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