Hello Markus,

You can always place the 10 files into a .txt file and then use the
foreach task to read in the files and process each one.  IE.


<foreach item="Line" in="VssFiles.txt" delim=","
property="vss.project.path,vss.project.file" >
        <property name="project.path.file"
value="${vss.project.path}/${vss.project.file}" />
      <exec program="regsvr32" workingdir="C:\Windows\System32\"
commandline="/s /u ${vss.project.file}" failonerror="false" />
      <vssget
          dbpath="\\someserver\data\dev\software\source\vss\srcsafe.ini"
          username="${sourcesafe.username}"
          password="${sourcesafe.password}"
          path="${project.path.file}"
          localpath="C:\Windows\System32"
          replace="true"
      />
      <exec program="regsvr32" workingdir="C:\Windows\System32\"
commandline="/s ${vss.project.file}" />
</foreach>

And then the file would look list this.
$/VCpp/DLL/kcsStream/Bin,kcsStream.dll
$/VCpp/DLL/someotherpath/Bin,someotherfile.dll
...
...
...

This way you only have to update the file if there are more files to add
or remove and the script stays the same.

Hope this helps.

Tim.





-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Markus
Ewald
Sent: February 2, 2006 7:56 AM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] How to avoid repeating commands?


My NAnt .build files often have blocks like this in them (this one 
checks out a file from a sourcesafe repository):

    <exec program="regsvr32" workingdir="C:\Windows\System32\" 
commandline="/s /u kcsStream.dll" failonerror="false" />
    <vssget
      dbpath="\\someserver\data\dev\software\source\vss\srcsafe.ini"
      username="${sourcesafe.username}"
      password="${sourcesafe.password}"
      path="$/VCpp/DLL/kcsStream/Bin/kcsStream.dll"
      localpath="C:\Windows\System32"
      replace="true"
    />
    <exec program="regsvr32" workingdir="C:\Windows\System32\" 
commandline="/s kcsStream.dll" />

The bad thing is that there are about 10 files like this that need to be

unregistered, updated and re-registered. I currently don't know of a 
better way than to repeat that block 10 times all over.

What I'd like to have is a list of the repository paths of all those 
DLLs and just let the above block run on each entry of the list once. 
I've taken a thorough look at <FileSet /> and <Path /> but I don't see 
any way to use them for that purpose. Isn't there something like a <for 
/> tag or so that I can use to iterate over some kind of list?

Thanks,
-Markus-


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files for problems?  Stop!  Download the new AJAX search engine that
makes searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to