-
Notifications
You must be signed in to change notification settings - Fork 4
/
emc.build.proj
86 lines (78 loc) · 4.29 KB
/
emc.build.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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="Pack">
<ItemGroup>
<ProjectItem Include="src\EventManifestCompiler\EventManifestCompiler.csproj"/>
<ProjectItem Include="src\EventManifestCompiler.Tests\EventManifestCompiler.Tests.csproj"/>
<ProjectItem Include="src\EventManifestCompiler.Build.Tasks\EventManifestCompiler.Build.Tasks.csproj"/>
<ProjectItem Include="src\EventManifestCompiler.Build.Tasks.Tests\EventManifestCompiler.Build.Tasks.Tests.csproj"/>
<ProjectItem Include="src\EventTraceKit.EventTracing\EventTraceKit.EventTracing.csproj"/>
<ProjectItem Include="src\EventTraceKit.EventTracing.Tests\EventTraceKit.EventTracing.Tests.csproj"/>
</ItemGroup>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<OfficialBuildId Condition="'$(OfficialBuildId)' == '' and '$(OfficialBuild)' == 'true'">$([System.DateTime]::UtcNow.ToString(`yyyyMMdd.HHmm`))</OfficialBuildId>
<BuildPropertiesCommon>Configuration=$(Configuration);OfficialBuildId=$(OfficialBuildId)</BuildPropertiesCommon>
<BuildProperties>$(BuildPropertiesCommon);Platform=AnyCPU</BuildProperties>
<PackProperties>$(BuildProperties);IncludeSource=true</PackProperties>
<PackageDir>$(MSBuildThisFileDirectory)build\publish\</PackageDir>
<ToolsDir>$(MSBuildThisFileDirectory)tools\</ToolsDir>
</PropertyGroup>
<Import Project="src\Build\ProjectInfo.props"/>
<Import Project="src\Build\Common.props"/>
<Import Project="src\Build\Version.props"/>
<Import Project="src\Build\RepoLayout.props" />
<Import Project="src\Build\ProjectLayout.props" />
<Target Name="Clean" Condition="'$(Clean)'!='false'">
<MSBuild Projects="@(ProjectItem)"
Properties="$(BuildProperties)"
Targets="Clean"
BuildInParallel="true"
StopOnFirstFailure="true"/>
<RemoveDir Directories="build\release" ContinueOnError="WarnAndContinue"/>
<RemoveDir Directories="build\release"/>
</Target>
<Target Name="Restore" Condition="'$(Restore)'!='false'">
<!-- Parallel restore is not threadsafe and cannot be used reliably for CI
builds. See https://github.com/NuGet/Home/issues/7648 -->
<MSBuild Projects="@(ProjectItem)"
Properties="$(BuildProperties)"
Targets="Restore"
BuildInParallel="false"
StopOnFirstFailure="true"/>
</Target>
<Target Name="Build" DependsOnTargets="Restore" Condition="'$(Build)'!='false'">
<!--
Force re-evaluation of any native project by passing in a different set of
global properties. A dummy property is enough. This is necessary since the
project might have been loaded before restoring its NuGet packages. The
seemingly useful MSBuild task property 'UnloadProjectsOnCompletion' cannot
be used since it does not do anything.
-->
<MSBuild Projects="@(ProjectItem)"
Properties="$(BuildProperties);Dummy=ForceReload"
BuildInParallel="true"
StopOnFirstFailure="true"/>
</Target>
<Target Name="GetXunit">
<PropertyGroup>
<XunitRunner32>$(ToolsDir)xunit.runner.console.2.3.1\tools\net452\xunit.console.x86.exe</XunitRunner32>
</PropertyGroup>
<Exec Condition="!Exists('$(XunitRunner32)')"
Command="nuget install xunit.runner.console -Version 2.3.1 -OutputDirectory "$(ToolsDir.TrimEnd('\'))""/>
</Target>
<Target Name="Test" DependsOnTargets="Build;GetXunit" Condition="'$(Test)' != 'false'">
<ItemGroup>
<TestAssemblies Include="build\release\bin\EventManifestCompiler.Build.Tasks.Tests\**\EventManifestCompiler.Build.Tasks.Tests.dll"/>
<TestAssemblies Include="build\release\bin\EventTraceKit.EventTracing.Tests\**\EventTraceKit.EventTracing.Tests.dll"/>
</ItemGroup>
<Exec Command=""$(XunitRunner32)" @(TestAssemblies, ' ')"/>
</Target>
<Target Name="Pack" DependsOnTargets="Build;Test">
<PropertyGroup>
<PackArgs>-Symbols -SymbolPackageFormat snupkg -NoPackageAnalysis -OutputDirectory "$(PackageDir)\" -Version "$(Version)"</PackArgs>
</PropertyGroup>
<MakeDir Directories="$(PackageDir)"/>
<Exec Command="nuget.exe pack $(PackArgs) src\EventManifestCompiler.Build.Tasks.nuspec"/>
</Target>
</Project>