ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: Divide And Conquer Ant Question
Date Fri, 14 Dec 2007 10:56:43 GMT
I have a master setup.xml that imports plugin specific ant files, for
example for
ant-contrib, cobutura, jaxb, axis etc. These contain typedefs to define the
plugin task, macrodefs to invoke the tasks, and targets. I also have a
common targets.xml that does things like build main, build test, run
coverage. This has hooks to allow pre and post targets to be called
for example around junit tests.
I use the maven directory layout for java and resource files, so
the per-project build files would consist of a five lines for
standard build a jar for a project type projects.
for example:

<project name="peter-test" default="dist">
  <property name="commons.dir" location="../commons"/>
  <import file="${commons.dir}/src/ant/setup.xml"/>
  <main-test-paths dist-list="commons"/>

  <target name="testserver" depends="build-test">
    <java fork="yes"
          classname="org.peter.Hello"
          classpathref="test.path"/>
  </target>
</project>


On Dec 14, 2007 6:27 AM,  <Jan.Materne@rzf.fin-nrw.de> wrote:
> I would externalize (huge amounts of) macrodefs in their own files.
> a) into a buildfile and re<import> that
> b) into an antlib.xml and use xmlns declarations.
>
> my.jar!/org/my/antlib.xml
> <antlib>
>   <presetdef name="hello"><echo message="hello"/></presetdef>
> </antlib>
>
> build.xml (having my.jar on the classpath)
> <project xmlns:my="org.my">
>   <my:hello/>
> </project>
>
>
> Additional note:
> Lets say you have a larger hierarchy  "A imports B; B imports C".
> Then A contains all macros and targets from B _and_ from C.
> When working with xmlns "A imports B; B uses xmlns-C"
> A only contains B. Xml namespaces are not imported.
>
>
> Jan
>
>
>
> > -----Urspr√ľngliche Nachricht-----
> > Von: Scot P. Floess [mailto:floess@mindspring.com]
> > Gesendet: Freitag, 14. Dezember 2007 03:49
> > An: Ant Users List
> > Betreff: Re: Divide And Conquer Ant Question
>
> >
> > I do the same thing...  However, I am partial to macrodef's...  I do
> > have a build script that may use those macrodef's...  However, my
> > macrodef's are sorta like functions from which I can then
> > script/glue/call from my "scripts"
> >
> >
> >
> > Z W wrote:
> > > Hi
> > >
> > > I'm using Ant as a scripting tool much like a shell script
> > to do various
> > > tasks of a project, not for a build purpose.
> > > I like to get opinions from the gurus here about this.
> > >
> > > I have various tasks written in a single build file.
> > However, this file has
> > > become very large.
> > > I like to break this file up into multiple files, putting
> > different targets
> > > into various build files,
> > > much like breaking a single large C file into multiple files.
> > >
> > > What's the best approach to this while minimizing script
> > > rewriting/maintainability ? (using antcall, import or
> > something else)
> > >
> > > Thanks
> > >
> > >
> >
> > --
> > Scot P. Floess
> > 27 Lake Royale
> > Louisburg, NC  27549
> >
> > 252-478-8087 (Home)
> > 919-754-4592 (Work)
> >
> > Chief Architect JPlate   http://sourceforge.net/projects/jplate
> > Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
> > QA Engineer OpenQabal    http://openqabal.dev.java.net
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message