I tried this, but the resulting output is all screwed up. You get an additional directory as a sibling to the output location named 'Source' and the output location contains everything from the directory that we're building from (including all of the .svn folders).
Instead I tried to delete the files in the After Build target, but the delete task is extremely flaky. Most of the time the delete won't even delete.
<ItemGroup>
<ProjFiles Include="$(OutputPath)\*.csproj*" />
</ItemGroup>
<Target Name="AfterBuild">
<!-- Strip out stuff we don't want -->
<RemoveDir Directories="$(OutputPath)\Properties" />
<RemoveDir Directories="$(OutputPath)\obj" />
<Delete Files="@(ProjFiles)" />
<!-- Move site to deployment destination -->
<Copy SourceFiles="@(PrecompiledOutput)" DestinationFiles="@(PrecompiledOutput->'$(DeploymentPath)\%(RecursiveDir)%(Filename)%(Extension)')"
Condition="'$(DeploymentPath)' != ''" />
</Target>
Any ideas why the delete won't work? Sometimes it will, but then the @(PrecompiledOutput)
is out of sync and the copy fails, so I'll need to generate a new file list after the delete. Now aspnet_compiler includes the
..csproj files too, so the problem lies there I think. Anybody have a
good solution for getting rid of the extra stuff (.csproj, obj, Properties)?