-
Notifications
You must be signed in to change notification settings - Fork 1
/
After.Microsoft.Common.Targets
64 lines (57 loc) · 3.09 KB
/
After.Microsoft.Common.Targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0" encoding="utf-8"?>
<!--
======================================================
Common file file which is run after MS targets
======================================================
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<StyleCopDependsOn>$(StyleCopDependsOn)</StyleCopDependsOn>
</PropertyGroup>
<PropertyGroup Condition="$(StyleCopEnabled) == ''" >
<StyleCopEnabled>true</StyleCopEnabled>
</PropertyGroup>
<Import Project="$(StyleCopPath)\Microsoft.StyleCop.Targets"/>
<Target Name="IncludeOnlyModifiedFilesForSourceAnalysis">
<PropertyGroup>
<SvnStatusOutputFile>$(Temp)\$(MSBuildProjectName).tmp</SvnStatusOutputFile>
</PropertyGroup>
<Delete Files="$(SvnStatusOutputFile)" />
<SvnClient Command="status --xml" Verbose="true">
<Output TaskParameter="Output" PropertyName="SvnStatusOutput"/>
</SvnClient>
<WriteLinesToFile Lines="$(SvnStatusOutput)" File="$(SvnStatusOutputFile)"/>
<XmlQuery Lines="$(SvnStatusOutput)"
XPath="//entry[wc-status[@item='modified']]/@path | //entry[wc-status[@item='added']]/@path | //entry[wc-status[@item='unversioned ']]/@path">
<Output TaskParameter="Values" ItemName="ModifiedFiles" />
</XmlQuery>
<Delete Files="$(SvnStatusOutputFile)" />
<ItemGroup>
<NotInCompile Include="@(ModifiedFiles)" Exclude="@(Compile)" />
<NotToStyleCop Include="@(ModifiedFiles)" Exclude="@(Compile);@(NotInCompile)" Condition="%(Compile.ExcludeFromStyleCop) != 'true'" />
<CompileTemp Include="@(NotToStyleCop)">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</CompileTemp>
<CompileTemp Include="@(Compile)" Exclude="@(ModifiedFiles)">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</CompileTemp>
<CompileTemp Include="@(ModifiedFiles)" Exclude="@(NotInCompile);@(NotToStyleCop)">
<ExcludeFromStyleCop>false</ExcludeFromStyleCop>
</CompileTemp>
<Compile Remove="@(Compile)"/>
<Compile Include="@(CompileTemp)">
<ExcludeFromStyleCop>%(CompileTemp.ExcludeFromStyleCop)</ExcludeFromStyleCop>
</Compile>
</ItemGroup>
<!--
<Message Text="not In Compile %(NotInCompile.Identity) %(NotInCompile.ExcludeFromStyle)"/>
<Message Text="not to Stylecop %(NotToStyleCop.Identity) %(NotToStyleCop.ExcludeFromStyle)"/>
<Message Text="to compile %(Compile.Identity) %(Compile.ExcludeFromStyleCop)"/>
-->
</Target>
<Target Name="BeforeCompile" DependsOnTargets="SetIsCompileUpToDate">
<CallTarget Targets="IncludeGeneratedAssemblyInfo" Condition="$(IsCompileUpToDate) == 'false'" />
</Target>
<!-- User targets can be run as the lastest -->
<Import Condition="Exists('$(RootPath)\After.Microsoft.Common.User.Targets')" Project="$(RootPath)\After.Microsoft.Common.User.Targets" />
</Project>