mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 06:45:33 +00:00
146 lines
5.4 KiB
PowerShell
146 lines
5.4 KiB
PowerShell
|
|
# Verification script for build environment setup
|
|||
|
|
|
|||
|
|
Write-Host ""
|
|||
|
|
Write-Host "=====================================" -ForegroundColor Cyan
|
|||
|
|
Write-Host " Build Environment Verification" -ForegroundColor Cyan
|
|||
|
|
Write-Host "=====================================" -ForegroundColor Cyan
|
|||
|
|
Write-Host ""
|
|||
|
|
|
|||
|
|
$allGood = $true
|
|||
|
|
|
|||
|
|
# Check GODOT environment variable
|
|||
|
|
Write-Host "Checking GODOT environment variable..." -ForegroundColor Cyan
|
|||
|
|
if ([string]::IsNullOrWhiteSpace($env:GODOT)) {
|
|||
|
|
Write-Host " ✗ GODOT environment variable is not set" -ForegroundColor Red
|
|||
|
|
Write-Host " Run: `$env:GODOT = 'C:\Path\To\Godot.exe'" -ForegroundColor Yellow
|
|||
|
|
$allGood = $false
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ✓ GODOT = $env:GODOT" -ForegroundColor Green
|
|||
|
|
|
|||
|
|
if (Test-Path $env:GODOT) {
|
|||
|
|
Write-Host " ✓ Godot executable exists" -ForegroundColor Green
|
|||
|
|
|
|||
|
|
try {
|
|||
|
|
$version = & $env:GODOT --version 2>&1 | Select-Object -First 1
|
|||
|
|
Write-Host " ✓ Version: $version" -ForegroundColor Green
|
|||
|
|
} catch {
|
|||
|
|
Write-Host " ⚠ Could not get Godot version" -ForegroundColor Yellow
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ✗ Godot executable not found at specified path" -ForegroundColor Red
|
|||
|
|
$allGood = $false
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Write-Host ""
|
|||
|
|
|
|||
|
|
# Check GitVersion
|
|||
|
|
Write-Host "Checking GitVersion..." -ForegroundColor Cyan
|
|||
|
|
$gitVersionCmd = Get-Command dotnet-gitversion -ErrorAction SilentlyContinue
|
|||
|
|
if ($gitVersionCmd) {
|
|||
|
|
Write-Host " ✓ GitVersion is installed" -ForegroundColor Green
|
|||
|
|
try {
|
|||
|
|
$gitVersionTest = & dotnet-gitversion /version 2>&1 | Select-Object -First 1
|
|||
|
|
Write-Host " ✓ Version: $gitVersionTest" -ForegroundColor Green
|
|||
|
|
} catch {
|
|||
|
|
Write-Host " ⚠ GitVersion found but may have issues" -ForegroundColor Yellow
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ✗ GitVersion not found" -ForegroundColor Red
|
|||
|
|
Write-Host " Install: dotnet tool install --global GitVersion.Tool" -ForegroundColor Yellow
|
|||
|
|
$allGood = $false
|
|||
|
|
}
|
|||
|
|
Write-Host ""
|
|||
|
|
|
|||
|
|
# Check Butler (optional)
|
|||
|
|
Write-Host "Checking Butler (optional, for publishing)..." -ForegroundColor Cyan
|
|||
|
|
$butlerPath = "F:\Apps\butler\butler.exe"
|
|||
|
|
if (Test-Path $butlerPath) {
|
|||
|
|
Write-Host " ✓ Butler found at: $butlerPath" -ForegroundColor Green
|
|||
|
|
try {
|
|||
|
|
$butlerVersion = & $butlerPath -V 2>&1 | Select-Object -First 1
|
|||
|
|
Write-Host " ✓ Version: $butlerVersion" -ForegroundColor Green
|
|||
|
|
} catch {
|
|||
|
|
Write-Host " ⚠ Butler found but may have issues" -ForegroundColor Yellow
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ⚠ Butler not found (only needed for publishing to itch.io)" -ForegroundColor Yellow
|
|||
|
|
Write-Host " Download: https://itch.io/docs/butler/" -ForegroundColor Gray
|
|||
|
|
}
|
|||
|
|
Write-Host ""
|
|||
|
|
|
|||
|
|
# Check export_presets.cfg
|
|||
|
|
Write-Host "Checking export configuration..." -ForegroundColor Cyan
|
|||
|
|
if (Test-Path "export_presets.cfg") {
|
|||
|
|
Write-Host " ✓ export_presets.cfg exists" -ForegroundColor Green
|
|||
|
|
|
|||
|
|
$presetContent = Get-Content "export_presets.cfg" -Raw
|
|||
|
|
|
|||
|
|
if ($presetContent -match 'name="Windows Desktop"') {
|
|||
|
|
Write-Host " ✓ Windows Desktop preset found" -ForegroundColor Green
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ✗ Windows Desktop preset not found" -ForegroundColor Red
|
|||
|
|
Write-Host " Configure in Godot: Project → Export..." -ForegroundColor Yellow
|
|||
|
|
$allGood = $false
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($presetContent -match 'name="Linux"') {
|
|||
|
|
Write-Host " ✓ Linux preset found" -ForegroundColor Green
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ✗ Linux preset not found" -ForegroundColor Red
|
|||
|
|
Write-Host " Configure in Godot: Project → Export..." -ForegroundColor Yellow
|
|||
|
|
$allGood = $false
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ✗ export_presets.cfg not found" -ForegroundColor Red
|
|||
|
|
Write-Host " Configure export presets in Godot first" -ForegroundColor Yellow
|
|||
|
|
$allGood = $false
|
|||
|
|
}
|
|||
|
|
Write-Host ""
|
|||
|
|
|
|||
|
|
# Check build directories
|
|||
|
|
Write-Host "Checking directory structure..." -ForegroundColor Cyan
|
|||
|
|
if (Test-Path ".\build") {
|
|||
|
|
Write-Host " ✓ build directory exists" -ForegroundColor Green
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ⚠ build directory will be created on first run" -ForegroundColor Gray
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (Test-Path ".\release") {
|
|||
|
|
Write-Host " ✓ release directory exists" -ForegroundColor Green
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ⚠ release directory will be created on first publish" -ForegroundColor Gray
|
|||
|
|
}
|
|||
|
|
Write-Host ""
|
|||
|
|
|
|||
|
|
# Check if in git repository
|
|||
|
|
Write-Host "Checking Git repository..." -ForegroundColor Cyan
|
|||
|
|
if (Test-Path ".git") {
|
|||
|
|
Write-Host " ✓ Git repository detected" -ForegroundColor Green
|
|||
|
|
|
|||
|
|
try {
|
|||
|
|
$gitBranch = git rev-parse --abbrev-ref HEAD 2>&1
|
|||
|
|
Write-Host " ✓ Current branch: $gitBranch" -ForegroundColor Green
|
|||
|
|
} catch {
|
|||
|
|
Write-Host " ⚠ Could not get git branch" -ForegroundColor Yellow
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ⚠ Not a git repository (GitVersion may not work properly)" -ForegroundColor Yellow
|
|||
|
|
}
|
|||
|
|
Write-Host ""
|
|||
|
|
|
|||
|
|
# Summary
|
|||
|
|
Write-Host "=====================================" -ForegroundColor Cyan
|
|||
|
|
if ($allGood) {
|
|||
|
|
Write-Host " ✓ Environment Setup Complete!" -ForegroundColor Green
|
|||
|
|
Write-Host " You can now run BuildPublish.bat" -ForegroundColor Green
|
|||
|
|
} else {
|
|||
|
|
Write-Host " ✗ Setup Incomplete" -ForegroundColor Red
|
|||
|
|
Write-Host " Please fix the issues above" -ForegroundColor Yellow
|
|||
|
|
Write-Host " See SETUP_GUIDE.md for details" -ForegroundColor Yellow
|
|||
|
|
}
|
|||
|
|
Write-Host "=====================================" -ForegroundColor Cyan
|
|||
|
|
Write-Host ""
|
|||
|
|
|
|||
|
|
if (-not $allGood) {
|
|||
|
|
exit 1
|
|||
|
|
}
|