forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildAndTest.proj
88 lines (73 loc) · 3.92 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
87
88
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="BuildAndTest"
ToolsVersion="12.0">
<UsingTask
AssemblyFile="packages\xunit.runners.2.0.0-alpha-build2576\tools\xunit.runner.msbuild.dll"
TaskName="Xunit.Runner.MSBuild.xunit" />
<!-- At the moment Jenkins runs on a machine without any build of Visual Studio 2015. Hence we must
use a 2013 compatible solution. -->
<PropertyGroup>
<RoslynSolution>$(MSBuildThisFileDirectory)Roslyn.sln</RoslynSolution>
<RoslynSolution Condition="'$(PublicBuild)' == 'true'">$(MSBuildThisFileDirectory)RoslynLight.sln</RoslynSolution>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<RunTestArgs></RunTestArgs>
<RunTestArgs Condition="'$(Test64)' == 'true'">-test64</RunTestArgs>
<IncludePattern Condition="'$(IncludePattern)' == ''">*.UnitTests*.dll</IncludePattern>
<!-- Emit XML in a CIBuild in order to get structured test results -->
<RunTestArgs Condition="'$(CIBuild)' == 'true'">$(RunTestArgs) -xml</RunTestArgs>
</PropertyGroup>
<Target Name="RestorePackages">
<Exec Command=""$(MSBuildThisFileDirectory)\.nuget\Nuget.exe" install xunit.runners -pre -version 2.0.0-alpha-build2576 -outputdirectory packages"/>
<Exec Command=""$(MSBuildThisFileDirectory)\.nuget\Nuget.exe" restore "$(RoslynSolution)"" />
</Target>
<Target Name="Build" DependsOnTargets="RestorePackages">
<MSBuild BuildInParallel="true"
Projects="$(RoslynSolution)"
Properties="RestorePackages=false;TreatWarningsAsErrors=true"
Targets="Build"/>
</Target>
<Target Name="Clean">
<MSBuild BuildInParallel="true"
Projects="$(RoslynSolution)"
Properties="RestorePackages=false"
Targets="Clean"/>
</Target>
<Target Name="Rebuild">
<MSBuild BuildInParallel="true"
Projects="$(RoslynSolution)"
Properties="RestorePackages=false;TreatWarningsAsErrors=true"
Targets="Rebuild"/>
</Target>
<Target Name="Test">
<ItemGroup Condition="'$(PublicBuild)' == '' AND '$(CIBuild)' == ''">
<TestAssemblies
Include="Binaries\$(Configuration)\**\$(IncludePattern)"
Exclude="Binaries\$(Configuration)\Roslyn.Compilers.NativeClient.UnitTests.dll" />
</ItemGroup>
<ItemGroup Condition="'$(PublicBuild)' == '' AND '$(CIBuild)' == 'true'">
<TestAssemblies
Include="Binaries\$(Configuration)\**\$(IncludePattern)"
Exclude="
Binaries\$(Configuration)\Roslyn.Compilers.NativeClient.UnitTests.dll;
Binaries\$(Configuration)\Microsoft.CodeAnalysis.Scripting.UnitTests.dll;" />
</ItemGroup>
<!-- The Microsoft.CodeAnalysis.Scripting.UnitTests.dll is disabled due to https://github.com/dotnet/roslyn/issues/860 -->
<ItemGroup Condition="'$(PublicBuild)' == 'true' AND '$(CIBuild)' == ''">
<TestAssemblies
Include="Binaries\$(Configuration)\**\$(IncludePattern)"
Exclude="
Binaries\$(Configuration)\Roslyn.Compilers.NativeClient.UnitTests.dll;
Binaries\$(Configuration)\Microsoft.CodeAnalysis.Scripting.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.Services.Editor.UnitTests2.dll;
Binaries\$(Configuration)\Roslyn.Services.Editor.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.ExpressionEvaluator.CSharp.ResultProvider.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.ExpressionEvaluator.VisualBasic.ResultProvider.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.Services.Editor.VisualBasic.UnitTests.dll;
Binaries\$(Configuration)\Roslyn.Services.Editor.CSharp.UnitTests.dll;" />
</ItemGroup>
<Exec Command="Binaries\$(Configuration)\RunTests.exe packages\xunit.runners.2.0.0-alpha-build2576\tools $(RunTestArgs) @(TestAssemblies, ' ')" />
</Target>
<Target Name="BuildAndTest"
DependsOnTargets="Build;Test" />
</Project>