I'm trying to "fix" a build on our TF Server that drops everything into the drop folder in one big flat drop (rather than in seperate project dumps like a local build would do), and I'm getting a little frustrated - I'm going to be honest and say this is the first time I've ever worked with MSBuild and this has kind of been droppped on me - it's not a build file I configured from scratch.
I've found a bunch of solutions online, and most point to this blog, which looks good. Unfortunately it doesn't seem to solve my problems at all.
In TFSBuild.proj I have a lump of code that looks like:
<SolutionToBuild Include="$(BuildProjectFolderPath)/../../mySolution.sln">
<Targets>SomeProject\Project</Targets>
<Properties>
CustomizableOutDir=true;
</Properties>
</SolutionToBuild>
And as far as I can tell from that CustomizableOutDir is indeed set to true which should allegedly retain directory structure. I tried editing some of the project files as indicated in the blog, like so...
<Target Name="AfterCompile" Condition="'$(TeamBuildOutDir)' != ''">
<ItemGroup>
<CompileOutputs Include="$(OutDir)\**\*" />
</ItemGroup>
<Copy
SourceFiles="@(CompileOutputs)"
DestinationFolder=
"$(TeamBuildOutDir)\ProjectName\%(RecursiveDir)" />
</Target>
But that behaves weirdly - if I edit several project files I begin to get what looks like I might be approaching a correct solution, but still isn't good enough - I get a directory structure that contains folders like MyProj1 and MyProj2, yet MyProj2 seems to of had all the output from MyProj1 dumped into it (MyProj1 works as I'd hope it to). On top of this the drop folder still has everything else dumped in one big drop (the directories contain duplicates of this drop).
Does anyone have any idea of what could be causing CustomizableOutDir to not behave as expected? Or is there a problem with my csproj file code?