locked
parameterize/reuse of targets? RRS feed

  • Question

  • I'm not sure if what I am asking is correct but is it possible to define targets or tasks that would be a wrapper around a number of Exec task commands.

     

    For example my default target is as follows:

     

    <Target Name="BuildCabs" DependsOnTargets="GetLatest">

     <!-- Build Cab1 -->
     <Exec Command='CustomTool.exe param1 param2 param3' />
     <Exec Command='makecab.exe /F param2' />

     <!-- Build Cab2 -->
     <Exec Command='CustomTool.exe param1 param2 param3' />
     <Exec Command='makecab.exe /F param2' />

     <!-- Build Cab3 -->
     <Exec Command='CustomTool.exe param1 param2 param3' />
     <Exec Command='makecab.exe /F param2' />

     <!-- Build Cab4 -->
     <Exec Command='CustomTool.exe param1 param2 param3' />
     <Exec Command='makecab.exe /F param2' />

     <!-- Build Cab5 -->
     <Exec Command='CustomTool.exe param1 param2 param3' />
     <Exec Command='makecab.exe /F param2' />

    </Target>

    The Cab build is a 2-step process - firstly a custom tool must be ran that generates the ddf and validates all the files that go into the cab exist. Secondly makecab is ran...

     

    Is it possible to modularize these 2 steps into 1 msbuild step (without having to write a custom task)?

     

    Thanks

     

    Donal

     

     

     

    Friday, November 16, 2007 4:45 PM

Answers

  • How about creating target BuildCabX and using CallTarget task with it as a parameter from BuildCabs target?

     

    Hope that helps,

    Eugene

     

    Friday, November 16, 2007 6:06 PM

All replies

  • How about creating target BuildCabX and using CallTarget task with it as a parameter from BuildCabs target?

     

    Hope that helps,

    Eugene

     

    Friday, November 16, 2007 6:06 PM
  • Will try that...

     

    Thanks

     

    Donal

    Friday, November 16, 2007 6:09 PM