I have the following MSBuild targets file (below).
How would I add an additional step after Default to copy all the \bin\Debug
or \bin\Release
from one of the projects to a folder called binaries
that is in the same folder as the .targets
file was run?
If I could get it to be smart about if it uses Debug or Release even better.
UPDATE: I have updated my code that I have gotten so far. Still would be nice to be able to run the .bat file that kicks this msbuild off in two operating modes: Release and Debug and then have two different folders in the Binaries folder
<ItemGroup>
<SolutionFiles Include=".\**\*.sln"/>
</ItemGroup>
<ItemGroup>
<DebugBinFiles Include=".\src\Sample.Core\Sample.Core.Infrastructure\bin\Debug\**\*.*"/>
</ItemGroup>
<ItemGroup>
<ReleaseBinFiles Include=".\src\Sample.Core\Sample.Core.Infrastructure\bin\Release\**\*.*"/>
</ItemGroup>
<Target Name="Default" AfterTargets="AfterBuild">
<MSBuild Projects="@(SolutionFiles)" Condition=""/>
</Target>
<Target Name="AfterBuild">
<Copy SourceFiles="@(BinFiles)" DestinationFolder=".\binaries\Debug" />
</Target>
</Project>