On Sun, 23 Jun 2002 14:08, Peter Donald wrote:
> 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 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?
>
> 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 the
> following
>
> <template-def name="x-buildnumber">
> <attribute name="file" type="java.io.File" default="build.number"/>
> <logic>
> <buildnumber file="@{file}"/>
> <exec command="cvs commit @{file}"/>
> </logic>
> </template-def>
Um, Pete, you haven't checked in the <template-def> task yet. All the other
stuff is there - TemplateDef, TemplateTask, etc - just no TemplateDefTask.
> 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="o.a.a.build.BuildNumber"/>
> </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?).
Not entirely. It's near the top of my ever-growing todo list, though.
--
Adam
--
To unsubscribe, e-mail: <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
|