[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 |
|
---|
[ac38e9dc] | 7 | <!ENTITY apache-ant-download-http "https://archive.apache.org/dist/ant/source/apache-ant-&apache-ant-version;-src.tar.bz2">
|
---|
[e8edecd] | 8 | <!ENTITY apache-ant-download-ftp " ">
|
---|
[d7bee48] | 9 | <!ENTITY apache-ant-md5sum "6413ed1cee16372d0fa215ffacca48b7">
|
---|
[6dc9fd3] | 10 | <!ENTITY apache-ant-size "3.6 MB">
|
---|
[2037ec4] | 11 | <!ENTITY apache-ant-buildsize "113 MB">
|
---|
[6dc9fd3] | 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
|
---|
[ac38e9dc] | 33 | <application>Java</application>-based build tool. In theory, it is
|
---|
| 34 | like the <command>make</command> command, but without <command>make</command>'s
|
---|
[e549304] | 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 |
|
---|
[2037ec4] | 42 | &lfs78_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
|
---|
[602332ff] | 71 | url="&sources-anduin-http;/other/junit-&junit-version;.jar">
|
---|
| 72 | &sources-anduin-http;/other/junit-&junit-version;.jar</ulink>
|
---|
[6dc9fd3] | 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 | </itemizedlist>
|
---|
| 83 |
|
---|
[514ef84d] | 84 | <bridgehead renderas="sect3">Apache Ant Dependencies</bridgehead>
|
---|
| 85 |
|
---|
| 86 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[ff53809] | 87 | <para role="required">
|
---|
[4e047ca4] | 88 | A JDK (<xref linkend="java-bin"/> or <xref linkend="openjdk"/>) and
|
---|
| 89 | <xref linkend="glib2"/>
|
---|
[ff53809] | 90 | </para>
|
---|
[66ab31e] | 91 |
|
---|
[6dc9fd3] | 92 | <!-- <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
[ff53809] | 93 | <para role="recommended">
|
---|
| 94 | <xref linkend="junit"/>
|
---|
| 95 | </para>
|
---|
[6dc9fd3] | 96 | -->
|
---|
[1039de3] | 97 | <para condition="html" role="usernotes">User Notes:
|
---|
| 98 | <ulink url="&blfs-wiki;/apache-ant"/></para>
|
---|
| 99 |
|
---|
[514ef84d] | 100 | </sect2>
|
---|
| 101 |
|
---|
| 102 | <sect2 role="installation">
|
---|
| 103 | <title>Installation of Apache Ant</title>
|
---|
| 104 |
|
---|
| 105 | <note>
|
---|
[919683dc] | 106 | <para>You may need additional libraries to satisfy the build
|
---|
[539ace5] | 107 | requirements of various packages installed using
|
---|
| 108 | <application>Apache Ant</application>. Review the table at
|
---|
[0619e6d] | 109 | <ulink url="http://ant.apache.org/manual/install.html#librarydependencies"/>
|
---|
[2037ec4] | 110 | for any prerequisite libraries you may need. Place any needed libraries
|
---|
[debb88bf] | 111 | in <filename>lib/optional</filename>.</para>
|
---|
[514ef84d] | 112 | </note>
|
---|
| 113 |
|
---|
[6dc9fd3] | 114 | <!-- <para>If it is not possible to install the recommended
|
---|
[d414190] | 115 | <application>JUnit</application> package, install
|
---|
| 116 | <application>Apache Ant</application> by removing the reference to the test
|
---|
| 117 | instructions (note that the tests will not be performed):</para>
|
---|
[66ab31e] | 118 |
|
---|
[debb88bf] | 119 | <screen><userinput>sed -i 's/jars,test-jar/jars/' build.xml</userinput></screen>
|
---|
[6dc9fd3] | 120 | -->
|
---|
| 121 | <para>Unpack and copy the <application>junit</application> and
|
---|
| 122 | <application>hamcrest</application> jar files to the
|
---|
[e8edecd] | 123 | local directory tree.</para>
|
---|
| 124 |
|
---|
[6dc9fd3] | 125 | <screen><userinput>tar -xvf ../hamcrest-&hamcrest-version;.tgz &&
|
---|
| 126 | cp -v ../junit-&junit-version;.jar \
|
---|
| 127 | hamcrest-&hamcrest-version;/hamcrest-core-&hamcrest-version;.jar lib/optional</userinput></screen>
|
---|
| 128 |
|
---|
[539ace5] | 129 | <para>Install <application>Apache Ant</application> by running the following
|
---|
[514ef84d] | 130 | commands:</para>
|
---|
| 131 |
|
---|
[d414190] | 132 | <para>The unit regression tests are performed during the build step below
|
---|
| 133 | unless <application>JUnit</application> is not installed. Now, as the
|
---|
| 134 | <systemitem class="username">root</systemitem> user:</para>
|
---|
[514ef84d] | 135 |
|
---|
| 136 | <screen role="root"><userinput>./build.sh -Ddist.dir=/opt/ant-&apache-ant-version; dist &&
|
---|
[2037ec4] | 137 | ln -v -sfn ant-&apache-ant-version; /opt/ant</userinput></screen>
|
---|
[514ef84d] | 138 |
|
---|
[ac38e9dc] | 139 | <note><para>Make sure the JAVA_HOME environment variable is set for the
|
---|
| 140 | <systemitem class="username">root</systemitem> user.</para></note>
|
---|
[6dc9fd3] | 141 |
|
---|
[514ef84d] | 142 | </sect2>
|
---|
| 143 |
|
---|
| 144 | <sect2 role="commands">
|
---|
| 145 | <title>Command Explanations</title>
|
---|
| 146 |
|
---|
[6dc9fd3] | 147 | <para><command>cp -v ... lib/optional</command>:
|
---|
| 148 | This command copies the JUnit and hamcrest jar files into the directory where
|
---|
[2037ec4] | 149 | Apache Ant will look for them.</para>
|
---|
[9b9be0d] | 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 |
|
---|
[2037ec4] | 156 | <para><command>ln -v -sfn ant-&apache-ant-version; /opt/ant</command>: This
|
---|
[514ef84d] | 157 | command is optional, and creates a convenience symlink.</para>
|
---|
| 158 |
|
---|
| 159 | </sect2>
|
---|
| 160 |
|
---|
| 161 | <sect2 role="configuration">
|
---|
| 162 | <title>Configuring Apache Ant</title>
|
---|
| 163 |
|
---|
| 164 | <sect3 id="apache-ant-config">
|
---|
[30edc031] | 165 | <title>Config Files</title>
|
---|
[514ef84d] | 166 |
|
---|
[539ace5] | 167 | <para><filename>/etc/ant/ant.conf</filename>,
|
---|
| 168 | <filename>~/.ant/ant.conf</filename>, and
|
---|
[514ef84d] | 169 | <filename>~/.antrc</filename></para>
|
---|
| 170 |
|
---|
| 171 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 172 | <primary sortas="e-AA.ant-ant.conf">~/.ant/ant.conf</primary>
|
---|
| 173 | </indexterm>
|
---|
| 174 |
|
---|
| 175 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 176 | <primary sortas="e-AA.antrc">~/.antrc</primary>
|
---|
| 177 | </indexterm>
|
---|
| 178 |
|
---|
| 179 | <indexterm zone="apache-ant apache-ant-config">
|
---|
| 180 | <primary sortas="e-etc-ant-ant.conf">/etc/ant/ant.conf</primary>
|
---|
| 181 | </indexterm>
|
---|
| 182 |
|
---|
| 183 | </sect3>
|
---|
| 184 |
|
---|
| 185 | <sect3>
|
---|
| 186 | <title>Configuration Information</title>
|
---|
| 187 |
|
---|
[e549304] | 188 | <para>Some packages will require <command>ant</command> to be in the
|
---|
[ac38e9dc] | 189 | search path and the <envar>ANT_HOME</envar> environment variable
|
---|
| 190 | defined. Satisfy these requirements by issuing, as the <systemitem
|
---|
| 191 | class="username">root</systemitem> user:</para>
|
---|
| 192 |
|
---|
| 193 | <screen role="root"><userinput>cat >> /etc/profile.d/extrapaths.sh << EOF
|
---|
[2037ec4] | 194 | <literal>
|
---|
| 195 | # Begin Apache-ant addition
|
---|
[ac38e9dc] | 196 |
|
---|
| 197 | pathappend /opt/ant/bin
|
---|
| 198 | export ANT_HOME=/opt/ant
|
---|
| 199 |
|
---|
[2037ec4] | 200 | # End Apache-ant addition
|
---|
| 201 | </literal>
|
---|
[ac38e9dc] | 202 | EOF</userinput></screen>
|
---|
[514ef84d] | 203 |
|
---|
[ac38e9dc] | 204 | <para>The above instrutions assume you have configured your system as
|
---|
| 205 | described in <xref linkend="postlfs-config-profile"/>.</para>
|
---|
[514ef84d] | 206 |
|
---|
| 207 | </sect3>
|
---|
| 208 |
|
---|
| 209 | </sect2>
|
---|
| 210 |
|
---|
| 211 | <sect2 role="content">
|
---|
| 212 | <title>Contents</title>
|
---|
| 213 |
|
---|
| 214 | <segmentedlist>
|
---|
| 215 | <segtitle>Installed Programs</segtitle>
|
---|
| 216 | <segtitle>Installed Libraries</segtitle>
|
---|
| 217 | <segtitle>Installed Directories</segtitle>
|
---|
| 218 |
|
---|
| 219 | <seglistitem>
|
---|
| 220 | <seg>ant, antRun, antRun.pl, complete-ant-cmd.pl, runant.pl, and runant.py</seg>
|
---|
[e8edecd] | 221 | <seg>ant*.jar</seg>
|
---|
| 222 | <seg>/opt/ant-&apache-ant-version;</seg>
|
---|
[514ef84d] | 223 | </seglistitem>
|
---|
| 224 | </segmentedlist>
|
---|
| 225 |
|
---|
| 226 | <variablelist>
|
---|
| 227 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 228 | <?dbfo list-presentation="list"?>
|
---|
| 229 | <?dbhtml list-presentation="table"?>
|
---|
| 230 |
|
---|
| 231 | <varlistentry id="ant">
|
---|
| 232 | <term><command>ant</command></term>
|
---|
| 233 | <listitem>
|
---|
[539ace5] | 234 | <para>is a <application>Java</application> based build tool used by
|
---|
[0619e6d] | 235 | many packages instead of the conventional <command>make</command>
|
---|
[514ef84d] | 236 | program.</para>
|
---|
| 237 | <indexterm zone="apache-ant ant">
|
---|
| 238 | <primary sortas="b-ant">ant</primary>
|
---|
| 239 | </indexterm>
|
---|
| 240 | </listitem>
|
---|
| 241 | </varlistentry>
|
---|
| 242 |
|
---|
| 243 | <varlistentry id="antRun">
|
---|
| 244 | <term><command>antRun</command></term>
|
---|
| 245 | <listitem>
|
---|
[0619e6d] | 246 | <para>is a support script used to start <command>ant</command>
|
---|
[514ef84d] | 247 | build scripts in a given directory.</para>
|
---|
| 248 | <indexterm zone="apache-ant antRun">
|
---|
| 249 | <primary sortas="b-antRun">antRun</primary>
|
---|
| 250 | </indexterm>
|
---|
| 251 | </listitem>
|
---|
| 252 | </varlistentry>
|
---|
| 253 |
|
---|
| 254 | <varlistentry id="antRun.pl">
|
---|
| 255 | <term><command>antRun.pl</command></term>
|
---|
| 256 | <listitem>
|
---|
[539ace5] | 257 | <para>is a <application>Perl</application> script that provides
|
---|
[514ef84d] | 258 | similar functionality offered by the <command>antRun</command> script.</para>
|
---|
| 259 | <indexterm zone="apache-ant antRun.pl">
|
---|
| 260 | <primary sortas="b-antRun.pl">antRun.pl</primary>
|
---|
| 261 | </indexterm>
|
---|
| 262 | </listitem>
|
---|
| 263 | </varlistentry>
|
---|
| 264 |
|
---|
| 265 | <varlistentry id="complete-ant-cmd.pl">
|
---|
| 266 | <term><command>complete-ant-cmd.pl</command></term>
|
---|
| 267 | <listitem>
|
---|
[539ace5] | 268 | <para>is a <application>Perl</application> script that allows
|
---|
[0619e6d] | 269 | <application>Bash</application> to complete an <command>ant</command>
|
---|
[514ef84d] | 270 | command-line.</para>
|
---|
| 271 | <indexterm zone="apache-ant complete-ant-cmd.pl">
|
---|
| 272 | <primary sortas="b-complete-ant-cmd.pl">complete-ant-cmd.pl</primary>
|
---|
| 273 | </indexterm>
|
---|
| 274 | </listitem>
|
---|
| 275 | </varlistentry>
|
---|
| 276 |
|
---|
| 277 | <varlistentry id="runant.pl">
|
---|
| 278 | <term><command>runant.pl</command></term>
|
---|
| 279 | <listitem>
|
---|
[539ace5] | 280 | <para>is a <application>Perl</application> wrapper script used to
|
---|
[514ef84d] | 281 | invoke <command>ant</command>.</para>
|
---|
| 282 | <indexterm zone="apache-ant runant.pl">
|
---|
| 283 | <primary sortas="b-runant.pl">runant.pl</primary>
|
---|
| 284 | </indexterm>
|
---|
| 285 | </listitem>
|
---|
| 286 | </varlistentry>
|
---|
| 287 |
|
---|
| 288 | <varlistentry id="runant.py">
|
---|
| 289 | <term><command>runant.py</command></term>
|
---|
| 290 | <listitem>
|
---|
[539ace5] | 291 | <para>is a <application>Python</application> wrapper script used to
|
---|
[514ef84d] | 292 | invoke <command>ant</command>.</para>
|
---|
| 293 | <indexterm zone="apache-ant runant.py">
|
---|
| 294 | <primary sortas="b-runant.py">runant.py</primary>
|
---|
| 295 | </indexterm>
|
---|
| 296 | </listitem>
|
---|
| 297 | </varlistentry>
|
---|
| 298 |
|
---|
| 299 | <varlistentry id="ant-star">
|
---|
[e8edecd] | 300 | <term><filename class='libraryfile'>ant*.jar</filename></term>
|
---|
[514ef84d] | 301 | <listitem>
|
---|
[0619e6d] | 302 | <para>files are the <application>Apache Ant</application>
|
---|
[514ef84d] | 303 | <application>Java</application> class libraries.</para>
|
---|
| 304 | <indexterm zone="apache-ant ant-star">
|
---|
| 305 | <primary sortas="c-ant-star">ant-*.jar</primary>
|
---|
| 306 | </indexterm>
|
---|
| 307 | </listitem>
|
---|
| 308 | </varlistentry>
|
---|
| 309 |
|
---|
| 310 | </variablelist>
|
---|
| 311 |
|
---|
| 312 | </sect2>
|
---|
[dd5bdf3] | 313 |
|
---|
| 314 | </sect1>
|
---|