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