0

This is slightly complicated than structure copy, hence a separate question.

We have this item group which is a collection of files to be copied.

<ItemGroup>
   <FilesToBeCopied Include="
       C:\SomeFolder\a.exe;
       C:\SomeFolder\d.dll;
       C:\SomeFolder\AFolder\*;
       C:\SomeFolder\e.dll;
       C:\SomeFolder\some.xml;>
   </FilesToBeCopied>
</ItemGroup>

We need a copy task, something may be something similar to the line below

<Copy SourceFiles="@(FilesToBeCopied)" DestinationFolder="bin\%(FilesToBeCopied.RecursiveDir)" SkipUnchangedFiles="true"/>

So that the final structure needed is:

somelocation\bin\a.exe; 
somelocation\bin\d.dll;
somelocation\bin\AFolder\*;
somelocation\bin\e.dll;
somelocation\bin\some.xml;

Is there a way to achieve this? Because the above copy statement copies all files to bin\ folder and doesn't create the AFolder* structure within bin.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
dushyantp
  • 4,398
  • 7
  • 37
  • 59

1 Answers1

0

Turns out the fix was quite simple. Just use an item group that has wild cards ** around the folder.

<ItemGroup>
   <FilesToBeCopied Include="
       C:\SomeFolder\a.exe;
       C:\SomeFolder\d.dll;
       C:\SomeFolder\**\AFolder\**;
       C:\SomeFolder\e.dll;
       C:\SomeFolder\some.xml;>
   </FilesToBeCopied>
</ItemGroup>
dushyantp
  • 4,398
  • 7
  • 37
  • 59