EditDescription
It's very common that someone will want to create a build Item that is expected to consists of the output files, such as those in OUTDIR or DropLocation, and then at some point near the end of the script using that Item in for copying those files to some other location. Commonly people find that they ended up with an empty directory at this new target location and are a bit perplexed as to why.
This script should wok for you. See the source section below for a more detailed description and additional references including a bit of sample code often seen that people use that doesn't work as expected.
EditUsage
Add to TFSBuild.proj as an override of the AfterGet target
EditSource
Micael Ruminer's blog entry among likely countless other locations contains this information
http://manicprogrammer.com/cs/blogs/michaelruminer/archive/2008/02/23/teambuild-outdir-item-expansion-and-why-your-copy-task-gave-you-nothing.aspxEditScript
<Target Name="AfterDropBuild">
<CreateProperty
Value="\\mymachine\Drop\$(BuildNumber)">
<Output
TaskParameter="Value"
PropertyName ="MyDropLocation"/>
</CreateProperty>
<CreateItem
Include="$(DropLocation)\$(BuildNumber)\**\*">
<Output
TaskParameter ="Include"
ItemName ="MyDropFiles"/>
</CreateItem>
<Copy
SourceFiles="@(MyDropFiles)"
DestinationFiles="@(MyDropFiles->'$(MyDropLocation)\%(RecursiveDir)%(Filename)%(Extension)')"/>
</Target>
EditNotes