cirnogodot/Export.ps1

46 lines
1.7 KiB
PowerShell
Raw Permalink Normal View History

2026-02-07 22:31:11 +01:00
# Export Script for Cirno No Reason
# Exports game builds for Windows and Linux platforms
# Import the module
$modulePath = Join-Path $PSScriptRoot "CirnoBuild.psm1"
Import-Module $modulePath -Force
# Configuration
2025-03-05 16:22:57 +01:00
$godotPath = $env:GODOT
2025-02-24 17:17:46 +01:00
$buildDir = ".\build"
2026-02-07 22:31:11 +01:00
$platforms = Get-PlatformConfigurations
# Validate prerequisites
$prereqResult = Test-Prerequisites -GodotPath $godotPath -SkipButler
if (-not $prereqResult.Valid) {
exit 1
}
# Use resolved path if available
if ($prereqResult.ResolvedGodotPath) {
$godotPath = $prereqResult.ResolvedGodotPath
2025-02-24 17:17:46 +01:00
}
2026-02-07 22:31:11 +01:00
Write-Host "Using Godot at: $godotPath" -ForegroundColor Green
Write-Host ""
# Step 1: Clear the build directory
Write-Host "Clearing build directory..."
Initialize-BuildDirectories -PlatformsToBuild @("win", "linux") -BuildDir $buildDir
2025-02-24 17:17:46 +01:00
# Step 2: Get version data from GitVersion
2026-02-07 22:31:11 +01:00
$versionInfo = Get-VersionInfo
2025-02-24 17:17:46 +01:00
# Step 3: Update export_presets.cfg
2026-02-07 22:31:11 +01:00
Update-ExportConfig -VersionInfo $versionInfo
# Step 4: Export builds
$results = @{}
foreach ($platformKey in $platforms.Keys) {
Write-Host ""
$results[$platformKey] = Export-GodotPlatform -Platform $platformKey `
-GodotPath $godotPath `
-BuildDir $buildDir `
-VersionInfo $versionInfo
}
Write-Host ""
Write-Host "=====================================" -ForegroundColor Cyan
Write-Host " Export Summary" -ForegroundColor Cyan
Write-Host "=====================================" -ForegroundColor Cyan
foreach ($platformKey in $results.Keys) {
$status = if ($results[$platformKey]) { "SUCCESS" } else { "FAILED" }
$color = if ($results[$platformKey]) { "Green" } else { "Red" }
Write-Host " $platformKey : $status" -ForegroundColor $color
2025-02-24 17:17:46 +01:00
}
2026-02-07 22:31:11 +01:00
Write-Host ""