blob: 9e68a461d8f4e5f5ea6cfa597a9e381ff862a240 [file]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang=""><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>BaseAntTask.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Creadur RAT::Tasks4Ant</a> &gt; <a href="index.source.html" class="el_package">org.apache.rat.anttasks</a> &gt; <span class="el_source">BaseAntTask.java</span></div><h1>BaseAntTask.java</h1><pre class="source lang-java linenums">/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* &quot;License&quot;); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.rat.anttasks;
import org.apache.commons.cli.Option;
import org.apache.commons.lang3.StringUtils;
import org.apache.rat.commandline.Arg;
import org.apache.rat.DeprecationReporter;
import org.apache.rat.utils.CasedString;
import org.apache.rat.utils.DefaultLog;
import org.apache.rat.utils.Log;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.types.resources.FileResource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* Generated class to provide Ant support for standard RAT command line options.
* DO NOT EDIT - GENERATED FILE
*/
public abstract class BaseAntTask extends Task {
<span class="fc" id="L49"> private static final Map&lt;String, String&gt; xlateName = new HashMap&lt;&gt;();</span>
<span class="fc" id="L51"> private static final List&lt;String&gt; unsupportedArgs = new ArrayList&lt;&gt;();</span>
<span class="fc" id="L53"> private static final Map&lt;String, String&gt; deprecatedArgs = new HashMap&lt;&gt;();</span>
static {
<span class="fc" id="L56"> xlateName.put(&quot;addLicense&quot;, &quot;add-license&quot;);</span>
<span class="fc" id="L57"> unsupportedArgs.add(&quot;a&quot;);</span>
<span class="fc" id="L58"> unsupportedArgs.add(&quot;input-include-file&quot;);</span>
<span class="fc" id="L59"> unsupportedArgs.add(&quot;input-source&quot;);</span>
<span class="fc" id="L60"> unsupportedArgs.add(&quot;input-exclude-file&quot;);</span>
<span class="fc" id="L61"> unsupportedArgs.add(&quot;log-level&quot;);</span>
<span class="fc" id="L62"> unsupportedArgs.add(&quot;license-families-approved-file&quot;);</span>
<span class="fc" id="L63"> unsupportedArgs.add(&quot;input-exclude-std&quot;);</span>
<span class="fc" id="L64"> unsupportedArgs.add(&quot;help&quot;);</span>
<span class="fc" id="L65"> unsupportedArgs.add(&quot;dir&quot;);</span>
<span class="fc" id="L66"> unsupportedArgs.add(&quot;license-families-denied-file&quot;);</span>
<span class="fc" id="L67"> unsupportedArgs.add(&quot;licenses-denied-file&quot;);</span>
<span class="fc" id="L68"> unsupportedArgs.add(&quot;licenses-approved-file&quot;);</span>
<span class="fc" id="L69"> unsupportedArgs.add(&quot;input-include-std&quot;);</span>
<span class="fc" id="L70"> deprecatedArgs.put(&quot;copyright&quot;, &quot;Use of deprecated option 'copyright'. Deprecated for removal since 0.17: Use editCopyright attribute instead.&quot;);</span>
<span class="fc" id="L71"> deprecatedArgs.put(&quot;force&quot;, &quot;Use of deprecated option 'force'. Deprecated for removal since 0.17: Use editOverwrite attribute instead.&quot;);</span>
<span class="fc" id="L72"> deprecatedArgs.put(&quot;addLicense&quot;, &quot;Use of deprecated option 'addLicense'. Deprecated for removal since 0.17: Use editLicense attribute instead.&quot;);</span>
<span class="fc" id="L73"> deprecatedArgs.put(&quot;licenses&quot;, &quot;Use of deprecated option 'licenses'. Deprecated for removal since 0.17: Use &lt;config&gt; instead.&quot;);</span>
<span class="fc" id="L74"> deprecatedArgs.put(&quot;no-default-licenses&quot;, &quot;Use of deprecated option 'noDefaultLicenses'. Deprecated for removal since 0.17: Use configurationNoDefaults attribute instead.&quot;);</span>
<span class="fc" id="L75"> deprecatedArgs.put(&quot;exclude&quot;, &quot;Use of deprecated option 'exclude'. Deprecated for removal since 0.17: Use &lt;inputExclude&gt; instead.&quot;);</span>
<span class="fc" id="L76"> deprecatedArgs.put(&quot;exclude-file&quot;, &quot;Use of deprecated option 'excludeFile'. Deprecated for removal since 0.17: Use inputExcludeFile attribute instead.&quot;);</span>
<span class="fc" id="L77"> deprecatedArgs.put(&quot;include&quot;, &quot;Use of deprecated option 'include'. Deprecated for removal since 0.17: Use &lt;inputInclude&gt; instead.&quot;);</span>
<span class="fc" id="L78"> deprecatedArgs.put(&quot;includes-file&quot;, &quot;Use of deprecated option 'includesFile'. Deprecated for removal since 0.17: Use inputIncludeFile attribute instead.&quot;);</span>
<span class="fc" id="L79"> deprecatedArgs.put(&quot;scan-hidden-directories&quot;, &quot;Use of deprecated option 'scanHiddenDirectories'. Deprecated for removal since 0.17: Use &lt;inputIncludeStd&gt; with 'HIDDEN_DIR' argument instead.&quot;);</span>
<span class="fc" id="L80"> deprecatedArgs.put(&quot;stylesheet&quot;, &quot;Use of deprecated option 'stylesheet'. Deprecated for removal since 0.17: Use outputStyle attribute instead.&quot;);</span>
<span class="fc" id="L81"> deprecatedArgs.put(&quot;xml&quot;, &quot;Use of deprecated option 'xml'. Deprecated for removal since 0.17: Use outputStyle attribute with the 'xml' argument instead.&quot;);</span>
<span class="fc" id="L82"> deprecatedArgs.put(&quot;list-licenses&quot;, &quot;Use of deprecated option 'listLicenses'. Deprecated for removal since 0.17: Use outputLicenses attribute instead.&quot;);</span>
<span class="fc" id="L83"> deprecatedArgs.put(&quot;list-families&quot;, &quot;Use of deprecated option 'listFamilies'. Deprecated for removal since 0.17: Use outputFamilies attribute instead.&quot;);</span>
<span class="fc" id="L84"> deprecatedArgs.put(&quot;out&quot;, &quot;Use of deprecated option 'out'. Deprecated for removal since 0.17: Use outputFile attribute instead.&quot;);</span>
<span class="fc" id="L85"> }</span>
public static String createName(String longOpt) {
<span class="nc" id="L88"> String name = StringUtils.defaultIfEmpty(xlateName.get(longOpt), longOpt).toLowerCase(Locale.ROOT);</span>
<span class="nc" id="L89"> return new CasedString(CasedString.StringCase.KEBAB, name).toCase(CasedString.StringCase.CAMEL);</span>
}
public static List&lt;String&gt; unsupportedArgs() {
<span class="fc" id="L93"> return Collections.unmodifiableList(unsupportedArgs);</span>
}
///////////////////////// Start common Arg manipulation code
/**
* Sets the deprecation report method.
*/
private static void setDeprecationReporter() {
<span class="fc" id="L102"> DeprecationReporter.setLogReporter(opt -&gt; {</span>
<span class="fc" id="L103"> String msg = deprecatedArgs.get(argsKey(opt));</span>
<span class="pc bpc" id="L104" title="1 of 2 branches missed."> if (msg == null) {</span>
<span class="nc" id="L105"> DeprecationReporter.getDefault().accept(opt);</span>
} else {
<span class="fc" id="L107"> DefaultLog.getInstance().warn(msg);</span>
}
<span class="fc" id="L109"> });</span>
<span class="fc" id="L110"> }</span>
private static String argsKey(Option opt) {
<span class="fc" id="L113"> return StringUtils.defaultIfEmpty(opt.getLongOpt(), opt.getKey());</span>
}
/**
* A map of CLI-based arguments to values.
*/
<span class="fc" id="L119"> protected final Map&lt;String, List&lt;String&gt;&gt; args = new HashMap&lt;&gt;();</span>
/**
* Gets the list of arguments prepared for the CLI code to parse.
* @return the List of arguments for the CLI command line.
*/
protected List&lt;String&gt; args() {
<span class="fc" id="L126"> List&lt;String&gt; result = new ArrayList&lt;&gt;();</span>
<span class="fc bfc" id="L127" title="All 2 branches covered."> for (Map.Entry&lt;String, List&lt;String&gt;&gt; entry : args.entrySet()) {</span>
<span class="fc" id="L128"> result.add(&quot;--&quot; + entry.getKey());</span>
<span class="fc" id="L129"> result.addAll(entry.getValue().stream().filter(Objects::nonNull).toList());</span>
<span class="fc" id="L130"> }</span>
<span class="fc" id="L131"> return result;</span>
}
private boolean validateSet(String key) {
<span class="fc" id="L135"> Arg arg = Arg.findArg(key);</span>
<span class="pc bpc" id="L136" title="1 of 2 branches missed."> if (arg != null) {</span>
<span class="fc" id="L137"> Option opt = arg.find(key);</span>
<span class="fc" id="L138"> Option main = arg.option();</span>
<span class="fc bfc" id="L139" title="All 2 branches covered."> if (opt.isDeprecated()) {</span>
<span class="fc" id="L140"> args.remove(argsKey(main));</span>
// deprecated options must be explicitly set so let it go.
<span class="fc" id="L142"> return true;</span>
}
// non-deprecated options may have default so ignore it if another option has already been set.
<span class="fc bfc" id="L145" title="All 2 branches covered."> for (Option o : arg.group().getOptions()) {</span>
<span class="fc bfc" id="L146" title="All 2 branches covered."> if (!o.equals(main)) {</span>
<span class="pc bpc" id="L147" title="1 of 2 branches missed."> if (args.containsKey(argsKey(o))) {</span>
<span class="nc" id="L148"> return false;</span>
}
}
<span class="fc" id="L151"> }</span>
<span class="fc" id="L152"> return true;</span>
}
<span class="nc" id="L154"> return false;</span>
}
/**
* Set a key and value into the argument list.
* Replaces any existing value.
* @param key the key for the map.
* @param value the value to set.
*/
protected void setArg(String key, String value) {
<span class="pc bpc" id="L164" title="1 of 4 branches missed."> if (value == null || StringUtils.isNotBlank(value)) {</span>
<span class="pc bpc" id="L165" title="1 of 2 branches missed."> if (validateSet(key)) {</span>
<span class="fc" id="L166"> List&lt;String&gt; values = new ArrayList&lt;&gt;();</span>
<span class="pc bpc" id="L167" title="1 of 2 branches missed."> if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {</span>
<span class="fc" id="L168"> DefaultLog.getInstance().debug(String.format(&quot;Setting %s to '%s'&quot;, key, value));</span>
}
<span class="fc" id="L170"> values.add(value);</span>
<span class="fc" id="L171"> args.put(key, values);</span>
}
}
<span class="fc" id="L174"> }</span>
/**
* Get the list of values for a key.
* @param key the key for the map.
* @return the list of values for the key or {@code null} if not set.
*/
public List&lt;String&gt; getArg(String key) {
<span class="fc" id="L182"> return args.get(key);</span>
}
/**
* Add values to the key in the argument list.
* empty values are ignored. If no non-empty values are present no change is made.
* If the key does not exist, adds it.
* @param key the key for the map.
* @param value the array of values to set.
*/
protected void addArg(String key, String[] value) {
<span class="nc" id="L193"> List&lt;String&gt; newValues = Arrays.stream(value).filter(StringUtils::isNotBlank).toList();</span>
<span class="nc bnc" id="L194" title="All 2 branches missed."> if (!newValues.isEmpty()) {</span>
<span class="nc bnc" id="L195" title="All 2 branches missed."> if (validateSet(key)) {</span>
<span class="nc bnc" id="L196" title="All 2 branches missed."> if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {</span>
<span class="nc" id="L197"> DefaultLog.getInstance().debug(String.format(&quot;Adding [%s] to %s&quot;, String.join(&quot;, &quot;, Arrays.asList(value)), key));</span>
}
<span class="nc" id="L199"> List&lt;String&gt; values = args.computeIfAbsent(key, k -&gt; new ArrayList&lt;&gt;());</span>
<span class="nc" id="L200"> values.addAll(newValues);</span>
}
}
<span class="nc" id="L203"> }</span>
/**
* Add a value to the key in the argument list.
* If the key does not exist, adds it.
* @param key the key for the map.
* @param value the value to set.
*/
protected void addArg(String key, String value) {
<span class="pc bpc" id="L212" title="1 of 2 branches missed."> if (StringUtils.isNotBlank(value)) {</span>
<span class="pc bpc" id="L213" title="1 of 2 branches missed."> if (validateSet(key)) {</span>
<span class="fc" id="L214"> List&lt;String&gt; values = args.get(key);</span>
<span class="pc bpc" id="L215" title="1 of 2 branches missed."> if (DefaultLog.getInstance().isEnabled(Log.Level.DEBUG)) {</span>
<span class="fc" id="L216"> DefaultLog.getInstance().debug(String.format(&quot;Adding [%s] to %s&quot;, String.join(&quot;, &quot;, Arrays.asList(value)), key));</span>
}
<span class="fc bfc" id="L218" title="All 2 branches covered."> if (values == null) {</span>
<span class="fc" id="L219"> values = new ArrayList&lt;&gt;();</span>
<span class="fc" id="L220"> args.put(key, values);</span>
}
<span class="fc" id="L222"> values.add(value);</span>
}
}
<span class="fc" id="L225"> }</span>
/**
* Remove a key from the argument list.
* @param key the key to remove from the map.
*/
protected void removeArg(String key) {
<span class="fc" id="L232"> args.remove(key);</span>
<span class="fc" id="L233"> }</span>
///////////////////////// End common Arg manipulation code
<span class="fc" id="L237">protected BaseAntTask() {</span>
<span class="fc" id="L238"> setDeprecationReporter();</span>
<span class="fc" id="L239">}</span>
/* GENERATED METHODS */
/**
* The copyright message to use in the license headers.
* @param copyright Copyright message to use in the license headers.
* @deprecated Deprecated for removal since 0.17: Use editCopyright attribute instead.
*/
public void setCopyright(String copyright) {
<span class="fc" id="L249"> setArg(&quot;copyright&quot;, copyright);</span>
<span class="fc" id="L251"> }</span>
/**
* The copyright message to use in the license headers. Usually in the form of &amp;quot;Copyright 2008 Foo&amp;quot;. Only valid with editLicense attribute
* @param editCopyright Copyright message to use in the license headers.
*/
public void setEditCopyright(String editCopyright) {
<span class="fc" id="L258"> setArg(&quot;edit-copyright&quot;, editCopyright);</span>
<span class="fc" id="L260"> }</span>
/**
* Forces any changes in files to be written directly to the source files so that new files are not created.
* @param force The state
* @deprecated Deprecated for removal since 0.17: Use editOverwrite attribute instead.
*/
public void setForce(boolean force) {
<span class="pc bpc" id="L268" title="1 of 2 branches missed."> if (force) { setArg(&quot;force&quot;, null); } else { removeArg(&quot;force&quot;); }</span>
<span class="fc" id="L269"> }</span>
/**
* 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.
* @param editOverwrite The state
*/
public void setEditOverwrite(boolean editOverwrite) {
<span class="pc bpc" id="L276" title="1 of 2 branches missed."> if (editOverwrite) { setArg(&quot;edit-overwrite&quot;, null); } else { removeArg(&quot;edit-overwrite&quot;); }</span>
<span class="fc" id="L277"> }</span>
/**
* Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list.
* @param addLicense The state
* @deprecated Deprecated for removal since 0.17: Use editLicense attribute instead.
*/
public void setAddLicense(boolean addLicense) {
<span class="pc bpc" id="L285" title="1 of 2 branches missed."> if (addLicense) { setArg(&quot;addLicense&quot;, null); } else { removeArg(&quot;addLicense&quot;); }</span>
<span class="fc" id="L286"> }</span>
/**
* 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.
* @param editLicense The state
*/
public void setEditLicense(boolean editLicense) {
<span class="pc bpc" id="L293" title="1 of 2 branches missed."> if (editLicense) { setArg(&quot;edit-license&quot;, null); } else { removeArg(&quot;edit-license&quot;); }</span>
<span class="fc" id="L294"> }</span>
/**
* Ignore default configuration.
* @param configurationNoDefaults The state
*/
public void setConfigurationNoDefaults(boolean configurationNoDefaults) {
<span class="pc bpc" id="L301" title="1 of 2 branches missed."> if (configurationNoDefaults) { setArg(&quot;configuration-no-defaults&quot;, null); } else { removeArg(&quot;configuration-no-defaults&quot;); }</span>
<span class="fc" id="L302"> }</span>
/**
* Ignore default configuration.
* @param noDefaultLicenses The state
* @deprecated Deprecated for removal since 0.17: Use configurationNoDefaults attribute instead.
*/
public void setNoDefaultLicenses(boolean noDefaultLicenses) {
<span class="pc bpc" id="L310" title="1 of 2 branches missed."> if (noDefaultLicenses) { setArg(&quot;no-default-licenses&quot;, null); } else { removeArg(&quot;no-default-licenses&quot;); }</span>
<span class="fc" id="L311"> }</span>
/**
* Reads &amp;lt;Expression&amp;gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
* @param excludeFile &amp;lt;Expression&amp;gt; entries from a file.
* @deprecated Deprecated for removal since 0.17: Use inputExcludeFile attribute instead.
*/
public void setExcludeFile(String excludeFile) {
<span class="fc" id="L319"> setArg(&quot;exclude-file&quot;, excludeFile);</span>
<span class="fc" id="L321"> }</span>
/**
* Excludes files with sizes less than the number of bytes specified. Argument should be a Integer. (See Argument Types for clarification)
* @param inputExcludeSize Files with sizes less than the number of bytes specified.
*/
public void setInputExcludeSize(String inputExcludeSize) {
<span class="fc" id="L328"> setArg(&quot;input-exclude-size&quot;, inputExcludeSize);</span>
<span class="fc" id="L330"> }</span>
/**
* Reads &amp;lt;Expression&amp;gt; entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)
* @param includesFile &amp;lt;Expression&amp;gt; entries from a file.
* @deprecated Deprecated for removal since 0.17: Use inputIncludeFile attribute instead.
*/
public void setIncludesFile(String includesFile) {
<span class="fc" id="L338"> setArg(&quot;includes-file&quot;, includesFile);</span>
<span class="fc" id="L340"> }</span>
/**
* Scans hidden directories.
* @param scanHiddenDirectories The state
* @deprecated Deprecated for removal since 0.17: Use &amp;lt;inputIncludeStd&amp;gt; with 'HIDDEN_DIR' argument instead.
*/
public void setScanHiddenDirectories(boolean scanHiddenDirectories) {
<span class="pc bpc" id="L348" title="1 of 2 branches missed."> if (scanHiddenDirectories) { setArg(&quot;scan-hidden-directories&quot;, null); } else { removeArg(&quot;scan-hidden-directories&quot;); }</span>
<span class="fc" id="L349"> }</span>
/**
* 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)
* @param outputStyle Stylesheet to use when creating the report.
*/
public void setOutputStyle(String outputStyle) {
<span class="fc" id="L356"> setArg(&quot;output-style&quot;, outputStyle);</span>
<span class="fc" id="L358"> }</span>
/**
* XSLT stylesheet to use when creating the report. Argument should be a StyleSheet. (See Argument Types for clarification)
* @param stylesheet Stylesheet to use when creating the report.
* @deprecated Deprecated for removal since 0.17: Use outputStyle attribute instead.
*/
public void setStylesheet(String stylesheet) {
<span class="fc" id="L366"> setArg(&quot;stylesheet&quot;, stylesheet);</span>
<span class="fc" id="L368"> }</span>
/**
* forces XML output rather than the textual report.
* @param xml The state
* @deprecated Deprecated for removal since 0.17: Use outputStyle attribute with the 'xml' argument instead.
*/
public void setXml(boolean xml) {
<span class="pc bpc" id="L376" title="1 of 2 branches missed."> if (xml) { setArg(&quot;xml&quot;, null); } else { removeArg(&quot;xml&quot;); }</span>
<span class="fc" id="L377"> }</span>
/**
* List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
* @param outputLicenses The defined licenses.
*/
public void setOutputLicenses(String outputLicenses) {
<span class="fc" id="L384"> setArg(&quot;output-licenses&quot;, outputLicenses);</span>
<span class="fc" id="L386"> }</span>
/**
* List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)
* @param listLicenses The defined licenses.
* @deprecated Deprecated for removal since 0.17: Use outputLicenses attribute instead.
*/
public void setListLicenses(String listLicenses) {
<span class="fc" id="L394"> setArg(&quot;list-licenses&quot;, listLicenses);</span>
<span class="fc" id="L396"> }</span>
/**
* List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
* @param outputFamilies The defined license families.
*/
public void setOutputFamilies(String outputFamilies) {
<span class="fc" id="L403"> setArg(&quot;output-families&quot;, outputFamilies);</span>
<span class="fc" id="L405"> }</span>
/**
* List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)
* @param listFamilies The defined license families.
* @deprecated Deprecated for removal since 0.17: Use outputFamilies attribute instead.
*/
public void setListFamilies(String listFamilies) {
<span class="fc" id="L413"> setArg(&quot;list-families&quot;, listFamilies);</span>
<span class="fc" id="L415"> }</span>
/**
* If set do not update the files but generate the reports.
* @param dryRun The state
*/
public void setDryRun(boolean dryRun) {
<span class="pc bpc" id="L422" title="1 of 2 branches missed."> if (dryRun) { setArg(&quot;dry-run&quot;, null); } else { removeArg(&quot;dry-run&quot;); }</span>
<span class="fc" id="L423"> }</span>
/**
* Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
* @param out The output file where to write a report to.
* @deprecated Deprecated for removal since 0.17: Use outputFile attribute instead.
*/
public void setOut(String out) {
<span class="fc" id="L431"> setArg(&quot;out&quot;, out);</span>
<span class="fc" id="L433"> }</span>
/**
* Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)
* @param outputFile The output file where to write a report to.
*/
public void setOutputFile(String outputFile) {
<span class="fc" id="L440"> setArg(&quot;output-file&quot;, outputFile);</span>
<span class="fc" id="L442"> }</span>
/**
* Specifies the level of detail in ARCHIVE file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
* @param outputArchive The level of detail in ARCHIVE file reporting.
*/
public void setOutputArchive(String outputArchive) {
<span class="fc" id="L449"> setArg(&quot;output-archive&quot;, outputArchive);</span>
<span class="fc" id="L451"> }</span>
/**
* Specifies the level of detail in STANDARD file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)
* @param outputStandard The level of detail in STANDARD file reporting.
*/
public void setOutputStandard(String outputStandard) {
<span class="fc" id="L458"> setArg(&quot;output-standard&quot;, outputStandard);</span>
<span class="fc" id="L460"> }</span>
/**
* Print information about registered licenses.
* @param helpLicenses The state
*/
public void setHelpLicenses(boolean helpLicenses) {
<span class="pc bpc" id="L467" title="1 of 2 branches missed."> if (helpLicenses) { setArg(&quot;help-licenses&quot;, null); } else { removeArg(&quot;help-licenses&quot;); }</span>
<span class="fc" id="L468"> }</span>
/* GENERATED CLASSES */
/**
* File names for system configuration.
*/
public Config createConfig() {
<span class="fc" id="L478"> return new Config();</span>
}
public class Config {
<span class="fc" id="L482"> Config() { }</span>
public void addConfiguredFileset(FileSet fileSet) {
<span class="fc bfc" id="L484" title="All 2 branches covered."> for (Resource resource : fileSet) {</span>
<span class="pc bpc" id="L485" title="1 of 2 branches missed."> if (resource.isFilesystemOnly()) {</span>
<span class="fc" id="L486"> addArg(&quot;config&quot;, ((FileResource) resource).getFile().getAbsolutePath());</span>
}
<span class="fc" id="L488"> }</span>
<span class="fc" id="L489"> }</span>
}
/**
* File names for system configuration.
* @deprecated Deprecated for removal since 0.17: Use &amp;lt;config&amp;gt; instead.
*/
public Licenses createLicenses() {
<span class="fc" id="L496"> return new Licenses();</span>
}
public class Licenses {
<span class="fc" id="L500"> Licenses() { }</span>
public void addConfiguredFileset(FileSet fileSet) {
<span class="fc bfc" id="L502" title="All 2 branches covered."> for (Resource resource : fileSet) {</span>
<span class="pc bpc" id="L503" title="1 of 2 branches missed."> if (resource.isFilesystemOnly()) {</span>
<span class="fc" id="L504"> addArg(&quot;licenses&quot;, ((FileResource) resource).getFile().getAbsolutePath());</span>
}
<span class="fc" id="L506"> }</span>
<span class="fc" id="L507"> }</span>
}
/**
* A comma separated list of approved License IDs. These licenses will be added to the list of approved licenses.
*/
public LicensesApproved createLicensesApproved() {
<span class="fc" id="L513"> return new LicensesApproved();</span>
}
public class LicensesApproved {
<span class="fc" id="L517"> LicensesApproved() { }</span>
public void addConfiguredFileset(FileSet fileSet) {
<span class="fc bfc" id="L519" title="All 2 branches covered."> for (Resource resource : fileSet) {</span>
<span class="pc bpc" id="L520" title="1 of 2 branches missed."> if (resource.isFilesystemOnly()) {</span>
<span class="fc" id="L521"> addArg(&quot;licenses-approved-file&quot;, ((FileResource) resource).getFile().getAbsolutePath());</span>
}
<span class="fc" id="L523"> }</span>
<span class="fc" id="L524"> }</span>
public void addConfiguredLst(Lst licenseID) {
<span class="fc" id="L526"> addArg(&quot;licenses-approved&quot;, licenseID.value);</span>
<span class="fc" id="L527">}</span>
}
/**
* A comma separated list of approved license family IDs. These license families will be added to the list of approved license families.
*/
public LicenseFamiliesApproved createLicenseFamiliesApproved() {
<span class="fc" id="L533"> return new LicenseFamiliesApproved();</span>
}
public class LicenseFamiliesApproved {
<span class="nc" id="L537"> LicenseFamiliesApproved() { }</span>
public void addConfiguredFileset(FileSet fileSet) {
<span class="nc bnc" id="L539" title="All 2 branches missed."> for (Resource resource : fileSet) {</span>
<span class="nc bnc" id="L540" title="All 2 branches missed."> if (resource.isFilesystemOnly()) {</span>
<span class="nc" id="L541"> addArg(&quot;license-families-approved-file&quot;, ((FileResource) resource).getFile().getAbsolutePath());</span>
}
<span class="nc" id="L543"> }</span>
<span class="nc" id="L544"> }</span>
public void addConfiguredLst(Lst familyID) {
<span class="nc" id="L546"> addArg(&quot;license-families-approved&quot;, familyID.value);</span>
<span class="nc" id="L547">}</span>
}
/**
* 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.
*/
public LicensesDenied createLicensesDenied() {
<span class="fc" id="L553"> return new LicensesDenied();</span>
}
public class LicensesDenied {
<span class="fc" id="L557"> LicensesDenied() { }</span>
public void addConfiguredFileset(FileSet fileSet) {
<span class="fc bfc" id="L559" title="All 2 branches covered."> for (Resource resource : fileSet) {</span>
<span class="pc bpc" id="L560" title="1 of 2 branches missed."> if (resource.isFilesystemOnly()) {</span>
<span class="fc" id="L561"> addArg(&quot;licenses-denied-file&quot;, ((FileResource) resource).getFile().getAbsolutePath());</span>
}
<span class="fc" id="L563"> }</span>
<span class="fc" id="L564"> }</span>
public void addConfiguredLst(Lst licenseID) {
<span class="fc" id="L566"> addArg(&quot;licenses-denied&quot;, licenseID.value);</span>
<span class="fc" id="L567">}</span>
}
/**
* 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.
*/
public LicenseFamiliesDenied createLicenseFamiliesDenied() {
<span class="fc" id="L573"> return new LicenseFamiliesDenied();</span>
}
public class LicenseFamiliesDenied {
<span class="fc" id="L577"> LicenseFamiliesDenied() { }</span>
public void addConfiguredLst(Lst familyID) {
<span class="fc" id="L579"> addArg(&quot;license-families-denied&quot;, familyID.value);</span>
<span class="fc" id="L580">}</span>
public void addConfiguredFileset(FileSet fileSet) {
<span class="fc bfc" id="L582" title="All 2 branches covered."> for (Resource resource : fileSet) {</span>
<span class="pc bpc" id="L583" title="1 of 2 branches missed."> if (resource.isFilesystemOnly()) {</span>
<span class="fc" id="L584"> addArg(&quot;license-families-denied-file&quot;, ((FileResource) resource).getFile().getAbsolutePath());</span>
}
<span class="fc" id="L586"> }</span>
<span class="fc" id="L587"> }</span>
}
/**
* The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number.
*/
public CounterMax createCounterMax() {
<span class="fc" id="L593"> return new CounterMax();</span>
}
public class CounterMax {
<span class="fc" id="L597"> CounterMax() { }</span>
public void addConfiguredCntr(Cntr counterPattern) {
<span class="fc" id="L599"> addArg(&quot;counter-max&quot;, counterPattern.value);</span>
<span class="fc" id="L600">}</span>
}
/**
* The minimum number for the specified counter.
*/
public CounterMin createCounterMin() {
<span class="fc" id="L606"> return new CounterMin();</span>
}
public class CounterMin {
<span class="fc" id="L610"> CounterMin() { }</span>
public void addConfiguredCntr(Cntr counterPattern) {
<span class="fc" id="L612"> addArg(&quot;counter-min&quot;, counterPattern.value);</span>
<span class="fc" id="L613">}</span>
}
/**
* Excludes files matching &amp;lt;Expression&amp;gt;.
* @deprecated Deprecated for removal since 0.17: Use &amp;lt;inputExclude&amp;gt; instead.
*/
public Exclude createExclude() {
<span class="fc" id="L620"> return new Exclude();</span>
}
public class Exclude {
<span class="fc" id="L624"> Exclude() { }</span>
public void addConfiguredExpr(Expr expression) {
<span class="fc" id="L626"> addArg(&quot;exclude&quot;, expression.value);</span>
<span class="fc" id="L627">}</span>
}
/**
* Excludes files matching &amp;lt;Expression&amp;gt;.
*/
public InputExclude createInputExclude() {
<span class="fc" id="L633"> return new InputExclude();</span>
}
public class InputExclude {
<span class="fc" id="L637"> InputExclude() { }</span>
public void addConfiguredExpr(Expr expression) {
<span class="fc" id="L639"> addArg(&quot;input-exclude&quot;, expression.value);</span>
<span class="fc" id="L640">}</span>
public void addConfiguredStd(Std standardCollection) {
<span class="fc" id="L642"> addArg(&quot;input-exclude-std&quot;, standardCollection.value);</span>
<span class="fc" id="L643">}</span>
public void addConfiguredFileset(FileSet fileSet) {
<span class="fc bfc" id="L645" title="All 2 branches covered."> for (Resource resource : fileSet) {</span>
<span class="pc bpc" id="L646" title="1 of 2 branches missed."> if (resource.isFilesystemOnly()) {</span>
<span class="fc" id="L647"> addArg(&quot;input-exclude-file&quot;, ((FileResource) resource).getFile().getAbsolutePath());</span>
}
<span class="fc" id="L649"> }</span>
<span class="fc" id="L650"> }</span>
}
/**
* Includes files matching &amp;lt;Expression&amp;gt;. Will override excluded files.
*/
public InputInclude createInputInclude() {
<span class="fc" id="L656"> return new InputInclude();</span>
}
public class InputInclude {
<span class="nc" id="L660"> InputInclude() { }</span>
public void addConfiguredExpr(Expr expression) {
<span class="nc" id="L662"> addArg(&quot;input-include&quot;, expression.value);</span>
<span class="nc" id="L663">}</span>
public void addConfiguredStd(Std standardCollection) {
<span class="nc" id="L665"> addArg(&quot;input-include-std&quot;, standardCollection.value);</span>
<span class="nc" id="L666">}</span>
public void addConfiguredFileset(FileSet fileSet) {
<span class="nc bnc" id="L668" title="All 2 branches missed."> for (Resource resource : fileSet) {</span>
<span class="nc bnc" id="L669" title="All 2 branches missed."> if (resource.isFilesystemOnly()) {</span>
<span class="nc" id="L670"> addArg(&quot;input-include-file&quot;, ((FileResource) resource).getFile().getAbsolutePath());</span>
}
<span class="nc" id="L672"> }</span>
<span class="nc" id="L673"> }</span>
}
/**
* Includes files matching &amp;lt;Expression&amp;gt;. Will override excluded files.
* @deprecated Deprecated for removal since 0.17: Use &amp;lt;inputInclude&amp;gt; instead.
*/
public Include createInclude() {
<span class="fc" id="L680"> return new Include();</span>
}
public class Include {
<span class="fc" id="L684"> Include() { }</span>
public void addConfiguredExpr(Expr expression) {
<span class="fc" id="L686"> addArg(&quot;include&quot;, expression.value);</span>
<span class="fc" id="L687">}</span>
}
/**
* Parse SCM based exclusion files to exclude specified files and directories. This action can apply to any standard collection that implements a file processor.
*/
public InputExcludeParsedScm createInputExcludeParsedScm() {
<span class="fc" id="L693"> return new InputExcludeParsedScm();</span>
}
public class InputExcludeParsedScm {
<span class="fc" id="L697"> InputExcludeParsedScm() { }</span>
public void addConfiguredStd(Std standardCollection) {
<span class="fc" id="L699"> addArg(&quot;input-exclude-parsed-scm&quot;, standardCollection.value);</span>
<span class="fc" id="L700">}</span>
}
/* TYPE CLASSES */
protected static class TxtValue {
<span class="fc" id="L706"> protected TxtValue() { }</span>
public String value;
public void addText(String text) {
<span class="fc" id="L711"> value = text.trim();</span>
<span class="fc" id="L712"> }</span>
}
public static class Std extends TxtValue {
<span class="fc" id="L716"> public Std() { }</span>
}
public static class Expr extends TxtValue {
<span class="fc" id="L720"> public Expr() { }</span>
}
public static class Cntr extends TxtValue {
<span class="fc" id="L724"> public Cntr() { }</span>
}
public static class Filename extends TxtValue {
<span class="nc" id="L728"> public Filename() { }</span>
}
public static class Lst extends TxtValue {
<span class="fc" id="L732"> public Lst() { }</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.14.202510111229</span></div></body></html>