Say I have a project structure with 3 applications:
├───app1
├───app2
├───app3
I want to have an msbuild task to copy the relevant output of each application to a separate deployment location
deploy\app1\<app1.output>
deploy\app2\<app2.output>
deploy\app3\<app3.output>
The script below does the following instead:
deploy\app1\<app1.output> + <app2.output> + <app3.output>
deploy\app2\<app1.output> + <app2.output> + <app3.output>
deploy\app3\<app1.output> + <app2.output> + <app3.output>
I know there is something wrong with the batching, but I cannot figure out how to fix it. Any ideas where I've got it wrong?
<Target Name="Deploy">
<!-- Ensure the target home exists -->
<MakeDir Directories="$(DeployPath)" />
<!-- Select artefacts -->
<ItemGroup>
<ProjectPath Include="%(Project.BuildOutput)" />
<ArtefactSource Include="%(ProjectPath.RootDir)%(ProjectPath.Directory)**\*.*" />
</ItemGroup>
<!-- copy files to respective artefact location -->
<Copy SourceFiles="@(ArtefactSource)" DestinationFolder="$(DeployPath)\%(Project.Identity)"
Condition="'%(Project.CanDeploy)' AND '%(Project.TestWasRun)' != 'Error'" />
</Target>