<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ant on ShrimpWorks</title><link>/tags/ant/</link><description>Recent content in Ant on ShrimpWorks</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Fri, 18 Sep 2015 08:24:28 +0000</lastBuildDate><atom:link href="/tags/ant/feed.xml" rel="self" type="application/rss+xml"/><item><title>Introduction to Ant Part 4: Unit Tests with JUnit</title><link>/2015/09/18/introduction-to-ant-part-4-unit-tests-with-junit/</link><pubDate>Fri, 18 Sep 2015 08:24:28 +0000</pubDate><guid>/2015/09/18/introduction-to-ant-part-4-unit-tests-with-junit/</guid><description>&lt;p&gt;



 
 &lt;img src="/2015/09/18/introduction-to-ant-part-4-unit-tests-with-junit/2015-09-18-ant.png" class="image-left" /&gt;
 

Now that we have &lt;a href="/2015/08/07/introduction-to-ant-part-3-dependency-management-with-ivy/"&gt;dependency management with
Ivy&lt;/a&gt;
working along with everything else covered before, we&amp;rsquo;ve covered almost
everything required to start building &lt;em&gt;real&lt;/em&gt; projects with Ant.&lt;/p&gt;
&lt;p&gt;Another thing any &lt;em&gt;real&lt;/em&gt; project should have, is unit tests. Thankfully,
using the scaffolding already put in place in earlier parts of this
series, integrating a &lt;a href="http://junit.org/"&gt;JUnit&lt;/a&gt; testing task into our
existing build script is really straight-forward.&lt;/p&gt;</description></item><item><title>Introduction to Ant Part 3: Dependency Management with Ivy</title><link>/2015/08/07/introduction-to-ant-part-3-dependency-management-with-ivy/</link><pubDate>Fri, 07 Aug 2015 10:20:45 +0000</pubDate><guid>/2015/08/07/introduction-to-ant-part-3-dependency-management-with-ivy/</guid><description>&lt;p&gt;



 
 &lt;img src="/2015/08/07/introduction-to-ant-part-3-dependency-management-with-ivy/2015-08-07-ant.png" class="image-left" /&gt;
 


So far, we&amp;rsquo;ve covered the basics of &lt;a href="/2015/07/07/introduction-to-ant-part-1-a-basic-build/"&gt;creating
a re-distributable &lt;code&gt;.jar&lt;/code&gt;
package&lt;/a&gt;
suitable for use as a library, and &lt;a href="/2015/07/11/introduction-to-ant-part-2-runnable-jar-file/"&gt;building a Jar file which can be
run&lt;/a&gt;
by a user or server process.&lt;/p&gt;
&lt;p&gt;A major part of any non-trivial application these days is the inclusion
and re-use of 3rd party libraries which implement functionality your
applications require. When a project starts, it&amp;rsquo;s probably easy enough
to manually drop the odd &lt;code&gt;jar&lt;/code&gt; library into a &lt;code&gt;lib&lt;/code&gt; directory and forget
about it, but maintaining a large application which depends on many
libraries, which in turn depend on additional libraries for their own
functionality, it can quickly turn into a nightmare to manage.&lt;/p&gt;
&lt;p&gt;To solve this problem, many dependency management tools have been
introduced, most notably, &lt;a href="https://maven.apache.org/"&gt;Apache Maven&lt;/a&gt;.
Maven however, is so much more than just a dependency management tool,
and is actually intended to manage your entire project structure. I
believe however, the combination of Ant and Ivy provides far more
flexibility, extensibility and control over your build and dependency
management processes.&lt;/p&gt;
&lt;p&gt;So, let&amp;rsquo;s integrate &lt;a href="https://ant.apache.org/ivy/"&gt;Apache Ivy&lt;/a&gt; into our
Ant script as we left it in &lt;a href="/2015/07/11/introduction-to-ant-part-2-runnable-jar-file/"&gt;part
2&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Introduction to Ant Part 2: Runnable Jar File</title><link>/2015/07/11/introduction-to-ant-part-2-runnable-jar-file/</link><pubDate>Sat, 11 Jul 2015 10:26:27 +0000</pubDate><guid>/2015/07/11/introduction-to-ant-part-2-runnable-jar-file/</guid><description>&lt;p&gt;



 
 &lt;img src="/2015/07/11/introduction-to-ant-part-2-runnable-jar-file/2015-07-11-ant.png" class="image-left" /&gt;
 


