ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <>
Subject Re: Object oriented builds
Date Sun, 23 Jun 2002 12:58:01 GMT
Pretty cool.  Thanks for the discussion on this.


----- Original Message -----
From: "Peter Donald" <>
To: "Ant Developers List" <>
Sent: Sunday, June 23, 2002 12:08 AM
Subject: Re: Object oriented builds

> At 11:45 PM 6/22/2002 -0400, you wrote:
> >  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
> >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
> >is modified to depend on it and add the generated source directory to the
> >compile and javadoc stage.  Does that make sense?
> In myrmidon this is the case. You can define "templates" for each of your
> important build processes and then reuse them. For example you could do
> following
> <template-def name="x-buildnumber">
>    <attribute name="file" type="" default="build.number"/>
>    <logic>
>      <buildnumber file="@{file}"/>
>      <exec command="cvs commit @{file}"/>
>    </logic>
> </template-def>
> Then later in your build you just do
> <x-buildnumber/> and it increments build number and commits it back to
> Of course these templates can be as complex or simple as you want.
> As the templates get larger or shared you will want them to be stored in a
> library. So you create a separate XML file and then register them template
> as a task with a special factory. Usually you register tasks via
> <types>
>    <task name="buildnumber" impl=""/>
> </types>
> However when you are doing template tasks you need an extra attribute
> ("factory") to indicate how the tasks are created. (Note that this is not
> entirely implemented in Myrmidon just yet I don't think - Adam?). So it
> ends up looking like
> <types>
>    <task name="x-buildnumber" impl="o/a/a/build/BuildNumber.template"
> factory="template-factory"/>
> </types>
> The problem with the current implementation is that the template is loaded
> into memory when it is declared which ends up using massive amounts of
> memory when you are not using template. So in the future myrmidon will
> and cache templates at runtime.
> The idea is to support all the functionality needed for meta build
> like Centipede/Maven (but let them rigfht the actual templates).
> Cheers,
> Peter Donald
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> "Faced with the choice between changing one's mind,
> and proving that there is no need to do so - almost
> everyone gets busy on the proof."
>               - John Kenneth Galbraith
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

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

View raw message