1
votes

The jist is I want to copy all the compiled files from a project to another folder after a build is finished. I figured I would use a Copy task in the AfterBuild target. Is there any way to get a list of built files in this target so I know exactly which files to copy?

Thanks

Update:

Read my comment below to see how I figured this out. However, this isn't an elegant solution. What I am really looking for is an ItemGroup of built files. Does that exist?

1
Well, after thrashing on this for awhile I found something that worked, but it doesn't seem very clean. There is an Item Group called FileWrites that lists all the files that were written to. After I exclude a funky cache file, I get the list I want. Here is my after build task: <Target Name="AfterBuild"> <ItemGroup> <SourceFiles Include="@(FileWrites)" Exclude="***.cache" /> </ItemGroup> <Copy SourceFiles="@(SourceFiles)" DestinationFolder="..\..\..\Deploy\IanPmServices\bin" /> </Target>Ely

1 Answers

1
votes

The build process does what it needs to & writes what it needs to. It doesn't know that you in particular are only interested in a subset of what it does.

Why do you think the FileWrites itemgroup isn't clean enough?

Our build process ouputs .dll & .pdb, and also .config, .xml, .doc. We use post-build copy operations based on the FileWrites group, including a couple of conditional operations for a few customer-specific files.

Edit:

With our upcoming Silverlight project, we'll also be dealing with .xaml & .xap.