ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dawid Weiss <Dawid.We...@cs.put.poznan.pl>
Subject Re[4]: Embedded dynamic ANT tasks.
Date Tue, 10 Jun 2003 07:09:03 GMT


Thanks Conor,

Your  approach is indeed quite similar to mine... although it seems most of
the discussion resulting from Mutant has been already addressed in my code:

1. could the scripted task be a real ant Task.

In  my  solution  the  tasks  ARE real classes (they could even extend Task
class, if they wanted to ;). If you started ANT with the custom BSH loader,
you  could  simply  use <taskdef> and it would work without any complaining
(beanshell scripts are read/ searched through classpath etc just as regular
Java  classes).  I added a custom bshtaskdef task because most people don't
want to mess with starting ANT using classloader other than the default. So
bshtaskdef  has  to  create its own classloader and then it behaves just as
taskdef  (in  fact,  most  of  the  code  I  grabbed  from the existing ANT
codebase).

2. do not declare setters for each attrib. instead do sth similar to:

function attributes() {
        return ({ "test" });
}

This could be done SO easily by simply adding automatic setters/getters for
each  field  of  the  script.  I  have actually been thinking about it, but
lacked the time to implement it.


Of course your  code  also has some neat features which I don't think are possible in
mine (like nested filesets etc).

Anyway, it is great to hear your motivation was pretty much like mine:

CM> My motivation was to make scripted tasks somewhat similar to a real task, as would
be \
CM> written in Java, particularly when using Rhino. I thought that would make it useful
\
CM> for quickly prototyping a task for later development in Java and also to introduce
\
CM> people to task development.


Thanks for the pointer to Mutant.

Dawid


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message