forked from dexyfex/CodeWalker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-init.ps1
More file actions
27 lines (21 loc) · 923 Bytes
/
build-init.ps1
File metadata and controls
27 lines (21 loc) · 923 Bytes
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
# Build initialization script for CodeWalker
# Restores NuGet packages using MSBuild
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
# Import the Find-MSBuild function
. "$PSScriptRoot\Find-MSBuild.ps1"
# Find MSBuild (will exit if not found)
$msbuild = Find-MSBuild
Write-Host "Using MSBuild: $msbuild" -ForegroundColor Cyan
Write-Host "Restoring NuGet packages with MSBuild..." -ForegroundColor Cyan
# Use MSBuild to restore - this avoids .NET SDK compatibility issues
& $msbuild CodeWalker.sln /t:Restore /p:Configuration=Release "/p:Platform=x64" /v:minimal
if ($LASTEXITCODE -eq 0) {
Write-Host ""
Write-Host "NuGet packages restored successfully." -ForegroundColor Green
Write-Host "Run 'powershell -ExecutionPolicy Bypass -File build.ps1' to build the solution." -ForegroundColor Yellow
} else {
Write-Host ""
Write-Host "NuGet restore failed!" -ForegroundColor Red
exit 1
}