Spencer,

One possibility:

Start with a <java> task and see what information you need to pass into the
app. This will give you a better idea of what shape any task you end up
writing needs to take. If there is a lot of boiler plate stuff that is
needed for which you can provide reasonable defaults in a task, then that
would be useful as it gives the task user a "smaller" interface to deal
with. If they need to control those things, that would still be possible.
Some of the tasks I have written end up using the Java task internally
(although I am going to change that) anyway. They are really just a facade
on that.

If you need to commonly perform other things when you run the server
(copying in files, checking configs are the latest), you could than add
those into the task.

My tips for writing such a task would be to carefully consider classpath
issues. Are you going to assume the classpath used when launching Ant is
sufficient for running your server. If not, who are you going to use that
classpath. Will the task run within Ant's VM or its own?

Conor


> -----Original Message-----
> From: Spencer Marks [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 22 March 2001 1:58 PM
> To: [EMAIL PROTECTED]
> Subject: Should I write a taskdef?
>
>
> Hi,
>
> I'd like to use Ant to start Resin, an Application server similar
> to Tomcat. I'll set it up so each developer can start up their
> own instance
> on a specific port of the server. I plan on using per user property
> files for some of the specific settings.
>
> There are a couple of approaches I was considering. I could call
> exec and run a shell
> script. I don't like that idea, because I think exec is best to be avoided
> in order to get the cross platform benefits of a tool like Ant.
>
> The Java command might suffice, but I was thinking a TaskDef would be
> more eloquent and reusable by others.
>
> What do others think of this problem and possible solutions. Any
> suggestions would be welcome.
>
> Also, any pointers for getting started writing a TaskDef
> would be appreciated. I've read the JavaDoc and looked at the source,
> but was hoping for some additional guidelines or documentation for
> writing them.
>
> S.
>

Reply via email to