ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: how to execute <ant> task in a set of directories?
Date Fri, 28 Mar 2003 10:26:50 GMT
Not tested code.

<target name="compile-projects" depends="compile" description="Compile all
subprojects">
    <foreach target="compile-project" param="thisEnv">
        <path>
            <!-- Includes only directories. If there is none, the
compile-project -->
            <!-- shouldn´t be invoked -->
            <dirset dir="${projects.dir}" includes="*"/>
        </path>
    </foreach>
</target>

<target name="compile-project">
    <!-- Because you are using <foreach> of AntContrib, the <if> is also
available -->
    <if>
        <available file="${thisEnv}/build.xml"/>    
        <then>
            <ant dir="${thisEnv}" target="compile"/>
        </then>
    </if>
</target>


Jan Matèrne




> -----Ursprüngliche Nachricht-----
> Von: Jason Novotny [mailto:novotny@aei.mpg.de]
> Gesendet am: Freitag, 28. März 2003 10:59
> An: Jan.Materne@rzf.fin-nrw.de
> Cc: user@ant.apache.org
> Betreff: Re: how to execute <ant> task in a set of directories?
> 
> 
> Hi,
> 
>     Sucess is when I have one or more directories within 
> ${projects.dir} 
> and each one contains a build.xml and failure is when there are no 
> directories in ${projects.dir}
> 
>     Thanks, Jason
> 
> Jan.Materne@rzf.fin-nrw.de wrote:
> 
> > What do you want to have?
> > Can you give me a success-usecase?
> >
> >
> > Jan Matèrne
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Jason Novotny [mailto:novotny@aei.mpg.de]
> > > Gesendet am: Donnerstag, 27. März 2003 20:59
> > > An: Jan.Materne@rzf.fin-nrw.de
> > > Betreff: Re: AW: how to execute <ant> task in a set of 
> directories?
> > >
> > >
> > > Hi Jan,
> > >
> > >     Thanks for your advice and I noticed you helped someone
> > > else with a
> > > similar problem-- now I'm doing the following:
> > >
> > > <target name="compile-projects" depends="compile"
> > > description="Compile
> > > all subprojects">
> > >         <foreach target="compile-project" param="thisEnv">
> > >         <path>
> > >             <dirset dir="${projects.dir}" includes="*"/>
> > >         </path>
> > >         </foreach>
> > >     </target>
> > >
> > >     <target name="compile-project" >
> > >            <ant dir="${thisEnv}" target="compile"/>
> > >     </target>
> > >
> > > This seems to work fine for my purposes except when the
> > > ${projects.dir}
> > > has no directories in it-- do you know how I can easily check
> > > and handle
> > > this case?
> > >
> > >     Thanks very much, Jason
> > >
> > >
> > >
> > >
> > > Jan.Materne@rzf.fin-nrw.de wrote:
> > >
> > > >Maybe <subant> of CVS head support filesets. Another
> > > possibility is using
> > > ><foreach> of AntContrib combined with <ant>.
> > > >
> > > >There was a discussion on that topic ... <<searching>>
> > > >
> > > >Yep, discussion starts on
> > > >  http://marc.theaimsgroup.com/?l=ant-dev&m=104756994324333&w=2

> > <http://marc.theaimsgroup.com/?l=ant-dev&m=104756994324333&w=2>
> > > >
> > > >
> > > >Jan Matèrne
> > > >
> > > > 
> > > >
> > > >>-----Ursprüngliche Nachricht-----
> > > >>Von: Jason Novotny [mailto:novotny@aei.mpg.de]
> > > >>Gesendet am: Samstag, 22. März 2003 13:34
> > > >>An: user@ant.apache.org
> > > >>Betreff: how to execute <ant> task in a set of directories?
> > > >>
> > > >>
> > > >>Hi,
> > > >>
> > > >>    I have some set of directories say a/ b/ c/ and d/ each
> > > >>with their
> > > >>own build.xml script. How can a top-level build script invoke
> > > >>the build
> > > >>script in each of the subdirectories without knowing the
> > > >>directory names
> > > >>a priori?
> > > >>
> > > >>    Thanks a lot, Jason
> > > >>
> > > >>
> > > >>------------------------------------------------------------
> > > ---------
> > > >>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > >>For additional commands, e-mail: user-help@ant.apache.org
> > > >>   
> > > >>
> > > >
> > > >
> > > > 
> > > >
> > >
> > >
> > >
> >
> 
> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message