-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.proj
155 lines (125 loc) · 5.58 KB
/
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?xml version="1.0" encoding="utf-8"?>
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
DefaultTargets="Clean;BuildDebug;BuildRelease">
<ItemGroup>
<MediaSln Include=".\MediaServices.Client.Extensions\MediaServices.Client.Extensions.csproj" />
<MediaSln Include=".\MediaServices.Client.Extensions.Tests\MediaServices.Client.Extensions.Tests.csproj" />
</ItemGroup>
<!-- Define build properties -->
<PropertyGroup>
<NugetDirectory>.\.nuget</NugetDirectory>
<SourceBin>.\MediaServices.Client.Extensions\bin</SourceBin>
<TestDirectory>.\MediaServices.Client.Extensions.Tests</TestDirectory>
<TestAssemblyName>.\MediaServices.Client.Extensions.Tests\bin\debug\MediaServices.Client.Extensions.Tests.dll</TestAssemblyName>
<PublishDirectory>.\Publish</PublishDirectory>
<PackageDirectory>.\Package</PackageDirectory>
<BuildOutputDirectory>$(PublishDirectory)\Build</BuildOutputDirectory>
<TestOutputDirectory>$(PublishDirectory)\TestResults</TestOutputDirectory>
</PropertyGroup>
<!-- Clean the build in all configurations -->
<Target Name="Clean">
<!-- Clean the solutions -->
<Message Importance="high" Text="Cleaning the projects..." ContinueOnError="true" />
<MSBuild
Projects="@(MediaSln)"
Targets="Clean"
Properties="Configuration=Debug"
ContinueOnError="true" />
<MSBuild
Projects="@(MediaSln)"
Targets="Clean"
Properties="Configuration=Release"
ContinueOnError="true" />
<!-- Delete the publish files -->
<Message Importance="high" Text="Cleaning publish files..." ContinueOnError="false" />
<ItemGroup>
<PublishFiles Include="$(PublishDirectory)\**\*.*" />
</ItemGroup>
<Delete
Files="@(PublishFiles)"
ContinueOnError="false" />
<RemoveDir
Directories="$(PublishDirectory)"
ContinueOnError="false" />
<!-- Delete the package files -->
<Message Importance="high" Text="Cleaning package files..." ContinueOnError="false" />
<ItemGroup>
<PackageFiles Include="$(PackageDirectory)\**\*.*" />
</ItemGroup>
<Delete
Files="@(PackageFiles)"
ContinueOnError="false" />
<RemoveDir
Directories="$(PackageDirectory)"
ContinueOnError="false" />
</Target>
<!-- Build the Cmdlets in Debug configuration -->
<Target Name="BuildDebug">
<Message Importance="high" Text="Building debug version the projects..." />
<MSBuild
Projects="@(MediaSln)"
Targets="Build"
Properties="Configuration=Debug"
ContinueOnError="true" />
</Target>
<!-- Build the Cmdlets in Release configuration -->
<Target Name="BuildRelease">
<Message Importance="high" Text="Building release version the projects..." />
<MSBuild
Projects="@(MediaSln)"
Targets="Build"
Properties="Configuration=Release"
ContinueOnError="true" />
</Target>
<Target Name="RestorePackages">
<Exec Command=""$(NugetDirectory)\NuGet.exe" restore ".\MediaServices.Client.Extensions.sln"" />
</Target>
<Target Name="Build" DependsOnTargets="RestorePackages;Clean;BuildDebug;BuildRelease" />
<!-- Publish any build artificates to the Publish directory -->
<Target Name="Publish" DependsOnTargets="Build">
<!-- Copy code artifacts -->
<Message Importance="high" Text="Publishing ..." ContinueOnError="false" />
<ItemGroup>
<DebugFiles Include="$(SourceBin)\Debug\**\*.*" />
<ReleaseFiles Include="$(SourceBin)\Release\**\*.*" />
</ItemGroup>
<MakeDir
Directories="$(BuildOutputDirectory)"
ContinueOnError="false" />
<Copy
SourceFiles="@(DebugFiles)"
DestinationFiles="@(DebugFiles->'$(BuildOutputDirectory)\Debug\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
ContinueOnError="false" />
<Copy
SourceFiles="@(ReleaseFiles)"
DestinationFiles="@(ReleaseFiles->'$(BuildOutputDirectory)\Release\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
ContinueOnError="false" />
</Target>
<!-- Run the scenario tests -->
<Target Name="ScenarioTest">
<Message Importance="high" Text="Running scenario tests..." />
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
<Message Importance="high" Text="Scenario tests:" />
<Exec
Command="MSTest.exe /testcontainer:$(TestAssemblyName) /resultsfile:$(TestOutputDirectory)\FullTestRun.trx"
ContinueOnError="false" />
</Target>
<!-- Run the scenario tests -->
<Target Name="DailyBvtRun">
<Message Importance="high" Text="Running DailyBvtRun tests..." />
<Message Importance="high" Text="You are required to have installed a version of Visual Studio with support for MSTest (and MSTest on your path)." />
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
<Message Importance="high" Text="DailyBvtRun tests:" />
<Exec
Command="MSTest.exe /testcontainer:$(TestAssemblyName) /resultsfile:$(TestOutputDirectory)\DailyBvtRun.trx /category:DailyBvtRun"
ContinueOnError="false" />
</Target>
<Target
Name="FullWithScenarioTests"
DependsOnTargets="Clean;BuildDebug;BuildRelease;ScenarioTest" />
</Project>