Copy WildCards With MSBuild
Software Development December 12th, 2007
I got today hysterical message from a good friend that implementing in his company automatic build with Team System. The message was: "Maor, How can I copy wildcards With MSBuild? Please help!!!".
Okay. What you should do my dear friend is:
1. Create an item list if you have more than one file to copy. You can do it with the CreateItem task:
<CreateItem Include="$(MyDir)\*.*"> <Output TaskParameter="Include" ItemName="MyFilesToCopy" /></CreateItem>
2. Copy!
<Copy SourceFiles="@(MyFilesToCopy)" DesginationFolder="$(MyPutputDir)" />
3. Execute your build script.
Ah, by the way, if you want to recursively copy files using the <Copy> task, read this post from MSBuild Team Blog.
Enjoy!
Similar Posts:
- Custom Build Number In Team Build
- How To: Build Non-MSBuild Projects with MSBuild
- Create custom task for MSBuild – Step by Step
- MSBuild basics
- Remove Items From ItemGroups In MSBuild
Tags: MSBuild
About


This comment originally written by:
I got today hysterical message from a good friend that implementing in his company automatic build with Team System. The message was: "Maor, How can I copy wildcards With MSBuild? Please help!!!". Okay. What you should do my dear friend is:
This comment originally written by:Maor David-Pur
Yes. also use DestinationFiles beside the DesginationFolder.
This comment originally written by:Jass
Could you please advise on how I can copy ONE file, could I just put name of that file after SourceFiles=
Please?