In part 1, we went over the basics of &lt;a href="/2015/07/07/introduction-to-ant-part-1-a-basic-build/"&gt;using
Ant to create a redistributable &lt;code&gt;.jar&lt;/code&gt;
file&lt;/a&gt;,
suitable for use as a library in other projects. A lot of the time
however, you&amp;rsquo;re probably going to want to be building things which can
actually be &lt;em&gt;run&lt;/em&gt; as regular Java applications.&lt;/p&gt;
&lt;p&gt;Once again, the &lt;a href="https://github.com/shrimpza/ant-tutorial/tree/master/part02"&gt;code for this tutorial is available in
GitHub&lt;/a&gt;.
More usefully, you may want to see the &lt;a href="https://github.com/shrimpza/ant-tutorial/commit/7425d635cfc68444e1abbc4b16ddf2ccb83337f0"&gt;diff between the part 1 script
and the new
one&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a quick explanation of what we&amp;rsquo;ve done to achieve an executable
jar file:&lt;/p&gt;</description></item><item><title>Introduction to Ant Part 1: A Basic Build</title><link>/2015/07/07/introduction-to-ant-part-1-a-basic-build/</link><pubDate>Tue, 07 Jul 2015 21:01:04 +0000</pubDate><guid>/2015/07/07/introduction-to-ant-part-1-a-basic-build/</guid><description>&lt;p&gt;



 
 &lt;img src="/2015/07/07/introduction-to-ant-part-1-a-basic-build/2015-07-07-ant.png" class="image-left" /&gt;
 


&lt;a href="https://ant.apache.org/"&gt;Apache Ant&lt;/a&gt; is a
general-purpose build tool, primarily used for the building of Java
applications, but it is flexible enough to be used for various tasks.&lt;/p&gt;
&lt;p&gt;In the Java world at least, Ant seems to be largely passed over for the
immediate convenience and IDE support of Maven, however long term, I
believe a good set of Ant scripts offer far more flexibility and room
for tweaking your build processes. The downside is that there&amp;rsquo;s a lot of
stuff you need to learn and figure out and build by hand.&lt;/p&gt;
&lt;p&gt;In this series of tutorials, I&amp;rsquo;ll try to document the process of
learning I&amp;rsquo;ve gone through building and maintaining Ant build files,
from the most basic of &amp;ldquo;just compile my stuff&amp;rdquo; steps to automatic
generation of JavaDoc output, dependency management using Ant&amp;rsquo;s
companion, &lt;a href="https://ant.apache.org/ivy/"&gt;Ivy&lt;/a&gt;, unit testing using
&lt;a href="http://junit.org/"&gt;JUnit&lt;/a&gt;, and integrating with some additional tools
I&amp;rsquo;ve been using, such as
&lt;a href="http://checkstyle.sourceforge.net/"&gt;Checkstyle&lt;/a&gt; and
&lt;a href="http://findbugs.sourceforge.net/"&gt;FindBugs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For part 1 of this tutorial, I&amp;rsquo;ve created a simple Hello World library.
It doesn&amp;rsquo;t have a main executable itself, the goal of this is to produce
a &lt;code&gt;.jar&lt;/code&gt; file we can include in other projects, to start our Ant script
off fairly simply.&lt;/p&gt;
&lt;p&gt;The source for this project can be &lt;a href="https://github.com/shrimpza/ant-tutorial/tree/master/part01"&gt;found in
GitHub&lt;/a&gt;.
Here&amp;rsquo;s the breakdown of everything going on in this project:&lt;/p&gt;</description></item></channel></rss>