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