So I ran into a situation where I needed to copy a directory to a specific destination through MSBuild.
This is how I could achieve my goal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <ItemGroup> | |
| <CloudArtifacts Include=".Cloud\Data\**\*.*"/> | |
| </ItemGroup> | |
| <Target Name="CopyFiles"> | |
| <Copy SourceFiles="@(CloudArtifacts)" DestinationFiles="@(CloudArtifacts->'c:\PackableFiles\%(RecursiveDir)%(Filename)%(Extension)')" /> | |
| </Target> | |
| </Project> |
We can get more details on MS Build Copy task in this link.
🙂