forked from stride3d/stride
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXenko.build
393 lines (337 loc) · 22.7 KB
/
Xenko.build
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<?xml version="1.0" encoding="utf-8"?>
<!--
Build file used to build Xenko and package it from the command line.
Example of use:
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild" Xenko.build /t:Package
-->
<Project ToolsVersion="15.0" DefaultTarget="Help" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<XenkoRoot>$(MSBuildThisFileDirectory)..\</XenkoRoot>
<XenkoRootBin>$(XenkoRoot)Bin\Windows\</XenkoRootBin>
<XenkoPackage>$(XenkoRoot)Xenko.xkpkg</XenkoPackage>
<XenkoSolution>$(XenkoRoot)build\Xenko</XenkoSolution>
<BuildProperties>Configuration=Release;NoWarn=1591;DeployExtension=false</BuildProperties>
<BuildProperties Condition="'$(XenkoSign)' != ''">$(BuildProperties);XenkoSign=$(XenkoSign)</BuildProperties>
<BuildProperties Condition="'$(XenkoOfficialBuild)' != ''">$(BuildProperties);XenkoOfficialBuild=$(XenkoOfficialBuild)</BuildProperties>
<NuGetPath>$(MSBuildThisFileDirectory).nuget\NuGet.exe</NuGetPath>
<XunitRunnerConsoleVersion>2.3.1</XunitRunnerConsoleVersion>
<XenkoStoreUrl Condition="'$(XenkoStoreUrl)' == ''">https://xenko-packages.azurewebsites.net/api/v2/package</XenkoStoreUrl>
<AdvancedInstallerPath Condition="'$(AdvancedInstallerPath)' == '' And Exists('$(MSBuildProgramFiles32)\Caphyon\Advanced Installer 14.4.2\bin\x86\advinst.exe')">$(MSBuildProgramFiles32)\Caphyon\Advanced Installer 14.4.2\bin\x86\advinst.exe</AdvancedInstallerPath>
</PropertyGroup>
<UsingTask TaskName="Xenko.Core.Tasks.PackageUpdateVersionTask" AssemblyFile="$(XenkoRoot)sources\core\Xenko.Core.Tasks\bin\Release\Xenko.Core.Tasks.exe" />
<!-- TODO: those tasks will work only if the Direct3D11 files have been copied to top folder (currently works thanks to BuildEditorShaders being run before) -->
<UsingTask TaskName="Xenko.Assets.Tasks.PackageArchiveTask" AssemblyFile="$(XenkoRootBin)Xenko.Assets.dll" />
<UsingTask TaskName="Xenko.Assets.Tasks.PackageGetVersionTask" AssemblyFile="$(XenkoRootBin)Xenko.Assets.dll" />
<Target Name="Help">
<Message Importance="high" Text="TODO"/>
</Target>
<!--
Package Xenko to a nupkg
-->
<Target Name="Package">
<ItemGroup>
<FilesToDeletePackage Include="$(MSBuildThisFileDirectory)Xenko.??.*.nupkg"/>
</ItemGroup>
<Delete Files="@(FilesToDeletePackage)"/>
<PackageArchiveTask File="$(XenkoPackage)"/>
</Target>
<!--
VSIX Xenko plugin
Don't forget to build for VS2013 by using MSBuild 12.0,
or if you're using a newer version of MSBuild, pass the flag /p:VisualStudioVersion=12.0 when calling MSBuild in the command line.
-->
<Target Name="VSIXPlugin" DependsOnTargets="RestoreWindows">
<ItemGroup>
<FilesToDeleteVSIX Include="$(MSBuildThisFileDirectory)Xenko.VisualStudio.Package.??.*.nupkg"/>
</ItemGroup>
<Delete Files="@(FilesToDeleteVSIX)"/>
<MSBuild Targets="91-VisualStudio\Xenko_VisualStudio_Package;91-VisualStudio\Xenko_VisualStudio_PackageInstall" Projects="$(XenkoSolution).sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>
<Exec Command='"$(NuGetPath)" pack "$(XenkoRoot)sources\tools\Xenko.VisualStudio.Package\Xenko.VisualStudio.Package.nuspec" -BasePath "$(XenkoRoot)sources\tools\Xenko.VisualStudio.Package"' />
</Target>
<!--
Package Installer: install-prerequisites.exe
-->
<Target Name="PrerequisitesInstaller">
<Delete Files="$(XenkoRoot)Bin\Prerequisites\install-prerequisites.exe"/>
<Exec Command='"$(AdvancedInstallerPath)" /rebuild "$(XenkoRoot)sources\prerequisites\prerequisites.aip"'/>
<Copy SourceFiles="$(XenkoRoot)sources\prerequisites\install-prerequisites.exe" DestinationFolder="$(XenkoRoot)Bin\Prerequisites"/>
</Target>
<!--
Perform a full build: Build, Package
-->
<Target Name="FullBuild">
<CallTarget Targets="Build"/>
<CallTarget Targets="Package"/>
<CallTarget Targets="PrerequisitesInstaller"/>
<CallTarget Targets="VSIXPlugin"/>
</Target>
<!--
Publish Xenko nupkg from this folder to the store
-->
<Target Name="Publish">
<Error Condition="'$(XenkoStoreApiKey)' == ''" Text="Missing env variable XenkoStoreApiKey"/>
<!-- Waiting 30min in case NuGet.Gallery/Server takes time to process -->
<Exec Command='"$(NuGetPath)" push Xenko.??.*.nupkg -ApiKey $(XenkoStoreApiKey) -Source $(XenkoStoreUrl) -Timeout 1800 '/>
</Target>
<!--
Publish VSIX nupkg from this folder to the store
-->
<Target Name="PublishVSIX">
<Error Condition="'$(XenkoStoreApiKey)' == ''" Text="Missing env variable XenkoStoreApiKey"/>
<Exec Command='"$(NuGetPath)" push Xenko.VisualStudio.Package.??.*.nupkg -ApiKey $(XenkoStoreApiKey) -Source $(XenkoStoreUrl) "'/>
</Target>
<!--
Build Xenko: Windows, Android, iOS, Windows 10 (UWP)
-->
<Target Name="Clean">
<Exec Command="RMDIR /Q /S $(XenkoRoot)\Bin"/>
</Target>
<!-- Package -->
<Target Name="PreparePackageBuild" DependsOnTargets="RestoreWindows">
<PropertyGroup>
<BuildProperties>$(BuildProperties);XenkoGenerateDoc=true;XenkoPackageBuild=true</BuildProperties>
</PropertyGroup>
<!-- Make sure Xenko.Core.Assets is built to run the task to update package version.
It might be better to move it to a prebuilt assembly if that becomes a problem.
-->
<MSBuild Targets="30-CoreDesign\Xenko_Core_Tasks" Projects="$(XenkoSolution).sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>
<!-- Create SharedAssemblyInfo.NuGet.cs with Git information (different between official build and internal builds) -->
<PackageUpdateVersionTask Condition="'$(XenkoOfficialBuild)' == 'true'" PackageFile="$(XenkoPackage)" VersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.cs" GeneratedVersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.NuGet.cs" />
<PackageUpdateVersionTask Condition="'$(XenkoOfficialBuild)' != 'true'" PackageFile="$(XenkoPackage)" VersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.cs" GeneratedVersionFile="$(XenkoRoot)sources\shared\SharedAssemblyInfo.NuGet.cs" SpecialVersion="beta" SpecialVersionGitHeight="true" SpecialVersionGitCommit="true" />
</Target>
<Target Name="BuildForPackageMinimal" DependsOnTargets="PreparePackageBuild;BuildWindows;BuildEditorShaders;VSIXPlugin"/>
<Target Name="BuildForPackage" DependsOnTargets="PreparePackageBuild;BuildWindows;BuildWindowsDirect3D12;BuildWindowsOpenGL;BuildWindowsOpenGLES;BuildEditorShaders;BuildAndroid;BuildiOS;BuildUWP;BuildWindowsVulkan;BuildLinux;BuildLinuxVulkan;VSIXPlugin"/>
<Target Name="GeneratePackage" DependsOnTargets="PreparePackageBuild;PrerequisitesInstaller;Package;WritePackageVersionToFile"/>
<Target Name="CopyXenkoKey">
<Copy Condition="'$(XenkoSign)' == 'true' And Exists('$(LOCALAPPDATA)\Xenko\XenkoBuildKey\xenko.snk')" SourceFiles="$(LOCALAPPDATA)\Xenko\XenkoBuildKey\xenko.snk" DestinationFolder="$(MSBuildThisFileDirectory)"/>
</Target>
<Target Name="BuildEditorShaders">
<Exec Command="$(XenkoRoot)sources\editor\Xenko.Assets.Presentation\EditorPackage\generate-editor-package.bat" WorkingDirectory="$(XenkoRoot)sources\editor\Xenko.Assets.Presentation\EditorPackage"/>
</Target>
<Target Name="RestoreWindows">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).sln"' />
</Target>
<Target Name="BuildWindows" DependsOnTargets="CopyXenkoKey;RestoreWindows">
<MSBuild Targets="Build" Projects="$(XenkoSolution).sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>
</Target>
<Target Name="BuildWindowsDirect3D11" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).Direct3D.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).Direct3D.sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>
</Target>
<Target Name="BuildWindowsDirect3D12" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).Direct3D12.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).Direct3D12.sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>
</Target>
<Target Name="BuildWindowsOpenGL" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).OpenGL.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).OpenGL.sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>
</Target>
<Target Name="BuildWindowsOpenGLES" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).OpenGLES.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).OpenGLES.sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>
</Target>
<Target Name="BuildAndroid" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).Android.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).Android.sln" Properties="$(BuildProperties);Platform=Android"/>
</Target>
<Target Name="BuildiOS" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).iOS.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).iOS.sln" Properties="$(BuildProperties);Platform=iPhone"/>
</Target>
<Target Name="BuildWindowsStore" DependsOnTargets="CopyXenkoKey">
<!-- Only a warning since build servers might still call this target for old branches -->
<Warning Text="Windows Store doesn't exist anymore"/>
</Target>
<Target Name="BuildWindows10" DependsOnTargets="BuildUWP" />
<Target Name="BuildUWP" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).UWP.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).UWP.sln" Properties="$(BuildProperties);Platform=UWP"/>
</Target>
<Target Name="BuildWindowsPhone" DependsOnTargets="CopyXenkoKey">
<!-- Only a warning since build servers might still call this target for old branches -->
<Warning Text="Windows Phone doesn't exist anymore"/>
</Target>
<Target Name="BuildWindowsVulkan" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).Vulkan.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).Vulkan.sln" Properties="$(BuildProperties);Platform=Mixed Platforms"/>
</Target>
<Target Name="BuildLinux" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).Linux.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).Linux.sln" Properties="$(BuildProperties);Platform=Linux"/>
</Target>
<Target Name="BuildLinuxVulkan" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).Linux.Vulkan.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).Linux.Vulkan.sln" Properties="$(BuildProperties);Platform=Linux"/>
</Target>
<Target Name="BuildmacOS" DependsOnTargets="CopyXenkoKey">
<Exec Command='"$(NuGetPath)" restore "$(XenkoSolution).macOS.sln"' />
<MSBuild Targets="Build" Projects="$(XenkoSolution).macOS.sln" Properties="$(BuildProperties);Platform=macOS"/>
</Target>
<Target Name="WritePackageVersionToFile">
<PackageGetVersionTask File="$(XenkoPackage)">
<Output TaskParameter="NuGetVersion" PropertyName="XenkoPackageVersion"/>
</PackageGetVersionTask>
<Delete Files="$(MSBuildThisFileDirectory)Xenko.version"/>
<WriteLinesToFile File="$(MSBuildThisFileDirectory)Xenko.version" Lines="$(XenkoPackageVersion)" />
</Target>
<Target Name="DownloadXunitRunnerConsole">
<MakeDir Directories="$(MSBuildThisFileDirectory)packages"/>
<PropertyGroup>
<XunitRunnerConsolePath>$(MSBuildThisFileDirectory)packages\xunit.runner.console.$(XunitRunnerConsoleVersion)\tools\net452\xunit.console.exe</XunitRunnerConsolePath>
</PropertyGroup>
<Exec Command='"$(NuGetPath)" install xunit.runner.console -Version $(XunitRunnerConsoleVersion)' Condition="!Exists('$(XunitRunnerConsolePath)')" WorkingDirectory="$(MSBuildThisFileDirectory)packages" />
<Error Text="Could not find xunit.runner at expected location [$(XunitRunnerConsolePath)]" Condition="!Exists('$(XunitRunnerConsolePath)')"/>
</Target>
<Target Name="RunTestsWindows" DependsOnTargets="DownloadXunitRunnerConsole">
<!-- By default, enable all known categories -->
<PropertyGroup>
<XenkoTestCategories Condition="'$(XenkoTestCategories)' == ''">Simple;Game;VSPackage</XenkoTestCategories>
<!-- We enclose everything with ;, so that we could do full word matches more easily with string.Contains() -->
<XenkoTestCategories>;$(XenkoTestCategories);</XenkoTestCategories>
<XenkoTestExtraTargets></XenkoTestExtraTargets>
<XenkoTestExtraTargets Condition="$(XenkoTestCategories.Contains(';GameAndroid;'))">$(XenkoTestExtraTargets);SignAndroidPackage</XenkoTestExtraTargets>
</PropertyGroup>
<!-- Simple standalone unit tests -->
<ItemGroup Condition="$(XenkoTestCategories.Contains(';Simple;'))">
<UnitTest Include="11-CoreRuntime.Tests\Xenko.Core.Tests"/>
<UnitTest Include="21-XenkoRuntime.Tests\Xenko.Shaders.Tests.Windows"/>
<UnitTest Include="31-CoreDesign.Tests\Xenko.Core.BuildEngine.Tests"/>
<UnitTest Include="31-CoreDesign.Tests\Xenko.Core.Design.Tests"/>
<UnitTest Include="31-CoreDesign.Tests\Xenko.Core.Yaml.Tests"/>
<UnitTest Include="41-Assets.Tests\Xenko.Core.Assets.Quantum.Tests"/>
<UnitTest Include="41-Assets.Tests\Xenko.Core.Assets.Tests"/>
<UnitTest Include="51-Presentation.Tests\Xenko.Core.Presentation.Quantum.Tests"/>
<UnitTest Include="51-Presentation.Tests\Xenko.Core.Presentation.Tests"/>
<UnitTest Include="51-Presentation.Tests\Xenko.Core.Quantum.Tests"/>
<UnitTest Include="61-Editor.Tests\Xenko.Core.Assets.Editor.Tests"/>
<UnitTest Include="61-Editor.Tests\Xenko.GameStudio.Tests"/>
<UnitTest Include="71-XenkoAssets.Tests\Xenko.Assets.Tests2"/>
</ItemGroup>
<ItemGroup>
<UnitTestGame Include="21-XenkoRuntime.Tests\Xenko.Engine.Tests.Windows"/>
<UnitTestGame Include="21-XenkoRuntime.Tests\Xenko.Graphics.Tests.10_0.Windows"/>
<UnitTestGame Include="21-XenkoRuntime.Tests\Xenko.Graphics.Tests.Windows"/>
<UnitTestGame Include="21-XenkoRuntime.Tests\Xenko.Navigation.Tests.Windows"/>
<UnitTestGame Include="21-XenkoRuntime.Tests\Xenko.Input.Tests.Windows"/>
<UnitTestGame Include="21-XenkoRuntime.Tests\Xenko.Particles.Tests.Windows"/>
<UnitTestGame Include="21-XenkoRuntime.Tests\Xenko.Physics.Tests.Windows"/>
<UnitTestGame Include="21-XenkoRuntime.Tests\Xenko.UI.Tests.Windows"/>
</ItemGroup>
<ItemGroup>
<UnitTestGameAndroid Include="21-XenkoRuntime.Tests\Xenko.Engine.Tests.Android"/>
<UnitTestGameAndroid Include="21-XenkoRuntime.Tests\Xenko.Graphics.Tests.10_0.Android"/>
<UnitTestGameAndroid Include="21-XenkoRuntime.Tests\Xenko.Graphics.Tests.Android"/>
<UnitTestGameAndroid Include="21-XenkoRuntime.Tests\Xenko.Input.Tests.Android"/>
<UnitTestGameAndroid Include="21-XenkoRuntime.Tests\Xenko.Particles.Tests.Android"/>
<UnitTestGameAndroid Include="21-XenkoRuntime.Tests\Xenko.Physics.Tests.Android"/>
<UnitTestGameAndroid Include="21-XenkoRuntime.Tests\Xenko.UI.Tests.Android"/>
</ItemGroup>
<!-- Direct3D11 unit tests -->
<ItemGroup Condition="$(XenkoTestCategories.Contains(';Game;'))">
<UnitTest Include="@(UnitTestGame)"/>
<!-- Other graphics platforms don't support compute shaders and tessellation yet -->
<UnitTest Include="21-XenkoRuntime.Tests\Xenko.Graphics.Tests.11_0.Windows"/>
<UnitTest Include="21-XenkoRuntime.Tests\Xenko.Audio.Tests.Windows"/>
<UnitTest Include="71-XenkoAssets.Tests\Xenko.Assets.Tests"/>
</ItemGroup>
<!-- Unit tests for Visual Studio -->
<ItemGroup Condition="$(XenkoTestCategories.Contains(';VSPackage;'))">
<UnitTest Include="91-VisualStudio\Xenko.VisualStudio.Package.Tests"/>
</ItemGroup>
<!-- Direct3D12 unit tests -->
<ItemGroup Condition="$(XenkoTestCategories.Contains(';GameDirect3D12;'))">
<UnitTestPrerequisites Include="@(UnitTestGame)"/>
<UnitTest Include="@(UnitTestGame)"><Solution>$(XenkoSolution).Direct3D12.sln</Solution></UnitTest>
</ItemGroup>
<!-- OpenGL unit tests -->
<ItemGroup Condition="$(XenkoTestCategories.Contains(';GameOpenGL;'))">
<UnitTestPrerequisites Include="@(UnitTestGame)"/>
<UnitTest Include="@(UnitTestGame)"><Solution>$(XenkoSolution).OpenGL.sln</Solution></UnitTest>
</ItemGroup>
<!-- OpenGLES unit tests -->
<ItemGroup Condition="$(XenkoTestCategories.Contains(';GameOpenGLES;'))">
<UnitTestPrerequisites Include="@(UnitTestGame)"/>
<UnitTest Include="@(UnitTestGame)"><Solution>$(XenkoSolution).OpenGLES.sln</Solution></UnitTest>
</ItemGroup>
<!-- Vulkan unit tests -->
<ItemGroup Condition="$(XenkoTestCategories.Contains(';GameVulkan;'))">
<UnitTestPrerequisites Include="@(UnitTestGame)"/>
<UnitTest Include="@(UnitTestGame)"><Solution>$(XenkoSolution).Vulkan.sln</Solution></UnitTest>
</ItemGroup>
<!-- Android unit tests -->
<ItemGroup Condition="$(XenkoTestCategories.Contains(';GameAndroid;'))">
<UnitTestPrerequisites Include="@(UnitTestGame)"/>
<UnitTest Include="@(UnitTestGameAndroid)"><Solution>$(XenkoSolution).Android.sln</Solution></UnitTest>
</ItemGroup>
<!-- Compute TargetName and default Solution -->
<ItemGroup>
<UnitTestPrerequisites>
<!-- Replace . into _ (needed for .sln targets) -->
<TargetName>$([System.String]::Copy('%(Identity)').Replace('.','_'))</TargetName>
<!-- Default solution -->
<Solution Condition="'%(UnitTestPrerequisites.Solution)' == ''">$(XenkoSolution).sln</Solution>
</UnitTestPrerequisites>
<UnitTest>
<!-- Replace . into _ (needed for .sln targets) -->
<TargetName>$([System.String]::Copy('%(Identity)').Replace('.','_'))</TargetName>
<!-- Default solution -->
<Solution Condition="'%(UnitTest.Solution)' == ''">$(XenkoSolution).sln</Solution>
</UnitTest>
</ItemGroup>
<!-- Restore NuGet packages -->
<Message Importance="High" Text="Restoring NuGet packages"/>
<Exec Condition="'%(UnitTestPrerequisites.Solution)' != ''" Command='"$(NuGetPath)" restore "%(UnitTestPrerequisites.Solution)"' />
<Exec Condition="'%(UnitTest.Solution)' != ''" Command='"$(NuGetPath)" restore "%(UnitTest.Solution)"' />
<!-- First, build prerequisites -->
<Message Importance="High" Text="Building unit test prerequisites from solution %(Solution): @(UnitTestPrerequisites->'%(TargetName)')"/>
<MSBuild Targets="@(UnitTestPrerequisites->'%(TargetName)')" Projects="%(Solution)" Properties="$(BuildProperties);Platform=Mixed Platforms;DeployExtension=true"/>
<!-- Build unit tests -->
<Message Importance="High" Text="Building unit test from solution %(Solution): @(UnitTest->'%(TargetName)')"/>
<MSBuild Targets="@(UnitTest->'%(TargetName)');$(XenkoTestExtraTargets)" Projects="%(Solution)" Properties="$(BuildProperties);DeployExtension=true">
<Output TaskParameter="TargetOutputs" ItemName="AssembliesToTest" />
</MSBuild>
<!-- Run unit tests -->
<MakeDir Directories="$(MSBuildThisFileDirectory)TestResults"/>
<Exec Command=""$(XunitRunnerConsolePath)" @(AssembliesToTest->'%(Identity)', ' ')" WorkingDirectory="$(XenkoRootBin)"/>
</Target>
<ItemGroup>
<MobileUnitTestProject Include="$(XenkoRoot)sources\engine\Xenko.Engine.Tests\Xenko.Engine.Tests.$(PlatformToBuild).csproj"/>
<MobileUnitTestProject Include="$(XenkoRoot)sources\engine\Xenko.Audio.Tests\Xenko.Audio.Tests.$(PlatformToBuild).csproj"/>
<MobileUnitTestProject Include="$(XenkoRoot)sources\engine\Xenko.Graphics.Tests\Xenko.Graphics.Tests.$(PlatformToBuild).csproj"/>
<MobileUnitTestProject Include="$(XenkoRoot)sources\engine\Xenko.Graphics.Tests.10_0\Xenko.Graphics.Tests.10_0.$(PlatformToBuild).csproj"/>
<MobileUnitTestProject Include="$(XenkoRoot)sources\engine\Xenko.Input.Tests\Xenko.Input.Tests.$(PlatformToBuild).csproj"/>
<MobileUnitTestProject Include="$(XenkoRoot)sources\engine\Xenko.Particles.Tests\Xenko.Particles.Tests.$(PlatformToBuild).csproj"/>
<MobileUnitTestProject Include="$(XenkoRoot)sources\engine\Xenko.Physics.Tests\Xenko.Physics.Tests.$(PlatformToBuild).csproj"/>
</ItemGroup>
<ItemGroup>
<MobileUnitTestApk Include="$(XenkoRoot)\Bin\Android\Tests\OpenGLES\Xenko.Engine.Tests\Xenko.Engine.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(XenkoRoot)\Bin\Android\Tests\OpenGLES\Xenko.Physics.Tests\Xenko.Physics.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(XenkoRoot)\Bin\Android\Tests\OpenGLES\Xenko.Audio.Tests\Xenko.Audio.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(XenkoRoot)\Bin\Android\Tests\OpenGLES\Xenko.Graphics.Tests.10_0\Xenko.Graphics.Tests_10_0-Signed.apk"/>
<MobileUnitTestApk Include="$(XenkoRoot)\Bin\Android\Tests\OpenGLES\Xenko.Graphics.Tests\Xenko.Graphics.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(XenkoRoot)\Bin\Android\Tests\OpenGLES\Xenko.Input.Tests\Xenko.Input.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(XenkoRoot)\Bin\Android\Tests\OpenGLES\Xenko.Particles.Tests\Xenko.Particles.Tests-Signed.apk"/>
</ItemGroup>
<Target Name="RunTestsMobile" DependsOnTargets="DownloadXunitRunnerConsole" Outputs="%(MobileUnitTestProject.Identity)">
<PropertyGroup>
<XenkoRoot>$(MSBuildThisFileDirectory)..\</XenkoRoot>
<XenkoRootBin>$(XenkoRoot)Bin\Windows\</XenkoRootBin>
<XenkoPlatform></XenkoPlatform>
<XenkoPlatform Condition="'$(PlatformToBuild)' == 'iOS'">Platform=iPhone</XenkoPlatform>
<XenkoPlatform Condition="'$(PlatformToBuild)' == 'Android'">Platform=Android</XenkoPlatform>
<XenkoBuildOptions></XenkoBuildOptions>
<XenkoBuildOptions Condition="'$(PlatformToBuild)' == 'iOS'">ServerAddress=pc13095;ServerUser=virgile;BuildIpa=true;MtouchUseLlvm=true</XenkoBuildOptions>
<XenkoBuildTargets>Rebuild</XenkoBuildTargets>
<XenkoBuildTargets Condition="'$(PlatformToBuild)' == 'Android'">SignAndroidPackage</XenkoBuildTargets>
<XenkoBuildConfig>Release</XenkoBuildConfig>
<XenkoBuildConfig Condition="'$(PlatformToBuild)' == 'Windows'">Debug</XenkoBuildConfig>
</PropertyGroup>
<MSBuild Projects ="%(MobileUnitTestProject.Identity)" Targets="SignAndroidPackage"
Properties="SolutionName=Xenko.Android; SolutionDir=$(MSBuildThisFileDirectory);$(XenkoPlatform);Configuration=$(XenkoBuildConfig);$(XenkoBuildOptions)">
</MSBuild>
<Exec IgnoreExitCode="True" Command='taskkill /F /FI "Imagename eq Xenko.Core.Assets.CompilerApp*"' />
<Exec Condition="'$(PlatformToBuild)' == 'Android'" Command="$(XenkoRootBin)Xenko.TestRunner.exe %(MobileUnitTestApk.Identity)" WorkingDirectory="$(XenkoRootBin)">
<Output TaskParameter="ExitCode" ItemName="exitCode" />
</Exec>
</Target>
</Project>