-
Notifications
You must be signed in to change notification settings - Fork 4
/
etk.build.proj
101 lines (93 loc) · 5.38 KB
/
etk.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets="Pack">
<ItemGroup>
<ProjectItem Include="src\EventTraceKit.EventTracing\EventTraceKit.EventTracing.csproj"/>
<ProjectItem Include="src\EventTraceKit.EventTracing.Tests\EventTraceKit.EventTracing.Tests.csproj"/>
<ProjectItem Include="src\EventTraceKit.Etw\EventTraceKit.Etw.vcxproj"/>
<ProjectItem Include="src\EventTraceKit.EtwCore\EventTraceKit.EtwCore.vcxproj"/>
<ProjectItem Include="src\EventTraceKit.EtwCore.Tests\EventTraceKit.EtwCore.Tests.vcxproj"/>
<ProjectItem Include="src\EventTraceKit.EtwWatchDog\EventTraceKit.EtwWatchDog.vcxproj"/>
<ProjectItem Include="src\TraceLaunch.Windows\TraceLaunch.Windows.vcxproj"/>
<ProjectItem Include="src\TraceLaunch.x86\TraceLaunch.x86.vcxproj"/>
<ProjectItem64 Include="src\TraceLaunch.x64\TraceLaunch.x64.vcxproj"/>
<ProjectItem Include="src\EventTraceKit.VsExtension\EventTraceKit.VsExtension.csproj"/>
<ProjectItem Include="src\EventTraceKit.VsExtension.Tests\EventTraceKit.VsExtension.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);DeployExtension=false</BuildPropertiesCommon>
<BuildProperties>$(BuildPropertiesCommon);Platform=x86</BuildProperties>
<BuildProperties64>$(BuildPropertiesCommon);Platform=x64</BuildProperties64>
<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"/>
<MSBuild Projects="@(ProjectItem64)"
Properties="$(BuildProperties64)"
Targets="Clean"
BuildInParallel="true"
StopOnFirstFailure="true"/>
<RemoveDir Directories="build\release" ContinueOnError="WarnAndContinue"/>
<RemoveDir Directories="build\release"/>
</Target>
<Target Name="Restore" Condition="'$(Restore)'!='false'">
<PropertyGroup>
<NuGetExecutable Condition="'$(NuGetExecutable)'==''">nuget.exe</NuGetExecutable>
<NuGetPackagesDirectory>$(MSBuildThisFileDirectory)src\packages\</NuGetPackagesDirectory>
</PropertyGroup>
<ItemGroup>
<NuGetRestoreTarget Include="$(MSBuildThisFileDirectory)src\EventTraceKit.sln"/>
</ItemGroup>
<Exec Condition="'@(NuGetRestoreTarget)'!=''"
Command="set NUGET_RESTORE_MSBUILD_ARGS=/p:Configuration=$(Configuration) & "$(NuGetExecutable)" restore -NonInteractive -PackagesDirectory "$(NuGetPackagesDirectory)\" "%(NuGetRestoreTarget.Identity)""/>
</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="@(ProjectItem64)"
Properties="$(BuildProperties64);Dummy=ForceReload"
BuildInParallel="true"
StopOnFirstFailure="true"/>
<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\EventTraceKit.EventTracing.Tests\**\EventTraceKit.EventTracing.Tests.dll"/>
<TestAssemblies Include="build\release\bin\EventTraceKit.VsExtension.Tests\**\EventTraceKit.VsExtension.Tests.dll"/>
<TestExecutables Include="build\release\bin\EventTraceKit.EtwCore.Tests\EventTraceKit.EtwCore.Tests.exe"/>
</ItemGroup>
<Exec Command=""$(XunitRunner32)" @(TestAssemblies, ' ')"/>
<Exec Command=""%(TestExecutables.Identity)""/>
</Target>
<Target Name="Pack" DependsOnTargets="Build;Test">
<Copy SourceFiles="build\release\bin\EventTraceKit.VsExtension\EventTraceKit.VsExtension.vsix"
DestinationFiles="$(PackageDir)\EventTraceKit.VsExtension-$(VsixVersion).vsix"/>
</Target>
</Project>