DCSIMG
Copy WildCards With MSBuild - Maor's Blog

Copy WildCards With MSBuild

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!

Published 12 December 2007 01:26 AM by Maor David-Pur
תגים:

Comments

# Jass said on 18 July, 2008 04:59 PM

Could you please advise on how I can copy ONE file, could I just put name of that file after SourceFiles=

Please?

# Maor David-Pur said on 18 July, 2008 10:46 PM

Yes. also use DestinationFiles beside the DesginationFolder.

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above:

Search

Go

This Blog

News

    RSS

     

    Connect with Me

    Maor's Facebook profile  Follow Maor on Twitter  Maor's profile on Linkedin  Maor in FriendFeed 
           

Syndication