[dd5bdf3] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[dd5bdf3] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[5bd4ba6e] | 7 | <!ENTITY apache-ant-download-http "http://archive.apache.org/dist/ant/source/apache-ant-&apache-ant-version;-src.tar.bz2">
|
---|
[e8edecd] | 8 | <!ENTITY apache-ant-download-ftp " ">
|
---|
[6dc9fd3] | 9 | <!ENTITY apache-ant-md5sum "7a7253ec047195d755c5318a4de8a3a4">
|
---|
| 10 | <!ENTITY apache-ant-size "3.6 MB">
|
---|
| 11 | <!ENTITY apache-ant-buildsize "108 MB">
|
---|
| 12 | <!ENTITY apache-ant-time "0.3 SBU">
|
---|
[dd5bdf3] | 13 | ]>
|
---|
| 14 |
|
---|
[ff53809] | 15 | <sect1 id="apache-ant" xreflabel="apache-ant-&apache-ant-version;">
|
---|
[514ef84d] | 16 | <?dbhtml filename="apache-ant.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
[ff53809] | 23 | <title>apache-ant-&apache-ant-version;</title>
|
---|
[514ef84d] | 24 |
|
---|
| 25 | <indexterm zone="apache-ant">
|
---|
| 26 | <primary sortas="a-Apache-Ant">Apache Ant</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to Apache Ant</title>
|
---|
| 31 |
|
---|
[539ace5] | 32 | <para>The <application>Apache Ant</application> package is a
|
---|
[e549304] | 33 | <application>Java</application>-based build tool. In theory, it is kind of
|
---|
| 34 | like <command>make</command>, but without <command>make</command>'s
|
---|
| 35 | wrinkles. <application>Ant</application> is different. Instead of a model
|
---|
| 36 | that is extended with shell-based commands, <application>Ant</application>
|
---|
| 37 | is extended using <application>Java</application> classes. Instead of
|
---|
| 38 | writing shell commands, the configuration files are XML-based, calling out
|
---|
| 39 | a target tree that executes various tasks. Each task is run by an object
|
---|
| 40 | that implements a particular task interface.</para>
|
---|
[514ef84d] | 41 |
|
---|
[4e047ca4] | 42 | &lfs75_checked;
|
---|
[50929e8] | 43 |
|
---|
[514ef84d] | 44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 45 | <itemizedlist spacing="compact">
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>Download (HTTP): <ulink url="&apache-ant-download-http;"/></para>
|
---|
| 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download (FTP): <ulink url="&apache-ant-download-ftp;"/></para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download MD5 sum: &apache-ant-md5sum;</para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Download size: &apache-ant-size;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Estimated disk space required: &apache-ant-buildsize;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>Estimated build time: &apache-ant-time;</para>
|
---|
| 63 | </listitem>
|
---|
| 64 | </itemizedlist>
|
---|
| 65 |
|
---|
[6dc9fd3] | 66 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 67 | <itemizedlist spacing="compact">
|
---|
| 68 | <listitem>
|
---|
| 69 | <para>
|
---|
| 70 | Required file: <ulink
|
---|
| 71 | url="http://anduin.linuxfromscratch.org/sources/other/junit-&junit-version;.jar">
|
---|
| 72 | http://anduin.linuxfromscratch.org/sources/other/junit-&junit-version;.jar</ulink>
|
---|
| 73 | </para>
|
---|
| 74 | </listitem>
|
---|
| 75 | <listitem>
|
---|
| 76 | <para>
|
---|
| 77 | Required file: <ulink
|
---|
| 78 | url="http://hamcrest.googlecode.com/files/hamcrest-&hamcrest-version;.tgz">
|
---|
| 79 | http://hamcrest.googlecode.com/files/hamcrest-&hamcrest-version;.tgz </ulink>
|
---|
| 80 | </para>
|
---|
| 81 | </listitem>
|
---|
| 82 | <listitem>
|
---|
| 83 | <para>Optional documentation: <ulink
|
---|
| 84 | url="https://archive.apache.org/dist/ant/manual/apache-ant-&apache-ant-version;-manual.tar.bz2">
|
---|
| 85 | https://archive.apache.org/dist/ant/manual/apache-ant-&apache-ant-version;-manual.tar.bz2
|
---|
| 86 | </ulink>
|
---|
| 87 | </para>
|
---|
| 88 | </listitem>
|
---|
| 89 | </itemizedlist>
|
---|
| 90 |
|
---|
[514ef84d] | 91 | <bridgehead renderas="sect3">Apache Ant Dependencies</bridgehead>
|
---|
| 92 |
|
---|
| 93 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[ff53809] | 94 | <para role="required">
|
---|
[4e047ca4] | 95 | A JDK (<xref linkend="java-bin"/> or <xref linkend="openjdk"/>) and
|
---|
| 96 | <xref linkend="glib2"/>
|
---|
[ff53809] | 97 | </para>
|
---|
[66ab31e] | 98 |
|
---|
[6dc9fd3] | 99 | <!-- <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
[ff53809] | 100 | <para role="recommended">
|
---|
| 101 | <xref linkend="junit"/>
|
---|
| 102 | </para>
|
---|
[6dc9fd3] | 103 | -->
|
---|
[1039de3] | 104 | <para condition="html" role="usernotes">User Notes:
|
---|
| 105 | <ulink url="&blfs-wiki;/apache-ant"/></para>
|
---|
| 106 |
|
---|
[514ef84d] | 107 | </sect2>
|
---|
| 108 |
|
---|
| 109 | <sect2 role="installation">
|
---|
| 110 | <title>Installation of Apache Ant</title>
|
---|
| 111 |
|
---|
| 112 | <note>
|
---|
[919683dc] | 113 | <para>You may need additional libraries to satisfy the build
|
---|
[539ace5] | 114 | requirements of various packages installed using
|
---|
| 115 | <application>Apache Ant</application>. Review the table at
|
---|
[0619e6d] | 116 | <ulink url="http://ant.apache.org/manual/install.html#librarydependencies"/>
|
---|
[debb88bf] | 117 | for any prerequisite libraries you may need. Place any needed libraries
|
---|
| 118 | in <filename>lib/optional</filename>.</para>
|
---|
[514ef84d] | 119 | </note>
|
---|
| 120 |
|
---|
[6dc9fd3] | 121 | <!-- <para>If it is not possible to install the recommended
|
---|
[d414190] | 122 | <application>JUnit</application> package, install
|
---|
| 123 | <application>Apache Ant</application> by removing the reference to the test
|
---|
| 124 | instructions (note that the tests will not be performed):</para>
|
---|
[66ab31e] | 125 |
|
---|
[debb88bf] | 126 | <screen><userinput>sed -i 's/jars,test-jar/jars/' build.xml</userinput></screen>
|
---|
[6dc9fd3] | 127 | -->
|
---|
| 128 | <para>Unpack and copy the <application>junit</application> and
|
---|
| 129 | <application>hamcrest</application> jar files to the
|
---|
[e8edecd] | 130 | local directory tree.</para>
|
---|
| 131 |
|
---|
[6dc9fd3] | 132 | <screen><userinput>tar -xvf ../hamcrest-&hamcrest-version;.tgz &&
|
---|
| 133 | cp -v ../junit-&junit-version;.jar \
|
---|
| 134 | hamcrest-&hamcrest-version;/hamcrest-core-&hamcrest-version;.jar lib/optional</userinput></screen>
|
---|
| 135 |
|
---|
| 136 | <para>If you wish to install the documentation, unpack it:</para>
|
---|
| 137 |
|
---|
| 138 | <screen><userinput>tar -xvf ../apache-ant-&apache-ant-version;-manual.tar.bz2</userinput></screen>
|
---|
[e8edecd] | 139 |
|
---|
[539ace5] | 140 | <para>Install <application>Apache Ant</application> by running the following
|
---|
[514ef84d] | 141 | commands:</para>
|
---|
| 142 |
|
---|
[d414190] | 143 | <para>The unit regression tests are performed during the build step below
|
---|
| 144 | unless <application>JUnit</application> is not installed. Now, as the
|
---|
| 145 | <systemitem class="username">root</systemitem> user:</para>
|
---|
[514ef84d] | 146 |
|
---|
| 147 | <screen role="root"><userinput>./build.sh -Ddist.dir=/opt/ant-&apache-ant-version; dist &&
|
---|
[e8edecd] | 148 | ln -v -sfn ant-&apache-ant-version; /opt/ant</userinput></screen>
|
---|
| 149 |
|
---|
| 150 | <note><para>Make sure the JAVA_HOME environment variable is set for the
|
---|
| 151 | <systemitem class="username">root</systemitem> user.</para></note>
|
---|
[514ef84d] | 152 |
|
---|
[6dc9fd3] | 153 | <para>Install the documentation as the
|
---|
| 154 | <systemitem class="username">root</systemitem> user:</para>
|
---|
| 155 |
|
---|
| 156 | <screen role="root"><userinput>install -m755 -d /opt/ant-&apache-ant-version;/docs &&
|
---|
| 157 | cp -Rv apache-ant-&apache-ant-version;/* /opt/ant-&apache-ant-version;/docs</userinput></screen>
|
---|
| 158 |
|
---|
[514ef84d] | 159 | </sect2>
|
---|
| 160 |
|
---|
| 161 | <sect2 role="commands">
|
---|
| 162 | <title>Command Explanations</title>
|
---|
| 163 |
|
---|
[6dc9fd3] | 164 | <!-- <para><command>sed -i 's/jars...</command>: If the
|
---|
[d414190] | 165 | <application>JUnit</application> package is not installed, the regression
|
---|
| 166 | tests cannot be performed.</para>
|
---|
[6dc9fd3] | 167 | -->
|
---|
| 168 | <para><command>cp -v ... lib/optional</command>:
|
---|
| 169 | This command copies the JUnit and hamcrest jar files into the directory where
|
---|
| 170 | Apache Ant will look for it.</para>
|
---|
[9b9be0d] | 171 |
|
---|
[539ace5] | 172 | <para><command>./build.sh -Ddist.dir=/opt/ant-&apache-ant-version;
|
---|
[915403df] | 173 | dist</command>: This command does everything. It builds, tests, then
|
---|
[539ace5] | 174 | installs the package into
|
---|
[514ef84d] | 175 | <filename class='directory'>/opt/ant-&apache-ant-version;</filename>.</para>
|
---|
| 176 |
|
---|
[e8edecd] | 177 | <para><command>ln -v -sfn ant-&apache-ant-version; /opt/ant</command>: This
|
---|
[514ef84d] | 178 | command is optional, and creates a convenience symlink.</para>
|
---|
| 179 |
|
---|
| 180 | </sect2>
|
---|
| 181 |
|
---|
| 182 | <sect2 role="configuration">
|
---|
| 183 | <title>Configuring Apache Ant</title>
|
---|
| 184 |
|
---|
| 185 | <sect3 id="apache-ant-config">
|
---|
[30edc031] | 186 | <title>Config Files</title>
|
---|
[514ef84d] | 187 |
|
---|
[539ace5] | 188 | <para><filename>/etc/ant/ant.conf</filename>,
|
---|
| 189 | <filename>~/.ant/ant.conf</filename>, and
|
---|
[514ef84d] | 190 | <filename>~/.antrc</filename></para>
|
---|
| 191 |
|
---|
| 192 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 193 | <primary sortas="e-AA.ant-ant.conf">~/.ant/ant.conf</primary>
|
---|
| 194 | </indexterm>
|
---|
| 195 |
|
---|
| 196 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 197 | <primary sortas="e-AA.antrc">~/.antrc</primary>
|
---|
| 198 | </indexterm>
|
---|
| 199 |
|
---|
| 200 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 201 | <primary sortas="e-etc-ant-ant.conf">/etc/ant/ant.conf</primary>
|
---|
| 202 | </indexterm>
|
---|
| 203 |
|
---|
| 204 | </sect3>
|
---|
| 205 |
|
---|
| 206 | <sect3>
|
---|
| 207 | <title>Configuration Information</title>
|
---|
| 208 |
|
---|
[e549304] | 209 | <para>Some packages will require <command>ant</command> to be in the
|
---|
| 210 | search path and the <envar>$ANT_HOME</envar> environment variable
|
---|
| 211 | defined. Satisfy these requirements by adding the following lines to
|
---|
[539ace5] | 212 | <filename>/etc/profile</filename> or to individual user's
|
---|
[514ef84d] | 213 | <filename>~/.profile</filename> or <filename>~/.bashrc</filename> files:</para>
|
---|
| 214 |
|
---|
| 215 | <screen><literal>export PATH=$PATH:/opt/ant/bin
|
---|
| 216 | export ANT_HOME=/opt/ant</literal></screen>
|
---|
| 217 |
|
---|
| 218 | </sect3>
|
---|
| 219 |
|
---|
| 220 | </sect2>
|
---|
| 221 |
|
---|
| 222 | <sect2 role="content">
|
---|
| 223 | <title>Contents</title>
|
---|
| 224 |
|
---|
| 225 | <segmentedlist>
|
---|
| 226 | <segtitle>Installed Programs</segtitle>
|
---|
| 227 | <segtitle>Installed Libraries</segtitle>
|
---|
| 228 | <segtitle>Installed Directories</segtitle>
|
---|
| 229 |
|
---|
| 230 | <seglistitem>
|
---|
| 231 | <seg>ant, antRun, antRun.pl, complete-ant-cmd.pl, runant.pl, and runant.py</seg>
|
---|
[e8edecd] | 232 | <seg>ant*.jar</seg>
|
---|
| 233 | <seg>/opt/ant-&apache-ant-version;</seg>
|
---|
[514ef84d] | 234 | </seglistitem>
|
---|
| 235 | </segmentedlist>
|
---|
| 236 |
|
---|
| 237 | <variablelist>
|
---|
| 238 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 239 | <?dbfo list-presentation="list"?>
|
---|
| 240 | <?dbhtml list-presentation="table"?>
|
---|
| 241 |
|
---|
| 242 | <varlistentry id="ant">
|
---|
| 243 | <term><command>ant</command></term>
|
---|
| 244 | <listitem>
|
---|
[539ace5] | 245 | <para>is a <application>Java</application> based build tool used by
|
---|
[0619e6d] | 246 | many packages instead of the conventional <command>make</command>
|
---|
[514ef84d] | 247 | program.</para>
|
---|
| 248 | <indexterm zone="apache-ant ant">
|
---|
| 249 | <primary sortas="b-ant">ant</primary>
|
---|
| 250 | </indexterm>
|
---|
| 251 | </listitem>
|
---|
| 252 | </varlistentry>
|
---|
| 253 |
|
---|
| 254 | <varlistentry id="antRun">
|
---|
| 255 | <term><command>antRun</command></term>
|
---|
| 256 | <listitem>
|
---|
[0619e6d] | 257 | <para>is a support script used to start <command>ant</command>
|
---|
[514ef84d] | 258 | build scripts in a given directory.</para>
|
---|
| 259 | <indexterm zone="apache-ant antRun">
|
---|
| 260 | <primary sortas="b-antRun">antRun</primary>
|
---|
| 261 | </indexterm>
|
---|
| 262 | </listitem>
|
---|
| 263 | </varlistentry>
|
---|
| 264 |
|
---|
| 265 | <varlistentry id="antRun.pl">
|
---|
| 266 | <term><command>antRun.pl</command></term>
|
---|
| 267 | <listitem>
|
---|
[539ace5] | 268 | <para>is a <application>Perl</application> script that provides
|
---|
[514ef84d] | 269 | similar functionality offered by the <command>antRun</command> script.</para>
|
---|
| 270 | <indexterm zone="apache-ant antRun.pl">
|
---|
| 271 | <primary sortas="b-antRun.pl">antRun.pl</primary>
|
---|
| 272 | </indexterm>
|
---|
| 273 | </listitem>
|
---|
| 274 | </varlistentry>
|
---|
| 275 |
|
---|
| 276 | <varlistentry id="complete-ant-cmd.pl">
|
---|
| 277 | <term><command>complete-ant-cmd.pl</command></term>
|
---|
| 278 | <listitem>
|
---|
[539ace5] | 279 | <para>is a <application>Perl</application> script that allows
|
---|
[0619e6d] | 280 | <application>Bash</application> to complete an <command>ant</command>
|
---|
[514ef84d] | 281 | command-line.</para>
|
---|
| 282 | <indexterm zone="apache-ant complete-ant-cmd.pl">
|
---|
| 283 | <primary sortas="b-complete-ant-cmd.pl">complete-ant-cmd.pl</primary>
|
---|
| 284 | </indexterm>
|
---|
| 285 | </listitem>
|
---|
| 286 | </varlistentry>
|
---|
| 287 |
|
---|
| 288 | <varlistentry id="runant.pl">
|
---|
| 289 | <term><command>runant.pl</command></term>
|
---|
| 290 | <listitem>
|
---|
[539ace5] | 291 | <para>is a <application>Perl</application> wrapper script used to
|
---|
[514ef84d] | 292 | invoke <command>ant</command>.</para>
|
---|
| 293 | <indexterm zone="apache-ant runant.pl">
|
---|
| 294 | <primary sortas="b-runant.pl">runant.pl</primary>
|
---|
| 295 | </indexterm>
|
---|
| 296 | </listitem>
|
---|
| 297 | </varlistentry>
|
---|
| 298 |
|
---|
| 299 | <varlistentry id="runant.py">
|
---|
| 300 | <term><command>runant.py</command></term>
|
---|
| 301 | <listitem>
|
---|
[539ace5] | 302 | <para>is a <application>Python</application> wrapper script used to
|
---|
[514ef84d] | 303 | invoke <command>ant</command>.</para>
|
---|
| 304 | <indexterm zone="apache-ant runant.py">
|
---|
| 305 | <primary sortas="b-runant.py">runant.py</primary>
|
---|
| 306 | </indexterm>
|
---|
| 307 | </listitem>
|
---|
| 308 | </varlistentry>
|
---|
| 309 |
|
---|
| 310 | <varlistentry id="ant-star">
|
---|
[e8edecd] | 311 | <term><filename class='libraryfile'>ant*.jar</filename></term>
|
---|
[514ef84d] | 312 | <listitem>
|
---|
[0619e6d] | 313 | <para>files are the <application>Apache Ant</application>
|
---|
[514ef84d] | 314 | <application>Java</application> class libraries.</para>
|
---|
| 315 | <indexterm zone="apache-ant ant-star">
|
---|
| 316 | <primary sortas="c-ant-star">ant-*.jar</primary>
|
---|
| 317 | </indexterm>
|
---|
| 318 | </listitem>
|
---|
| 319 | </varlistentry>
|
---|
| 320 |
|
---|
| 321 | </variablelist>
|
---|
| 322 |
|
---|
| 323 | </sect2>
|
---|
[dd5bdf3] | 324 |
|
---|
| 325 | </sect1>
|
---|