ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: ProjectHelper.configureProject()
Date Thu, 30 May 2002 18:14:45 GMT
On Thu, 30 May 2002, Wannheden, Knut wrote:

> I have been working on a custom ProjectHelper for a little while now.  It
> doesn't do anything fancy, it just makes sure the buildfile supplied to it
> exists and is up-to-date with respect to some other files.  If it isn't, it
> is updated and then processed by Ant's default ProjectHelperImpl.  I could
> have solved this differently, but it seemed most convenient and the clean to
> do it like this.
> I notied that the ProjectHelper interface (or actually class) has a parse()
> method which takes an Object as a parameter to parse the Project from.  I
> guess this is intended for future use, because it's called by the
> configureProject() method, which gets a File as input to configure the
> Project from.
> Also I was wondering why it isn't entirely up to the ProjectHelper to create
> the Project instance.  The way it is now it wouldn't be possible to create a
> Project subclass and use that instead, because several classes in Ant create
> instances of it directly.  Maybe a ProjectFactory would be useful here?

Having ProjectHelper create a Project instance was in the original 
proposal for ProjectHelper. I don't remember the exact reason for droping 
it. You can use a custom Project impl if you replace the 'main' or 
embed ant in your application.

The Object param is intended to allow non-file sources ( like InputSource
or URL or a DOM or whatever else your ProjectHelper wants to use ). The 
intention is to allow programs embedding ant to generate the build instructions
on the fly, without writing to a file. 

( for example there is work to remove the jasper's javac code and use 
ant's javac task. Probably it'll use the task directly for now, but
in future it may do more advanced things ).

Adding the hook to allow ProjectHelper create Project is easy and 
shouldn't break anything - but we are very late in the release cycle
for 1.5, so probably it won't happen, but it would be good if 
we could convince other commiters to add it in 1.6.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message