Michael,
You are right what you see is nasty ;) however I deliberately inlined
the code for clarity.
In practice I actually abstract most of it into helper classes which
is really
easy to do and you can mostly get away with code like this:
new UntarTask(src, dest).execute(); // execute single statement
new AntTarget(task1, task2, task3).execute(); // execute multiple
targets
Anyone is free to take a look at some of my code here
http://code.google.com/p/protoj/source/browse/#svn/
2.0.0/src/java/protoj/lang/ant
to get a head start on this, although if you copy it too closely be
aware of the apache
open source license
***
From my personal experience I've always found it to be the case that
it's only a matter
of time before the build code not only requires logic, but also needs
to be accessible
from the application - strange as that may sound. Unifying the
codebase in that way
lets you do the simple, such as display the dependencies in the
application about
box to the complex such as easily toggle aspectj load time weaving.
Yes extensions such as contrib can sort of help with this but IMHO
when you go too far
down this road you are admitting that the (xml) ant DSL is no longer a
good match
for your project. And until recently there hasn't been anywhere to
turn to for such
projects.
- Ashley
On 12 Jun 2009, at 00:42, Michael Ludwig wrote:
> Ashley Williams schrieb am 11.06.2009 um 17:51:45 (+0100):
>>
>> // create the ant parent project
>> Project project = new Project();
>> project.setName("project");
>> project.init();
>>
>> // create the child target
>> Target target = new Target();
>> target.setName("target");
>> project.addTarget(target);
>> project.addBuildListener(new Log4jListener());
>
> The Ant XML isn't exactly compact and doesn't flow like, say, Python
> or Perl; but painstakingly recreating the XML structure from the API
> is even harder for the eyeball.
>
> But of course, this usage may have its places and applications.
>
> Michael Ludwig
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
user-unsubscribe@...
> For additional commands, e-mail:
user-help@...
>
---------------------------------------------------------------------
To unsubscribe, e-mail:
user-unsubscribe@...
For additional commands, e-mail:
user-help@...