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:

Tags:



3 Comments to “Copy WildCards With MSBuild”

  1. maord | June 22nd, 2009 at 23:10

    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:

  2. maord | June 22nd, 2009 at 23:10

    This comment originally written by:Maor David-Pur

    Yes. also use DestinationFiles beside the DesginationFolder.

  3. maord | June 22nd, 2009 at 23:10

    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?

Leave a Comment