Posts tagged as:

ant

Ant 1.8.0 released

February 10, 2010

The Apache Ant team just announced Ant 1.8.0.  The most stunning change is that of lexically scoped local properties.  Now, you can keep a property scoped to a target, or a sequential block.  Hopefully this will mean poeple rely less on ant-contrib.   Many people appear to misunderstand the Ant properties mechanism; maybe they are [...]

Read the full article →

Ant Contrib: the power and the pain

September 21, 2009

I got a comment from Errno on my last post:
“Everyone agrees that Ant Contrib means you’ve done something wrong.” why? is there any blog post/write-up describing this? thanks

I don’t know of any write-up. So I’ll make one. There’s a reason why some tasks are in ant-contrib and not the Ant tool proper: they don’t really [...]

Read the full article →

Better Apache Ant Builds

September 20, 2009

Abstract: We did two CITCON sessions here; Joe Schmetzer suggested a show-and-tell about tools to reduce Ant bloat, and Ivan Moore wanted a general session on improving the quality of Java builds in general. During the conference, the two sessions merged. My plan was to sit in and tweet [...]

Read the full article →

Apache Ant script reuse

June 10, 2009

The Maven guys have got one thing (and others, I’m not being mean) right – we reinvent the wheel too much on Java projects.
Joe Schmetzer has an Ant Script Library. And Pascal here has had a crack at the problem of Ant Script reuse.
Seems a bit 2002-esque to write an Ant build from scratch these [...]

Read the full article →

Build Refactoring: Delete Boolean Property

December 19, 2008
Thumbnail image for Build Refactoring: Delete Boolean Property

(image taken from Kurtis Scaletta’s photostream)
Last time, you read about the extract target refactoring. Today, I’m going to show you one that I love to perform: delete boolean property. Have a look the smell first:

<project default="unit_tests">

<property name="junit.enabled" value="true" />

<target name="-check_junit_enabled">
<condition property="junit.really.enabled">
<and>
<equals [...]

Read the full article →

Build Refactoring: Extract Target

December 9, 2008

Your build files probably need some TLC. Sorry. It’s true. If you’re lucky enough to work on a project with clean code (and let’s face it, most codebases aren’t too pretty), then you’re even luckier to have a nice clean build. Wait! Don’t go getting upset, I can help you.

I’ll [...]

Read the full article →

The Build Rosetta Stone

November 19, 2008
Thumbnail image for The Build Rosetta Stone

Update: I had some nice feedback from @jtf @nasrat and @cread, so I have pushed the source files to a git repository.
What’s the equivalent command to [some command in your usual build tool] in [some build tool that you're using now]? I found myself asking that question too often earlier this year, so I [...]

Read the full article →

All build tools began with Make

August 28, 2008

(image taken from slashcrisis’ photostream)

Today I’m just going to share a pet hate: poor target names in build files. Yes, that’s scratching the surface: there’s plenty of other things to get wrong in your build. But today’s gripe is target names. Here’s an anonymised example from a real project:

<?xml version=”1.0″ ?><project name=”project” default=”tests” basedir=”..”>

<target [...]

Read the full article →

Oh lord, It’s hard to parse build files

August 27, 2008

Nat Pryce left a comment on my post A real BuildRefactoring, in the wild:

IntelliJ can do some simple refactorings of Ant scripts: extractproperty, rename target, rename property, etc.
But refactoring of Ant and Nant is very difficult because they have noconsistent syntax or semantics. They are just quick hacks that havegrown kludge by kludge into inconsistent [...]

Read the full article →

Ant Best Practices: Avoid platform specific wrapper scripts

August 5, 2008

(image taken from SideLong’s photostream)
Welcome to the final Ant Best Practices post. The last topic of the series is wrapper scripts. Most projects end up having one or more of these. The very first Java project that I did had about a dozen of them. They generally look like this:
#!/bin/sh/usr/bin/ant -f myGreatProject.xml [...]

Read the full article →