diff --git a/build_all.ps1 b/build_all.ps1 new file mode 100644 index 00000000..dbbe56e7 --- /dev/null +++ b/build_all.ps1 @@ -0,0 +1,56 @@ +# Cerca ricorsivamente solo le soluzioni che iniziano con 'IOB-WIN-' +$pattern = "IOB-WIN-*.sln" +$solutions = Get-ChildItem -Path . -Filter $pattern -Recurse + +if ($solutions.Count -eq 0) { + Write-Host "āš ļø Nessuna soluzione trovata che corrisponde al pattern: $pattern" -ForegroundColor Yellow + Exit +} + +Write-Host "šŸš€ Trovate $($solutions.Count) soluzioni da verificare." -ForegroundColor Magenta + +# Inizializzazione variabili per il riepilogo +$successCount = 0 +$failCount = 0 +$failedSolutions = @() + +foreach ($sol in $solutions) { + Write-Host "`n--------------------------------------------------" -ForegroundColor Cyan + Write-Host "Compilazione in corso: $($sol.Name)" -ForegroundColor White + Write-Host "--------------------------------------------------" -ForegroundColor Cyan + + # Esegue la compilazione + dotnet build $sol.FullName --configuration Debug --no-incremental + + if ($LASTEXITCODE -ne 0) { + Write-Host "āŒ Errore nella compilazione di $($sol.Name)" -ForegroundColor Red + $failCount++ + $failedSolutions += $sol.Name + } + else { + Write-Host "āœ… $($sol.Name) compilata con successo!" -ForegroundColor Green + $successCount++ + } +} + +# Determina il colore del testo per i fallimenti in modo retrocompatibile +$failColor = "Gray" +if ($failCount -gt 0) { $failColor = "Red" } + +# --- RIEPILOGO FINALE --- +Write-Host "`n==================================================" -ForegroundColor Magenta +Write-Host " šŸ Processo di verifica completato!" -ForegroundColor Magenta +Write-Host "==================================================" -ForegroundColor Magenta +Write-Host " Successi: $successCount" -ForegroundColor Green +Write-Host " Falliti: $failCount" -ForegroundColor $failColor + +if ($failCount -gt 0) { + Write-Host "`nāŒ Elenco delle soluzioni fallite:" -ForegroundColor Red + foreach ($failed in $failedSolutions) { + Write-Host " - $failed" -ForegroundColor Red + } +} +else { + Write-Host "`nšŸŽ‰ Ottimo! Tutte le soluzioni sono state compilate senza errori." -ForegroundColor Green +} +Write-Host "==================================================" -ForegroundColor Magenta \ No newline at end of file