<Target
Name="CoreClean"
DependsOnTargets="$(CoreCleanDependsOn)"
Condition=" '$(SkipClean)'!='true' "
…
<!-- First part of VCOverride file -->
<CreateProperty
Value="%3C?xml version=%221.0%22?%3E%0D%0A%3CVisualStudioPropertySheet ProjectType=%22Visual C++%22 Version=%228.00%22 Name=%22Team Build Overrides%22 OutputDirectory=%22$(OutDir)%22%3E%0D%0A" >
<Output TaskParameter="Value" PropertyName="VCOverridesString1ForClean"/>
</CreateProperty>
<!-- Third part of VCOverride file -->
<CreateProperty
Value="%3C/VisualStudioPropertySheet%3E" >
<Output TaskParameter="Value" PropertyName="VCOverridesString3ForClean"/>
</CreateProperty>
<!-- RunCodeAnalysis option -->
<CreateProperty
Condition=" '$(RunCodeAnalysis)'=='Always' "
Value="RunCodeAnalysis=true" >
<Output TaskParameter="Value" PropertyName="CodeAnalysisOptionForClean" />
</CreateProperty>
<!-- Second part of VCOverride file when RunCodeAnalysis is always -->
<CreateProperty
Condition=" '$(RunCodeAnalysis)'=='Always' "
Value="%09%3CTool Name=%22VCCLCompilerTool%22 EnablePREfast=%22true%22 /%3E%0D%0A%09%3CTool Name=%22VCFxCopTool%22 EnableFxCop=%22true%22 /%3E%0D%0A" >
<Output TaskParameter="Value" PropertyName="VCOverridesString2ForClean"/>
</CreateProperty>
<CreateProperty
Condition=" '$(RunCodeAnalysis)'=='Never' "
Value="RunCodeAnalysis=false" >
<Output TaskParameter="Value" PropertyName="CodeAnalysisOptionForClean" />
</CreateProperty>
<!-- Second part of VCOverride file when RunCodeAnalysis is never -->
<CreateProperty
Condition=" '$(RunCodeAnalysis)'=='Never' "
Value="%09%3CTool Name=%22VCCLCompilerTool%22 EnablePREfast=%22false%22 /%3E%0D%0A%09%3CTool Name=%22VCFxCopTool%22 EnableFxCop=%22false%22 /%3E%0D%0A" >
<Output TaskParameter="Value" PropertyName="VCOverridesString2ForClean"/>
</CreateProperty>
<!-- ReferencePath option -->
<CreateProperty
Condition=" '@(AdditionalReferencePath)'!='' "
Value="$(OutDir);@(AdditionalReferencePath)" >
<Output TaskParameter="Value" PropertyName="ReferencePath" />
</CreateProperty>
<CreateProperty
Condition=" '@(AdditionalReferencePath)'=='' "
Value="$(OutDir)" >
<Output TaskParameter="Value" PropertyName="ReferencePath" />
</CreateProperty>
<!-- Generate VCOverride file for C++ projects -->
<WriteLinesToFile
Condition=" '$(IsDesktopBuild)'=='true' "
File="TFSBuild.vsprops"
Lines="$(VCOverridesString1ForClean)$(VCOverridesString2ForClean)$(AdditionalVCOverrides)$(VCOverridesString3ForClean)"
Overwrite="true" />
<!-- Call MSBuild /t:Clean for desktop build -->
<MSBuild
Condition=" '$(IsDesktopBuild)'=='true' "
Projects="@(SolutionToBuild)"
Properties="Configuration=%(ConfigurationToBuild.FlavorToBuild);Platform=%(ConfigurationToBuild.PlatformToBuild);SkipInvalidConfigurations=true;VCBuildOverride=$(MSBuildProjectDirectory)\TFSBuild.vsprops;FxCopDir=$(FxCopDir);OutDir=$(OutDir);ReferencePath=$(ReferencePath);TeamBuildConstants=$(TeamBuildConstants);$(CodeAnalysisOptionForClean)"
Targets="Clean" />
...