You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by sun99 <ra...@gmail.com> on 2007/09/19 06:43:04 UTC

filelist task



I have list of modules (may vary) to be checked out from cvs  and
compile each module . how can i loop these activities in ant build.
  
thanks in advance
sun99
-- 
View this message in context: http://www.nabble.com/filelist-task-tf4478783.html#a12770760
Sent from the Ant - Users mailing list archive at Nabble.com.


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


RE: filelist task

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
 

Hi,

-----Original Message-----
From: sun99 [mailto:ravinder141@gmail.com] 
Sent: Wednesday, September 19, 2007 9:27 AM
To: user@ant.apache.org
Subject: RE: filelist task

/*
iam getting following error message

Problem: failed to create task or type for
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken
place.
 

is task "for" is the core ant task ??
*/

not part of Ant core, see=
http://ant-contrib.sourceforge.net/

then use it in your buildfile =

<!-- Import AntContrib -->
<taskdef resource="net/sf/antcontrib/antlib.xml" />

Regards, Gilbert

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


RE: filelist task

Posted by sun99 <ra...@gmail.com>.
iam getting following error message

Problem: failed to create task or type for
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
 

is task "for" is the core ant task ??


Hi,

-----Original Message-----
From: sun99 [mailto:ravinder141@gmail.com] 
Sent: Wednesday, September 19, 2007 6:43 AM
To: user@ant.apache.org
Subject: filelist task

/*
I have list of modules (may vary) to be checked out from cvs  and
compile each module . how can i loop these activities in ant build.
*/

with antcontrib <for> task, i.e.

as macrodef =

<macrodef name="checkout_n_compile">
<attribute name="modules" default="foo,foobar,foobaz"/>
<attribute name="cvsroot" default="...."/>
<attribute name="..." default="...."/>
...

<sequential>

<for list="@{modules}" param="modul">

<cvs cvsroot="@{cvsroot}"
  package="@{modul}"
  dest="C:/cvstemp/@{modul}"
  command="-Q co"
  failonerror="true" />

<javac fork="true"
   memorymaximumsize="1024M"
  failonerror="true"
  includes="**\*.java"
srcdir="C:/cvstemp/@{modul}"
   ...
/>
  </sequential>
</macrodef>

or without a macrodef =

<property name="modules" value="foo,foobar,foobaz"/>
<property name="cvsroot" value="....."/>

...

<for list="${modules}" param="modul">
<sequential>
<cvs cvsroot=${cvsroot}"
  package="@{modul}"
  dest="C:/cvstemp/@{modul}"
  command="-Q co"
  failonerror="true" />

<javac fork="true"
   memorymaximumsize="1024M"
  failonerror="true"
  includes="**\*.java"
srcdir="C:/cvstemp/@{modul}"
destdir="C:/dist/@{modul}"
...
/>

</sequential>


Regards, Gilbert

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




-- 
View this message in context: http://www.nabble.com/filelist-task-tf4478783.html#a12772081
Sent from the Ant - Users mailing list archive at Nabble.com.


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


RE: filelist task

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
 

Hi,

-----Original Message-----
From: sun99 [mailto:ravinder141@gmail.com] 
Sent: Wednesday, September 19, 2007 6:43 AM
To: user@ant.apache.org
Subject: filelist task

/*
I have list of modules (may vary) to be checked out from cvs  and
compile each module . how can i loop these activities in ant build.
*/

with antcontrib <for> task, i.e.

as macrodef =

<macrodef name="checkout_n_compile">
<attribute name="modules" default="foo,foobar,foobaz"/>
<attribute name="cvsroot" default="...."/>
<attribute name="..." default="...."/>
...

<sequential>

<for list="@{modules}" param="modul">

<cvs cvsroot="@{cvsroot}"
  package="@{modul}"
  dest="C:/cvstemp/@{modul}"
  command="-Q co"
  failonerror="true" />

<javac fork="true"
   memorymaximumsize="1024M"
  failonerror="true"
  includes="**\*.java"
srcdir="C:/cvstemp/@{modul}"
   ...
/>
  </sequential>
</macrodef>

or without a macrodef =

<property name="modules" value="foo,foobar,foobaz"/>
<property name="cvsroot" value="....."/>

...

<for list="${modules}" param="modul">
<sequential>
<cvs cvsroot=${cvsroot}"
  package="@{modul}"
  dest="C:/cvstemp/@{modul}"
  command="-Q co"
  failonerror="true" />

<javac fork="true"
   memorymaximumsize="1024M"
  failonerror="true"
  includes="**\*.java"
srcdir="C:/cvstemp/@{modul}"
destdir="C:/dist/@{modul}"
...
/>

</sequential>


Regards, Gilbert

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


Re: filelist task

Posted by Steve Loughran <st...@apache.org>.
sun99 wrote:
> 
> 
> I have list of modules (may vary) to be checked out from cvs  and
> compile each module . how can i loop these activities in ant build.
>   

Dont treat it as a loop. so much as building a set of ant projects. For 
which <subant> can be used to call compile on all of them. OF course, 
you do have dependencies between them, which makes ordering the stuff 
complex. Start with a filelist inside them

<subant target="compile">
  <filelist>
     <file name="main/build.xml" />
     <file name="test/build.xml" />
   </filelist>
<subant>

You can also look at Ivy to build that file list for you, based on 
dependencies listed between projects. That's more advanced, but very 
powerful.

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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