Michael L
Michael L

Reputation: 5690

How to copy a recursive directory structure in TFS Team Build?

Is it possible to copy a directory in a team build target?

Upvotes: 0

Views: 2174

Answers (2)

Adam Fyles
Adam Fyles

Reputation: 6050

<Copy SourceFiles="@(SourceItemGroup)" DestinationFolder="$(YourDir\SubDir\%(RecursiveDir)" />

Upvotes: 3

Aaron Powell
Aaron Powell

Reputation: 25117

I've found the easiest way (if you want to be a bit more stringent about what to include/ exclude) is with some custom MSBuild tasks I've written: http://www.aaron-powell.com/blog.aspx?cat=AaronPowell.MSBuild.Tasks

You provide a source directory, a destination direction (support for network shares is provided) and file names/ extensions to exclude.

It's mainly because Team Build makes a real mess (particularly with web apps) when it run and it's not really possible to use the standard MSBuild copy tasks.

Upvotes: 1

Related Questions