diff options
author | Gintas Grigelionis <gintas@apache.org> | 2018-02-28 07:58:59 +0100 |
---|---|---|
committer | Gintas Grigelionis <gintas@apache.org> | 2018-02-28 08:00:45 +0100 |
commit | 66b52f99e4306fe928aa5e497021cb51cb927e5e (patch) | |
tree | c58d724bc70f01dcf464dc4c84832507ca8c4d82 /manual/Tasks/concat.html | |
parent | 3e61185e19eca3ca70afeda3fb31a1a544f2b474 (diff) | |
download | ant-66b52f99e4306fe928aa5e497021cb51cb927e5e.tar.gz |
Use HTML 5(-ish), fix links
Diffstat (limited to 'manual/Tasks/concat.html')
-rw-r--r-- | manual/Tasks/concat.html | 551 |
1 files changed, 236 insertions, 315 deletions
diff --git a/manual/Tasks/concat.html b/manual/Tasks/concat.html index 1bdbd5a07..6909d02ea 100644 --- a/manual/Tasks/concat.html +++ b/manual/Tasks/concat.html @@ -16,319 +16,240 @@ --> <html> - <head> - <meta http-equiv="Content-Language" content="en-us"> - <link rel="stylesheet" type="text/css" href="../stylesheets/style.css"> - <title>Concat</title> - </head> - - <body> - - <h2 id="concat">Concat</h2> - - <h3>Description</h3> - - <p> - Concatenates one or more - <a href="../Types/resources.html">resource</a>s - to a single file or to the console. The destination - file will be created if it does not exist unless the resource - list is empty and ignoreempty is true. - </p> - - <p><em>Since Apache Ant 1.7.1</em>, this task can be used as a - <a href="../Types/resources.html#collection">Resource Collection</a> - that will return exactly one - <a href="../Types/resources.html">resource</a>. - </p> - - <p> - <a href="../Types/resources.html#collection"> -Resource Collection</a>s are used to - select which resources are to be concatenated. There is no - singular attribute to specify a single resource to cat. - </p> - - <h3>Parameters</h3> - - <table> - - <tr> - <td valign="top"><b>Attribute</b></td> - <td valign="top"><b>Description</b></td> - <td align="center" valign="top"><b>Required</b></td> - </tr> - - <tr> - <td valign="top">destfile</td> - <td valign="top"> - The destination file for the concatenated stream. - If not specified the console will be used instead. - </td> - <td valign="top" align="center"> - No - </td> - </tr> - - <tr> - <td valign="top">append</td> - <td valign="top"> - Specifies whether or not the file specified by 'destfile' - should be appended. Defaults to "no". - </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">force</td> - <td valign="top"> - Specifies whether or not the file specified by 'destfile' - should be written to even if it is newer than all source files. - <strong>deprecated, use the overwrite attribute instead</strong> - Defaults to "yes". - </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">overwrite</td> - <td valign="top"> - Specifies whether or not the file specified by 'destfile' - should be written to even if it is newer than all source files. - <em>Since Ant 1.8.2</em>. - Defaults to "yes". - </td> - <td valign="top" align="center">No</td> - </tr> - - <tr> - <td valign="top">forceReadOnly</td> - <td valign="top">Overwrite read-only destination - files. <em>Since Ant 1.8.2</em></td> - <td valign="top" align="center">No; defaults to false.</td> - </tr> - - <tr> - <td valign="top">encoding</td> - <td valign="top"> - Specifies the encoding for the input files. Please see <a - href="http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html"> - Supported Encodings</a> - for a list of possible values. Defaults to the platform's - default character encoding. - </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">outputencoding</td> - <td valign="top"> - The encoding to use when writing the output file. - <em>Since Ant 1.6</em>. - Defaults to the value of the encoding attribute - if given or the default JVM encoding otherwise. - </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">fixlastline</td> - <td valign="top"> - Specifies whether or not to check if - each file concatenated is terminated by - a new line. If this attribute is "yes" - a new line will be appended to the stream if - the file did not end in a new line. - <em>Since Ant 1.6</em>. - Defaults to "no". - This attribute does not apply to embedded text. - </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">eol</td> - <td valign="top"> - Specifies what the end of line character are - for use by the fixlastline attribute. - <em>Since Ant 1.6</em> - Valid values for this property are: - <ul> - <li>cr: a single CR</li> - <li>lf: a single LF</li> - <li>crlf: the pair CRLF</li> - <li>mac: a single CR</li> - <li>unix: a single LF</li> - <li>dos: the pair CRLF</li> - </ul> - The default is platform dependent. - For Unix platforms, the default is "lf". - For DOS based systems (including Windows), - the default is "crlf". - For Mac OS, the default is "cr". - </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">binary</td> - <td valign="top"> - <em>Since Ant 1.6.2</em> - If this attribute is set to true, the task concatenates the files - in a byte by byte fashion. If this attribute is false, concat will - not normally work for binary files due to character encoding - issues. - If this option is set to true, the destfile attribute must be - set, and the task cannot used nested text. - Also the attributes encoding, outputencoding, filelastline - cannot be used. - The default is "false". - </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">ignoreempty</td> - <td valign="top"> - <em>Since Ant 1.8.0</em> - Specifies whether or not the file specified by 'destfile' - should be created if the source resource list is - empty. Defaults to "true". - </td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">resourcename</td> - <td valign="top"> - <em>Since Ant 1.8.3</em> - Specifies the name reported if this task is exposed - as a <a href="../Types/resources.html">resource</a>. - </td> - <td valign="top" align="center">No</td> - </tr> - - </table> - - <h3>Parameters specified as nested elements</h3> - <h4>Resource Collection</h4> - <p><em>since Ant 1.7</em>.</p> - - <p> - Any of the various <a href="../Types/resources.html#collection"> - Resource Collection</a> types can specify the resources to be - concatenated. - </p> - - <h4>filterchain</h4> - <p><em>since Ant 1.6</em>.</p> - <p>The concat task supports nested - <a href="../Types/filterchain.html"> FilterChain</a>s.</p> - - <h4>header, footer</h4> - <p><em>since Ant 1.6</em>.</p> - <p>Used to prepend or postpend text into the concatenated stream.</p> - <p>The text may be in-line or be in a file.</p> - <table> - <tr> - <td valign="top"><b>Attribute</b></td> - <td valign="top"><b>Description</b></td> - <td align="center" valign="top"><b>Required</b></td> - </tr> - <tr> - <td valign="top">filtering</td> - <td valign="top"> - Whether to filter the text provided by this sub element, - default is "yes". - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">file</td> - <td valign="top">A file to place at the head or tail of the - concatenated text. - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">trim</td> - <td valign="top">Whether to trim the value, default is "no"</td> - <td valign="top" align="center">No</td> - </tr> - <tr> - <td valign="top">trimleading</td> - <td valign="top"> - Whether to trim leading white space on each line, default is "no" - </td> - <td valign="top" align="center">No</td> - </tr> - </table> - - <h3>Examples</h3> - - <p><b>Concatenate a string to a file:</b></p> - - <pre> - <concat destfile="README">Hello, World!</concat> - </pre> - - <p><b>Concatenate a series of files to the console:</b></p> - - <pre> - <concat> - <fileset dir="messages" includes="*important*"/> - </concat> - </pre> - - <p><b>Concatenate a single file, appending if the destination file exists:</b></p> - - <pre> - <concat destfile="NOTES" append="true"> - <filelist dir="notes" files="note.txt"/> - </concat> - </pre> - - <p><b>Concatenate a series of files, update the destination - file only if is older that all the source files:</b></p> - - <pre> - <concat destfile="${docbook.dir}/all-sections.xml" - force="no"> - <filelist dir="${docbook.dir}/sections" - files="introduction.xml,overview.xml"/> - <fileset dir="${docbook.dir}" - includes="sections/*.xml" - excludes="introduction.xml,overview.xml"/> - </concat> - </pre> - - <p><b>Concatenate a series of files, expanding Ant properties</b></p> - <pre> - <concat destfile="${build.dir}/subs"> - <path> - <fileset dir="${src.dir}" includes="*.xml"/> - <pathelement location="build.xml"/> - </path> - <filterchain> - <expandproperties/> - </filterchain> - </concat> - </pre> - - <p><b>Filter the lines containing project from build.xml and output - them to report.output, prepending with a header</b></p> - <pre> - <concat destfile="${build.dir}/report.output"> - <header filtering="no" trimleading="yes"> - Lines that contain project - ========================== - </header> - <path path="build.xml"/> - <filterchain> - <linecontains> - <contains value="project"/> - </linecontains> - </filterchain> - </concat> - </pre> - - <p><b>Concatenate a number of binary files.</b></p> - <pre> - <concat destfile="${build.dir}/dist.bin" binary="yes"> - <fileset file="${src.dir}/scripts/dist.sh" /> - <fileset file="${build.dir}/dist.tar.bz2" /> - </concat> - </pre> - - </body> + <head> + <meta http-equiv="Content-Language" content="en-us"> + <link rel="stylesheet" type="text/css" href="../stylesheets/style.css"> + <title>Concat</title> + </head> + + <body> + + <h2 id="concat">Concat</h2> + + <h3>Description</h3> + + <p>Concatenates one or more <a href="../Types/resources.html">resource</a>s to a single file or + to the console. The destination file will be created if it does not exist unless the resource + list is empty and <var>ignoreempty</var> is <q>true</q>.</p> + + <p><em>Since Apache Ant 1.7.1</em>, this task can be used as + a <a href="../Types/resources.html#collection">Resource Collection</a> that will return + exactly one <a href="../Types/resources.html">resource</a>.</p> + + <p><a href="../Types/resources.html#collection">Resource Collection</a>s are used to select + which resources are to be concatenated. There is no singular attribute to specify a single + resource to <code>cat</code>.</p> + + <h3>Parameters</h3> + + <table class="attr"> + <tr> + <th>Attribute</th> + <th>Description</th> + <th>Required</th> + </tr> + <tr> + <td>destfile</td> + <td>The destination file for the concatenated stream. If not specified the console will be + used instead.</td> + <td>No</td> + </tr> + <tr> + <td>append</td> + <td>Specifies whether or not the file specified by <var>destfile</var> should be + appended.</td> + <td>No; defaults to <q>no</q></td> + </tr> + <tr> + <td>force</td> + <td>Specifies whether or not the file specified by <var>destfile</var> should be written to + even if it is newer than all source files. <em><u>Deprecated</u>, use + the <var>overwrite</var> attribute instead.</em></td> + <td>No; defaults to <q>yes</q></td> + </tr> + <tr> + <td>overwrite</td> + <td>Specifies whether or not the file specified by <var>destfile</var> should be written to + even if it is newer than all source files. <em>Since Ant 1.8.2</em>.</td> + <td>No; defaults to <q>yes</q></td> + </tr> + <tr> + <td>forceReadOnly</td> + <td>Overwrite read-only destination files. <em>Since Ant 1.8.2</em></td> + <td>No; defaults to <q>false</q></td> + </tr> + <tr> + <td>encoding</td> + <td>Specifies the encoding for the input files. Please + see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html">Supported + Encodings</a> for a list of possible values.</td> + <td>No; defaults to default JVM character encoding</td> + </tr> + <tr> + <td>outputencoding</td> + <td>The encoding to use when writing the output file. <em>Since Ant 1.6</em>.</td> + <td>No; defaults to <var>encoding</var> if set or default JVM character encoding + otherwise</td> + </tr> + <tr> + <td>fixlastline</td> + <td>Specifies whether or not to check if each file concatenated is terminated by a new + line. If this attribute is <q>yes</q> a new line will be appended to the stream if the + file did not end in a new line. <em>Since Ant 1.6</em>. This attribute does not apply to + embedded text.</td> + <td>No; defaults to <q>no</q></td> + </tr> + <tr> + <td>eol</td> + <td>Specifies what the end of line character are for use by the fixlastline + attribute. <em>Since Ant 1.6</em> Valid values for this property are: + <ul> + <li><q>cr</q>: a single CR</li> + <li><q>lf</q>: a single LF</li> + <li><q>crlf</q>: the pair CRLF</li> + <li><q>mac</q>: a single CR</li> + <li><q>unix</q>: a single LF</li> + <li><q>dos</q>: the pair CRLF</li> + </ul></td> + <td>No; default is platform dependent: <q>lf</q> for Unix, <q>crlf</q> for DOS family + (including Windows), <q>cr</q> for Mac OS 9 or earlier</td></tr> + <tr> + <td>binary</td> + <td><em>Since Ant 1.6.2</em> If this attribute is set to <q>true</q>, the task concatenates + the files in a byte by byte fashion. If this attribute is <q>false</q>, concat will not + normally work for binary files due to character encoding issues. If this option is set + to <q>true</q>, the <var>destfile</var> attribute must be set, and the task cannot used + nested text. Also the + attributes <var>encoding</var>, <var>outputencoding</var>, <var>filelastline</var> cannot + be used.</td> + <td>No; default is <q>false</q></td> + </tr> + <tr> + <td>ignoreempty</td> + <td><em>Since Ant 1.8.0</em> Specifies whether or not the file specified + by <var>destfile</var> should be created if the source resource list is empty. + </td> + <td>No; defaults to <q>true</q></td> + </tr> + <tr> + <td>resourcename</td> + <td><em>Since Ant 1.8.3</em> Specifies the name reported if this task is exposed as + a <a href="../Types/resources.html">resource</a>. + </td> + <td>No</td> + </tr> + </table> + + <h3>Parameters specified as nested elements</h3> + <h4>Resource Collection</h4> + <p><em>since Ant 1.7</em>.</p> + + <p>Any of the various <a href="../Types/resources.html#collection">Resource Collection</a> types + can specify the resources to be concatenated.</p> + + <h4>filterchain</h4> + <p><em>since Ant 1.6</em>.</p> + <p>The concat task supports nested <a href="../Types/filterchain.html">FilterChain</a>s.</p> + + <h4>header, footer</h4> + <p><em>since Ant 1.6</em>.</p> + <p>Used to prepend or postpend text into the concatenated stream.</p> + <p>The text may be in-line or be in a file.</p> + <table class="attr"> + <tr> + <th>Attribute</th> + <th>Description</th> + <th>Required</th> + </tr> + <tr> + <td>filtering</td> + <td>Whether to filter the text provided by this sub element.</td> + <td>No; default is <q>yes</q></td> + </tr> + <tr> + <td>file</td> + <td>A file to place at the head or tail of the concatenated text.</td> + <td>No</td> + </tr> + <tr> + <td>trim</td> + <td>Whether to trim the value.</td> + <td>No; default is <q>no</q></td> + </tr> + <tr> + <td>trimleading</td> + <td>Whether to trim leading white space on each line.</td> + <td>No; default is <q>no</q></td> + </tr> + </table> + + <h3>Examples</h3> + + <p><strong>Concatenate a string to a file:</strong></p> + + <pre><concat destfile="README">Hello, World!</concat></pre> + + <p><strong>Concatenate a series of files to the console:</strong></p> + + <pre> +<concat> + <fileset dir="messages" includes="*important*"/> +</concat></pre> + + <p><strong>Concatenate a single file, appending if the destination file exists:</strong></p> + + <pre> +<concat destfile="NOTES" append="true"> + <filelist dir="notes" files="note.txt"/> +</concat></pre> + + <p><strong>Concatenate a series of files, update the destination file only if is older that all + the source files:</strong></p> + + <pre> +<concat destfile="${docbook.dir}/all-sections.xml" + force="no"> + <filelist dir="${docbook.dir}/sections" + files="introduction.xml,overview.xml"/> + <fileset dir="${docbook.dir}" + includes="sections/*.xml" + excludes="introduction.xml,overview.xml"/> +</concat></pre> + + <p><strong>Concatenate a series of files, expanding Ant properties</strong></p> + <pre> +<concat destfile="${build.dir}/subs"> + <path> + <fileset dir="${src.dir}" includes="*.xml"/> + <pathelement location="build.xml"/> + </path> + <filterchain> + <expandproperties/> + </filterchain> +</concat></pre> + + <p><strong>Filter the lines containing project from build.xml and output them to report.output, + prepending with a header</strong></p> + <pre> +<concat destfile="${build.dir}/report.output"> + <header filtering="no" trimleading="yes"> + Lines that contain project + ========================== + </header> + <path path="build.xml"/> + <filterchain> + <linecontains> + <contains value="project"/> + </linecontains> + </filterchain> +</concat></pre> + + <p><strong>Concatenate a number of binary files.</strong></p> + <pre> +<concat destfile="${build.dir}/dist.bin" binary="yes"> + <fileset file="${src.dir}/scripts/dist.sh"/> + <fileset file="${build.dir}/dist.tar.bz2"/> +</concat></pre> + + </body> </html> |