Last active
October 5, 2018 12:39
-
-
Save milannankov/999de479706128da25f161aea060b837 to your computer and use it in GitHub Desktop.
copy-output-files-msbuild
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<CopyDestionationPath>.\MyDestinationPath</CopyDestionationPath> | |
<BuildDependsOn> | |
$(BuildDependsOn); | |
CopyOutputToDestination; | |
</BuildDependsOn> | |
</PropertyGroup> | |
<Target Name="CopyOutputToDestination"> | |
<ItemGroup> | |
<OutputFiles Include="$(OutDir)**\*"></OutputFiles> | |
</ItemGroup> | |
<Message Text="Copying output file to destination: @(OutputFiles)" Importance="high"/> | |
<Copy SourceFiles="@(OutputFiles)" | |
DestinationFolder="$(CopyDestionationPath)\%(RecursiveDir)" | |
OverwriteReadOnlyFiles="true"></Copy> | |
</Target> | |
</Project> |
This file contains 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
<!-- Rest of .csproj --> | |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |
<Import Project="$(MSBuildProjectDirectory)\Build\copy-output.targets" /> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot for the script!
Just one minor note - there's a typo on lines 6 and 24:
CopyDestionationPath
should beCopyDestinationPath
.