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