ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Murdoch <adammurd...@apache.org>
Subject Re: Object oriented builds [was Mutant Documentation]
Date Sun, 23 Jun 2002 04:45:17 GMT
On Sun, 23 Jun 2002 13:45, Erik Hatcher wrote:

> Does the object-oriented nature of this include being able to "extend"
> tasks or projects?  I'm thinking at the API level now, not the XML
> representation. What I'd like to do is create a StandardJavaProject project
> which does all the basic stuff like init, clean, compile, jar, and javadoc.
>  In slightly more advanced projects, I might want to use a XDocletProject,
> where all stays the same except a new "gensrc" target is added and the
> compile target is modified to depend on it and add the generated source
> directory to the compile and javadoc stage.  Does that make sense?
>
> My questions are for both Mutant and Myrmidon - do either or both of them
> address this type of idea?  If so, could you elaborate on this briefly?

There's some support for this in myrmidon, at the API level.  You do this by 
providing your own ProjectBuilder implementation.  The ProjectBuilder is 
responsible for building a Project object from a project file (a Project is 
basically just a set of named Targets).

You can use a custom ProjectBuilder to do things like:

- Run the project file through a transformation, before handing it off to the 
standard ProjectBuilder.
- Do your own parsing, and assemble the Project object yourself.
- Provide your own Project implementation.
- Swap in your own target implementation.

ProjectBuilders are loaded from antlibs just like any other type, so 
installing them is very easy.

Also, they fit in nicely with the inter-project dependency stuff, so that you 
can mix projects of different types together, and have dependencies between 
them.  For example, you could have an ant2 project that depends on an ant1 
project, and a StandardJavaProject.

But regardless of how it happens, having a library of high-level template 
projects, to use and customise ("extend"), is a great idea.

-- 
Adam

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message