forked from dotnet/roslyn-analyzers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BuildAndTest.proj
86 lines (72 loc) · 4.52 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
83
84
85
86
<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>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(NUGET_PACKAGES)</NuGetPackageRoot>
<!-- Respect environment variable if set -->
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' and
'$(OS)' == 'Windows_NT'">$(UserProfile)\.nuget\packages</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' and
'$(OS)' != 'Windows_NT'">$(HOME)\.nuget\packages</NuGetPackageRoot>
</PropertyGroup>
<Target Name="RestorePackages">
<Exec Command=""$(NuGetExe)" install xunit.runner.console -version 2.1.0 -OutputDirectory "$(NuGetPackageRoot)""/>
<Exec Command=""$(NuGetExe)" restore "$(SolutionFile)"" />
</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.Analyzers.UnitTests.dll" />
</ItemGroup>
<Exec Command=""$(NuGetPackageRoot)\xunit.runner.console\2.1.0\tools\xunit.console.x86.exe" @(TestAssemblies, ' ') $(RunTestArgs)" />
</Target>
<Target Name="BuildAndTest"
DependsOnTargets="Build;Package;Test" />
</Project>