forked from dotnet/roslyn-analyzers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildAndTest.proj
82 lines (68 loc) · 4.33 KB
/
BuildAndTest.proj
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="BuildAndTest"
ToolsVersion="14.0">
<PropertyGroup>
<SolutionFile>$(MSBuildThisFileDirectory)\src\Analyzers.sln</SolutionFile>
<PackagingProject>$(MSBuildThisFileDirectory)\src\Packaging\Packaging.proj</PackagingProject>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<IncludePattern Condition="'$(IncludePattern)' == ''">*.Test*.dll</IncludePattern>
<!-- Emit XML in a CIBuild in order to get structured test results -->
<RunTestArgs>-noshadow -parallel all</RunTestArgs>
<RunTestArgs Condition="'$(CIBuild)' == 'true'">$(RunTestArgs) -xml TestResults.xml</RunTestArgs>
<NuGetExe>$(MSBuildThisFileDirectory)\Src\.nuget\Nuget.exe</NuGetExe>
<PackagesDirectory>$(MSBuildThisFileDirectory)\packages</PackagesDirectory>
</PropertyGroup>
<Target Name="RestorePackages">
<Exec Command=""$(NuGetExe)" install xunit.runner.console -version 2.0.0 -OutputDirectory "$(PackagesDirectory)""/>
<Exec Command=""$(NuGetExe)" restore "$(MSBuildThisFileDirectory)\Src\.nuget\packages.config" -PackagesDirectory "$(PackagesDirectory)"" />
<Exec Command=""$(NuGetExe)" restore "$(SolutionFile)" -PackagesDirectory "$(PackagesDirectory)"" />
</Target>
<Target Name="Build" DependsOnTargets="RestorePackages">
<MSBuild BuildInParallel="true"
Projects="$(SolutionFile)"
Properties="RestorePackages=false;TreatWarningsAsErrors=true;DeployExtension=false"
Targets="Build"/>
</Target>
<Target Name="Clean">
<MSBuild BuildInParallel="true"
Projects="$(SolutionFile)"
Properties="RestorePackages=false"
Targets="Clean"/>
<MSBuild Projects="$(PackagingProject)"
Targets="Clean" />
</Target>
<Target Name="Rebuild">
<MSBuild BuildInParallel="true"
Projects="$(SolutionFile)"
Properties="RestorePackages=false;TreatWarningsAsErrors=true;DeployExtension=false"
Targets="Rebuild"/>
</Target>
<Target Name="Package" DependsOnTargets="Build">
<MSBuild Projects="$(PackagingProject)" Targets="Build" />
</Target>
<Target Name="Test">
<ItemGroup>
<TestAssemblies Include="Binaries\$(Configuration)\Microsoft.ApiDesignGuidelines.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\Desktop.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\System.Runtime.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\System.Runtime.InteropServices.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\ApiReview.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\Roslyn.Diagnostics.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\System.Threading.Tasks.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\Microsoft.Composition.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\XmlDocumentationComments.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\System.Collections.Immutable.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\System.Security.Cryptography.Hashing.Algorithms.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\Microsoft.CodeAnalysis.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\Microsoft.Maintainability.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\Text.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\Microsoft.QualityGuidelines.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\System.Resources.Analyzers.UnitTests.dll" />
<TestAssemblies Include="Binaries\$(Configuration)\MetaCompilation.Test.dll" />
</ItemGroup>
<Exec Command=""$(PackagesDirectory)\xunit.runner.console.2.0.0\tools\xunit.console.x86.exe" @(TestAssemblies, ' ') $(RunTestArgs)" />
</Target>
<Target Name="BuildAndTest"
DependsOnTargets="Build;Package;Test" />
</Project>