Much ado about scripting, Linux & Eclipse: card subject to change


HOWTO: Build a XulRunner Update Site with Tycho 0.8 + Maven 3

0. Install Maven 3 by downloading then unpacking the tar.gz:

cd /tmp; \
wget; \
tar xvzf apache-maven-3.0-alpha-7-bin.tar.gz; \
chmod 755 apache-maven-3.0-alpha-7/bin/mvn; \
alias mvn3='/tmp/apache-maven-3.0-alpha-7/bin/mvn'

1. Check out sources:

cd /tmp; \
svn co; \

2. Run build:

cd xulrunner; mvn3 -fae clean install

3. You will get a p2 repo / update site in the target folder of the site project, from which you can install XulRunner or XPCOM into your Eclipse.

cd site/

Note that the parent-pom.xml used above can in fact be much simpler. You only need the following:
<?xml version="1.0" encoding="UTF-8"?>
  <name>JBoss Tools Parent</name>



Better Bootstrapping For Athena Projects

Inspired by Tycho and Maven, I've simplified the self-bootstrapping process for Athena builds.

Previously, you needed a script to fetch org.eclipse.releng.basebuilder and org.eclipse.dash.common.releng before you could run a build; if on this is done for you automatically. Or, if building locally (or on Windows), you had to fetch these yourself.

Now, you can simply tell your build.xml to bootstrap itself, and it will fetch those projects for you. You can also tell it which version of basebuilder or common.releng to use, rather than being tied to the defaults.

For details, see Getting Started - Bootstrapping.


Cleaner Ant Build Logs: Get Rid of "Trying to override old definition of task"

If you use macros in Ant, you have probably seen clutter in your log such as

Trying to override old definition of task ...

Here's how to purge this garbage from your log and keep your build output cleaner.

  1. move your macros into a target such as <target name="init">
  2. have your main target(s) depend on the target that defines the macros
  3. call your macros

You can make your log even quieter with -q when running ant, eg., ant -f build.xml -q

Here's a complete example that will first self-bootstrap itself by downloading Ant-Contrib, define two ant macros, and produce very quiet output (unless debug=true):

<project default="run">
 <property name="COMMON_TOOLS" value="${}" />
 <property name="debug" value="false"/>

 <target name="get.ant-contrib" unless="ant-contrib.jar.exists">
  <property name="ANTCONTRIB_MIRROR" value="" />
  <get usetimestamp="true"
  <touch file="${COMMON_TOOLS}/" />
  <mkdir dir="${}/ant-contrib-1.0b2-bin.zip_" />
  <unzip src="${COMMON_TOOLS}/"
  <copy file="${}/ant-contrib-1.0b2-bin.zip_/ant-contrib/lib/ant-contrib.jar"
  <delete dir="${}/ant-contrib-1.0b2-bin.zip_" includeemptydirs="true" quiet="true" />

 <target name="init">
  <available file="${COMMON_TOOLS}/ant-contrib.jar" type="file" property="ant-contrib.jar.exists" />
  <antcall target="get.ant-contrib" />

  <taskdef resource="net/sf/antcontrib/antlib.xml">
    <pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
  <macrodef name="debug">
   <text name="echo" />
      <isset property="debug" />
      <istrue value="${debug}" />
      <echo message="@{echo}" />

  <macrodef name="list.count">
   <attribute name="list" default="" />
    <var name="count" value="" />
    <for param="listitem" list="@{list}" delimiter=", ">
      <var name="count" value="${count}0" />
    <length property="list.count.return" string="${count}" />

 <target name="run" depends="init">
  <property name="list" value="foo bar baz"/>
  <list.count list="${list}" />
  <debug>For list [${list}], size = </debug>