This repository has been archived by the owner on Nov 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
corebuild.proj
79 lines (62 loc) · 2.82 KB
/
corebuild.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
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="All" InitialTargets="Setup" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="corebuild\corebuild.props" />
<ItemGroup>
<PackageReference Include="GitInfo" Version="*" />
<PackageReference Include="xunit.runner.console" Version="2.1.0" />
<!-- Latest v2.2.0 reports being compatible with net452 -->
<!--<PackageReference Include="xunit.runner.msbuild" Version="*" />-->
</ItemGroup>
<ItemGroup>
<Solution Include="src\*.sln"/>
<TestProject Include="src\**\*Tests.csproj" />
</ItemGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Out Condition=" '$(Out)' == '' ">out</Out>
<BuildProperties>WarningLevel=0;RunCodeAnalysis=false;Configuration=$(Configuration);Out=$(Out)</BuildProperties>
</PropertyGroup>
<Target Name="All" DependsOnTargets="Build;Test" />
<Target Name="Build">
<MSBuild Projects="@(Solution)" Targets="Build" Properties="$(BuildProperties)" />
</Target>
<Target Name="Clean">
<MSBuild Projects="@(Solution)" Targets="Clean" Properties="$(BuildProperties)" />
<Exec Command="rmdir $(Out) /S /Q" ContinueOnError="true" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
<Target Name="Test" DependsOnTargets="Build">
<MSBuild Projects="@(TestProject)" BuildInParallel="true" Targets="GetTargetPath" Properties="$(BuildProperties)">
<Output TaskParameter="TargetOutputs" ItemName="_TestAssembly" />
</MSBuild>
<ItemGroup>
<TestAssembly Include="@(_TestAssembly)" Condition="Exists('%(FullPath)')" />
</ItemGroup>
<PropertyGroup>
<XunitConsole>"$(NuGetPackageRoot)\xunit.runner.console\2.1.0\tools\xunit.console.exe"</XunitConsole>
<XunitOptions>$(XunitOptions) -html $(Out)\test.html -xml $(Out)\test.xml -parallel all -noshadow</XunitOptions>
</PropertyGroup>
<Exec Command="$(XunitConsole) @(TestAssembly, ' ') $(XunitOptions)" ConsoleToMSBuild="true" />
<!-- Version 2.1.0 restores fine, but it's apparently incompatible with MSBuild 15.0 :( -->
<!-- <xunit Assemblies="@(TestAssembly)" /> -->
</Target>
<Target Name="SolutionRestore" AfterTargets="Restore">
<MSBuild Projects="@(Solution)" Targets="Restore" />
</Target>
<Target Name="GitVersion">
<PropertyGroup>
<GitSemVerMajor>1</GitSemVerMajor>
<GitSemVerMinor>0</GitSemVerMinor>
<GitSemVerPatch>0</GitSemVerPatch>
</PropertyGroup>
</Target>
<Target Name="GetVsInstallRoot" Returns="$(VsInstallRoot)">
<Message Importance="high" Text="$(VsInstallRoot)" />
</Target>
<Target Name="Setup" DependsOnTargets="GitVersion" Returns="$(Version)">
<PropertyGroup>
<Version>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)</Version>
</PropertyGroup>
</Target>
<Import Project="corebuild\corebuild.targets" />
</Project>