ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: help writing a custom task
Date Mon, 01 Oct 2001 07:19:27 GMT
On Fri, 28 Sep 2001, Joe Toussaint <jdtoussai@visi.com> wrote:

> however now ant is complaining saying 'The <httptest> task doesn't
> support the nested "file" element.' I assume somewhere I need to
> specify which nested elements my task can have - where?

Take a look at the "Developing with Ant section" in the manual.  If
your nested <file> element is supposed to be implemented by a class
Ernie, you need to implement one of the three following methods in
your task:

(1) public Ernie createFile()

(2) public void addFile(Ernie anErnie)

(3) public void addConfiguredFile(Ernie anErnie)

(1) places the burden of creating the Ernie instance on the task,
while (2) will pass a new instance from the outside (this means that
Ernie needs a public no-arg constructor for Ant to work).  (3) is
similar to (2) but the setXYZ methods of the Ernie instance have been
called with values taken from the attributes before it gets passed to
your task.

Stefan

Mime
View raw message