Subject: [ccnet-user] Re: Adding Projects based on data
read from file



Hi

the just released 1.5 version has dynamic parameters
maybe these can help you out
http://confluence.public.thoughtworks.org/display/CCNET/Dynamic+Parameters

with kind regards
Ruben Willems



2009/9/16 Graeme Scott <gragraoz@xxxxxxxxxxx>
Hi,
 
In NAnt I can use i can do something like the following:
 
<foreach item="Line" in="file.csv" delim="," property="csv.A, csv.B, csv.C" trim="Both" >
 
   Do something based on the data read from the file.
 
</foreach>
 
What I would like to be able to do is something similar, but where I create projects based on what comes from the files. This can be really usefull for adding a number projects that are based on similar settings. We have a number of projects that only slightly change and currently I have to keep on adding them multiple times.
 
I am already using the preprocessor and that cuts down what needs to be changed, but I would like to be able to add multiple projects based on a file to make it even easier to add..
 
<cb:scope>
   <cb:include href="ccnet.TaskA.include"/>
   <cb:TaskA description="BlahBlahBlah" paramA="AAAA" />
   <cb:TaskA description="BlahBlahBlah" paramA="BBBB" />
   <cb:TaskA description="BlahBlahBlah" paramA="BBBB" />
</cb:scope>

<cb:scope>
   <cb:include href="ccnet.TaskB.include"/>
   <cb:TaskB description="BlahBlahBlah" paramA="AAAA" />
   <cb:TaskB description="BlahBlahBlah" paramA="...

BBBB" />
   <cb:TaskB description="BlahBlahBlah" paramA="BBBB" />
</cb:scope>

 
Now what I would like to be able to do is:
 

 <cb:scope>
   <cb:include href="ccnet.TaskA.include"/>
   <cb:foreach in="file.csv" delim="," property="csv.A, csv.B, csv.C" trim="Both">
      <cb:TaskA description="$(csv.A)" paramA="$(csv.B)" />
   </cb:foreach>
</cb:scope>
 
<cb:scope>
   <cb:include href="ccnet.TaskB.include"/>
   <cb:foreach in="file.csv" delim="," property="csv.A, csv.B, csv.C" trim="Both">
      <cb:TaskB description="$(csv.A)" paramA="$(csv.B)" />
   </cb:foreach>
</cb:scope>
 

Is there anyway to do something like this?
 
I would even consider modifying the code base myself to do it. I am currently on 1.4.4.83
 
Cheers,


Graeme







Privacy