[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">
|
---|
[265dc9fb] | 8 | <!ENTITY apache-ant-download-ftp "ftp://anduin.linuxfromscratch.org/BLFS/svn/a/apache-ant-&apache-ant-version;-src.tar.bz2">
|
---|
[e549304] | 9 | <!ENTITY apache-ant-md5sum "8c31b30f6b9863d1fef4bdf484fc8507">
|
---|
| 10 | <!ENTITY apache-ant-size "5.8 MB">
|
---|
[9b9be0d] | 11 | <!ENTITY apache-ant-buildsize "119 MB">
|
---|
[e549304] | 12 | <!ENTITY apache-ant-time "0.4 SBU">
|
---|
[dd5bdf3] | 13 | ]>
|
---|
| 14 |
|
---|
| 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 |
|
---|
| 23 | <title>Apache Ant-&apache-ant-version;</title>
|
---|
| 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 |
|
---|
[50929e8] | 42 | <para>&lfssvn_checked;20101029&lfssvn_checked2;</para>
|
---|
| 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 |
|
---|
[915403df] | 66 | <!-- <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[514ef84d] | 67 | <itemizedlist spacing="compact">
|
---|
| 68 | <listitem>
|
---|
[539ace5] | 69 | <para>Required Patch: <ulink
|
---|
[514ef84d] | 70 | url="&patch-root;/apache-ant-&apache-ant-version;-blfs_install-1.patch"/></para>
|
---|
| 71 | </listitem>
|
---|
[915403df] | 72 | </itemizedlist> -->
|
---|
[514ef84d] | 73 |
|
---|
| 74 | <bridgehead renderas="sect3">Apache Ant Dependencies</bridgehead>
|
---|
| 75 |
|
---|
| 76 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[b66ece35] | 77 | <para role="required"><xref linkend="icedtea6"/> or
|
---|
| 78 | <xref linkend="jdk"/></para>
|
---|
[66ab31e] | 79 |
|
---|
| 80 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 81 | <para role="recommended"><xref linkend="junit"/></para>
|
---|
[514ef84d] | 82 |
|
---|
[1039de3] | 83 | <para condition="html" role="usernotes">User Notes:
|
---|
| 84 | <ulink url="&blfs-wiki;/apache-ant"/></para>
|
---|
| 85 |
|
---|
[514ef84d] | 86 | </sect2>
|
---|
| 87 |
|
---|
| 88 | <sect2 role="installation">
|
---|
| 89 | <title>Installation of Apache Ant</title>
|
---|
| 90 |
|
---|
| 91 | <note>
|
---|
[919683dc] | 92 | <para>You may need additional libraries to satisfy the build
|
---|
[539ace5] | 93 | requirements of various packages installed using
|
---|
| 94 | <application>Apache Ant</application>. Review the table at
|
---|
[0619e6d] | 95 | <ulink url="http://ant.apache.org/manual/install.html#librarydependencies"/>
|
---|
[915403df] | 96 | for any prerequisite libraries you may need.</para>
|
---|
| 97 |
|
---|
| 98 | <!-- <para>One such library is the
|
---|
[af2764a] | 99 | <application>JUnit</application>-3.8.1 testing framework library. Many
|
---|
| 100 | Ant-installed packages will use this library to perform the unit tests
|
---|
| 101 | during the build process. To install the JUnit library along with the
|
---|
[539ace5] | 102 | <application>Apache Ant</application> package, download it from
|
---|
| 103 | <ulink url="http://www.junit.org/"/>, unzip the distribution file (requires
|
---|
[514ef84d] | 104 | <xref linkend="unzip"/>) and copy the <filename>junit.jar</filename> file
|
---|
| 105 | into the <filename class='directory'>lib</filename> subdirectory of the
|
---|
[539ace5] | 106 | <application>Apache Ant</application> source tree before beginning the
|
---|
[915403df] | 107 | <application>Apache Ant</application> build.</para> -->
|
---|
[514ef84d] | 108 | </note>
|
---|
| 109 |
|
---|
[d414190] | 110 | <para>If it is not possible to install the recommended
|
---|
| 111 | <application>JUnit</application> package, install
|
---|
| 112 | <application>Apache Ant</application> by removing the reference to the test
|
---|
| 113 | instructions (note that the tests will not be performed):</para>
|
---|
[66ab31e] | 114 |
|
---|
| 115 | <screen><userinput>sed -i 's;jars,test-jar;jars;' build.xml</userinput></screen>
|
---|
| 116 |
|
---|
[539ace5] | 117 | <para>Install <application>Apache Ant</application> by running the following
|
---|
[514ef84d] | 118 | commands:</para>
|
---|
| 119 |
|
---|
[9b9be0d] | 120 | <screen><userinput>sed -i 's|${dist.dir}/etc|/etc/ant|' build.xml &&
|
---|
| 121 | sed -i 's|/etc/ant.conf|/etc/ant/ant.conf|' src/script/ant &&
|
---|
[a9995cf] | 122 | cp -v /usr/share/junit-&junit-version;/junit-&junit-version;.jar \
|
---|
[9b9be0d] | 123 | lib/optional/junit.jar</userinput></screen>
|
---|
[514ef84d] | 124 |
|
---|
[d414190] | 125 | <para>The unit regression tests are performed during the build step below
|
---|
| 126 | unless <application>JUnit</application> is not installed. Now, as the
|
---|
| 127 | <systemitem class="username">root</systemitem> user:</para>
|
---|
[514ef84d] | 128 |
|
---|
| 129 | <screen role="root"><userinput>./build.sh -Ddist.dir=/opt/ant-&apache-ant-version; dist &&
|
---|
| 130 | ln -v -sf /etc/ant /opt/ant-&apache-ant-version;/etc &&
|
---|
| 131 | ln -v -sf ant-&apache-ant-version; /opt/ant</userinput></screen>
|
---|
| 132 |
|
---|
| 133 | </sect2>
|
---|
| 134 |
|
---|
| 135 | <sect2 role="commands">
|
---|
| 136 | <title>Command Explanations</title>
|
---|
| 137 |
|
---|
[d414190] | 138 | <para><command>sed -i 's;jars...</command>: If the
|
---|
| 139 | <application>JUnit</application> package is not installed, the regression
|
---|
| 140 | tests cannot be performed.</para>
|
---|
[66ab31e] | 141 |
|
---|
[915403df] | 142 | <para><command>sed ...</command>: These commands change the configuration
|
---|
| 143 | directory to <filename class='directory'>/etc/ant</filename> to conform
|
---|
| 144 | with FHS guidelines.</para>
|
---|
| 145 |
|
---|
[e549304] | 146 | <para><command>cp -v
|
---|
| 147 | /usr/share/junit-&junit-version;/&junit-version;.jar ...</command>:
|
---|
[9b9be0d] | 148 | This command copies the JUnit jar file into the directory where Apache Ant
|
---|
| 149 | will look for it.</para>
|
---|
| 150 |
|
---|
[539ace5] | 151 | <para><command>./build.sh -Ddist.dir=/opt/ant-&apache-ant-version;
|
---|
[915403df] | 152 | dist</command>: This command does everything. It builds, tests, then
|
---|
[539ace5] | 153 | installs the package into
|
---|
[514ef84d] | 154 | <filename class='directory'>/opt/ant-&apache-ant-version;</filename>.</para>
|
---|
| 155 |
|
---|
[539ace5] | 156 | <para><command>ln -v -sf /etc/ant /opt/ant-&apache-ant-version;/etc</command>:
|
---|
[915403df] | 157 | The <command>sed</command> commands change the configuration directory to
|
---|
| 158 | <filename class='directory'>/etc/ant</filename> and this command creates a
|
---|
| 159 | symlink from the configuration directory back to the installation directory
|
---|
| 160 | as the package is expecting to find some files there.</para>
|
---|
[514ef84d] | 161 |
|
---|
[539ace5] | 162 | <para><command>ln -v -sf ant-&apache-ant-version; /opt/ant</command>: This
|
---|
[514ef84d] | 163 | command is optional, and creates a convenience symlink.</para>
|
---|
| 164 |
|
---|
| 165 | </sect2>
|
---|
| 166 |
|
---|
| 167 | <sect2 role="configuration">
|
---|
| 168 | <title>Configuring Apache Ant</title>
|
---|
| 169 |
|
---|
| 170 | <sect3 id="apache-ant-config">
|
---|
[30edc031] | 171 | <title>Config Files</title>
|
---|
[514ef84d] | 172 |
|
---|
[539ace5] | 173 | <para><filename>/etc/ant/ant.conf</filename>,
|
---|
| 174 | <filename>~/.ant/ant.conf</filename>, and
|
---|
[514ef84d] | 175 | <filename>~/.antrc</filename></para>
|
---|
| 176 |
|
---|
| 177 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 178 | <primary sortas="e-AA.ant-ant.conf">~/.ant/ant.conf</primary>
|
---|
| 179 | </indexterm>
|
---|
| 180 |
|
---|
| 181 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 182 | <primary sortas="e-AA.antrc">~/.antrc</primary>
|
---|
| 183 | </indexterm>
|
---|
| 184 |
|
---|
| 185 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 186 | <primary sortas="e-etc-ant-ant.conf">/etc/ant/ant.conf</primary>
|
---|
| 187 | </indexterm>
|
---|
| 188 |
|
---|
| 189 | </sect3>
|
---|
| 190 |
|
---|
| 191 | <sect3>
|
---|
| 192 | <title>Configuration Information</title>
|
---|
| 193 |
|
---|
[e549304] | 194 | <para>Some packages will require <command>ant</command> to be in the
|
---|
| 195 | search path and the <envar>$ANT_HOME</envar> environment variable
|
---|
| 196 | defined. Satisfy these requirements by adding the following lines to
|
---|
[539ace5] | 197 | <filename>/etc/profile</filename> or to individual user's
|
---|
[514ef84d] | 198 | <filename>~/.profile</filename> or <filename>~/.bashrc</filename> files:</para>
|
---|
| 199 |
|
---|
| 200 | <screen><literal>export PATH=$PATH:/opt/ant/bin
|
---|
| 201 | export ANT_HOME=/opt/ant</literal></screen>
|
---|
| 202 |
|
---|
| 203 | </sect3>
|
---|
| 204 |
|
---|
| 205 | </sect2>
|
---|
| 206 |
|
---|
| 207 | <sect2 role="content">
|
---|
| 208 | <title>Contents</title>
|
---|
| 209 |
|
---|
| 210 | <segmentedlist>
|
---|
| 211 | <segtitle>Installed Programs</segtitle>
|
---|
| 212 | <segtitle>Installed Libraries</segtitle>
|
---|
| 213 | <segtitle>Installed Directories</segtitle>
|
---|
| 214 |
|
---|
| 215 | <seglistitem>
|
---|
| 216 | <seg>ant, antRun, antRun.pl, complete-ant-cmd.pl, runant.pl, and runant.py</seg>
|
---|
[915403df] | 217 | <seg>ant.jar, ant-*.jar, xercesImpl.jar, and xml-apis.jar</seg>
|
---|
[514ef84d] | 218 | <seg>/etc/ant and /opt/ant-&apache-ant-version;</seg>
|
---|
| 219 | </seglistitem>
|
---|
| 220 | </segmentedlist>
|
---|
| 221 |
|
---|
| 222 | <variablelist>
|
---|
| 223 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 224 | <?dbfo list-presentation="list"?>
|
---|
| 225 | <?dbhtml list-presentation="table"?>
|
---|
| 226 |
|
---|
| 227 | <varlistentry id="ant">
|
---|
| 228 | <term><command>ant</command></term>
|
---|
| 229 | <listitem>
|
---|
[539ace5] | 230 | <para>is a <application>Java</application> based build tool used by
|
---|
[0619e6d] | 231 | many packages instead of the conventional <command>make</command>
|
---|
[514ef84d] | 232 | program.</para>
|
---|
| 233 | <indexterm zone="apache-ant ant">
|
---|
| 234 | <primary sortas="b-ant">ant</primary>
|
---|
| 235 | </indexterm>
|
---|
| 236 | </listitem>
|
---|
| 237 | </varlistentry>
|
---|
| 238 |
|
---|
| 239 | <varlistentry id="antRun">
|
---|
| 240 | <term><command>antRun</command></term>
|
---|
| 241 | <listitem>
|
---|
[0619e6d] | 242 | <para>is a support script used to start <command>ant</command>
|
---|
[514ef84d] | 243 | build scripts in a given directory.</para>
|
---|
| 244 | <indexterm zone="apache-ant antRun">
|
---|
| 245 | <primary sortas="b-antRun">antRun</primary>
|
---|
| 246 | </indexterm>
|
---|
| 247 | </listitem>
|
---|
| 248 | </varlistentry>
|
---|
| 249 |
|
---|
| 250 | <varlistentry id="antRun.pl">
|
---|
| 251 | <term><command>antRun.pl</command></term>
|
---|
| 252 | <listitem>
|
---|
[539ace5] | 253 | <para>is a <application>Perl</application> script that provides
|
---|
[514ef84d] | 254 | similar functionality offered by the <command>antRun</command> script.</para>
|
---|
| 255 | <indexterm zone="apache-ant antRun.pl">
|
---|
| 256 | <primary sortas="b-antRun.pl">antRun.pl</primary>
|
---|
| 257 | </indexterm>
|
---|
| 258 | </listitem>
|
---|
| 259 | </varlistentry>
|
---|
| 260 |
|
---|
| 261 | <varlistentry id="complete-ant-cmd.pl">
|
---|
| 262 | <term><command>complete-ant-cmd.pl</command></term>
|
---|
| 263 | <listitem>
|
---|
[539ace5] | 264 | <para>is a <application>Perl</application> script that allows
|
---|
[0619e6d] | 265 | <application>Bash</application> to complete an <command>ant</command>
|
---|
[514ef84d] | 266 | command-line.</para>
|
---|
| 267 | <indexterm zone="apache-ant complete-ant-cmd.pl">
|
---|
| 268 | <primary sortas="b-complete-ant-cmd.pl">complete-ant-cmd.pl</primary>
|
---|
| 269 | </indexterm>
|
---|
| 270 | </listitem>
|
---|
| 271 | </varlistentry>
|
---|
| 272 |
|
---|
| 273 | <varlistentry id="runant.pl">
|
---|
| 274 | <term><command>runant.pl</command></term>
|
---|
| 275 | <listitem>
|
---|
[539ace5] | 276 | <para>is a <application>Perl</application> wrapper script used to
|
---|
[514ef84d] | 277 | invoke <command>ant</command>.</para>
|
---|
| 278 | <indexterm zone="apache-ant runant.pl">
|
---|
| 279 | <primary sortas="b-runant.pl">runant.pl</primary>
|
---|
| 280 | </indexterm>
|
---|
| 281 | </listitem>
|
---|
| 282 | </varlistentry>
|
---|
| 283 |
|
---|
| 284 | <varlistentry id="runant.py">
|
---|
| 285 | <term><command>runant.py</command></term>
|
---|
| 286 | <listitem>
|
---|
[539ace5] | 287 | <para>is a <application>Python</application> wrapper script used to
|
---|
[514ef84d] | 288 | invoke <command>ant</command>.</para>
|
---|
| 289 | <indexterm zone="apache-ant runant.py">
|
---|
| 290 | <primary sortas="b-runant.py">runant.py</primary>
|
---|
| 291 | </indexterm>
|
---|
| 292 | </listitem>
|
---|
| 293 | </varlistentry>
|
---|
| 294 |
|
---|
| 295 | <varlistentry id="ant-star">
|
---|
| 296 | <term><filename class='libraryfile'>ant-*.jar</filename></term>
|
---|
| 297 | <listitem>
|
---|
[0619e6d] | 298 | <para>files are the <application>Apache Ant</application>
|
---|
[514ef84d] | 299 | <application>Java</application> class libraries.</para>
|
---|
| 300 | <indexterm zone="apache-ant ant-star">
|
---|
| 301 | <primary sortas="c-ant-star">ant-*.jar</primary>
|
---|
| 302 | </indexterm>
|
---|
| 303 | </listitem>
|
---|
| 304 | </varlistentry>
|
---|
| 305 |
|
---|
| 306 | <varlistentry id="xercesImpl">
|
---|
| 307 | <term><filename class='libraryfile'>xercesImpl.jar</filename></term>
|
---|
| 308 | <listitem>
|
---|
[539ace5] | 309 | <para>is a <application>Java</application> class library used by
|
---|
[514ef84d] | 310 | <application>Apache Ant</application> to perform XML parsing.</para>
|
---|
| 311 | <indexterm zone="apache-ant xercesImpl">
|
---|
| 312 | <primary sortas="c-xercesImpl">xercesImpl.jar</primary>
|
---|
| 313 | </indexterm>
|
---|
| 314 | </listitem>
|
---|
| 315 | </varlistentry>
|
---|
| 316 |
|
---|
| 317 | <varlistentry id="xml-apis">
|
---|
| 318 | <term><filename class='libraryfile'>xml-apis.jar</filename></term>
|
---|
| 319 | <listitem>
|
---|
[539ace5] | 320 | <para>contains the DOM <application>Java</application> classes required
|
---|
[514ef84d] | 321 | by the <application>Apache Ant</application> XML formatter.</para>
|
---|
| 322 | <indexterm zone="apache-ant xml-apis">
|
---|
| 323 | <primary sortas="c-xml-apis">xml-apis.jar</primary>
|
---|
| 324 | </indexterm>
|
---|
| 325 | </listitem>
|
---|
| 326 | </varlistentry>
|
---|
| 327 |
|
---|
| 328 | </variablelist>
|
---|
| 329 |
|
---|
| 330 | </sect2>
|
---|
[dd5bdf3] | 331 |
|
---|
| 332 | </sect1>
|
---|