-
Notifications
You must be signed in to change notification settings - Fork 9
/
Generate-Bindings.ps1
58 lines (52 loc) · 1.36 KB
/
Generate-Bindings.ps1
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
<#
.SYNOPSIS
Evergine bindings generator script, (c) 2022 Evergine Team
.DESCRIPTION
This script generates WebGPU bindings used in Evergine
It's meant to have the same behavior when executed locally as when it's executed in a CI pipeline.
.EXAMPLE
<script>
.LINK
https://evergine.com/
#>
param (
[string]$buildVerbosity = "normal",
[string]$buildConfiguration = "Release"
)
# Set csproj path
$webGPUGenCsprojPath = "WebGPUGen\WebGPUGen\WebGPUGen.csproj"
# Utility functions
function LogDebug($line)
{ Write-Host "##[debug] $line" -Foreground Blue -Background Black
}
# Show variables
LogDebug "############## VARIABLES ##############"
LogDebug "Build configuration.: $buildConfiguration"
LogDebug "Build verbosity.....: $buildVerbosity"
LogDebug "#######################################"
# Compile generator
LogDebug "START generator build process"
dotnet publish -v:$buildVerbosity -p:Configuration=$buildConfiguration $webGPUGenCsprojPath
if($?)
{
LogDebug "END generator build process"
}
else
{
LogDebug "ERROR; Generator build failed"
exit -1
}
# Run generator
LogDebug "START binding generator process"
pushd .\WebGPUGen\WebGPUGen\bin\Release\net8.0\win-x64
.\publish\WebGPUGen.exe
if($?)
{
LogDebug "END binding generator process"
}
else
{
LogDebug "ERROR; Binding Generation failed"
exit -1
}
popd