Skip to content

Commit 26e3f81

Browse files
committed
Build script
1 parent 0f0832f commit 26e3f81

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

Release/build_all.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
param (
2+
[string]$target = "build"
3+
)
4+
5+
$script:startTime = get-date
6+
7+
function GetElapsedTime() {
8+
$runtime = $(get-date) - $script:StartTime
9+
$retStr = [string]::format("{0} hours, {1} minutes, {2}.{3} seconds", `
10+
($runtime.Days * 24 + $runtime.Hours), $runtime.Minutes, $runtime.Seconds, $runtime.Milliseconds)
11+
$retStr
12+
}
13+
14+
$config_params = @(("Win32", "Release"),
15+
("Win32", "Debug"),
16+
("x64", "Release"),
17+
("x64", "Debug"),
18+
("arm", "Release"),
19+
("arm", "Debug"))
20+
21+
if ((Test-Path "dirs.proj") -eq $false)
22+
{
23+
Write-Host ("Error: cannot find dirs.proj in the current directory") -foregroundcolor red
24+
}
25+
else {
26+
27+
foreach($param in $config_params)
28+
{
29+
$plat = $param[0]
30+
$config = $param[1]
31+
Write-Host ("msbuild dirs.proj /p:Platform=$plat /p:Configuration=$config /t:$target") -foregroundcolor Cyan
32+
msbuild dirs.proj /p:Platform=$plat /p:Configuration=$config /t:$target
33+
if($LastExitCode -ne 0)
34+
{
35+
Write-Host ("Error: failure building $plat $config") -foregroundcolor red
36+
break
37+
}
38+
}
39+
}
40+
Write-Host "Elapsed Time: $(GetElapsedTime)"

0 commit comments

Comments
 (0)