# Build pipeline for the didvan app — clean, fetch deps, then release APK. # Usage: .\build.ps1 # Stops at the first failure. $ErrorActionPreference = 'Stop' Write-Host '==> flutter clean' -ForegroundColor Cyan flutter clean if ($LASTEXITCODE -ne 0) { throw "flutter clean failed" } Write-Host '==> flutter pub get' -ForegroundColor Cyan flutter pub get if ($LASTEXITCODE -ne 0) { throw "flutter pub get failed" } Write-Host '==> flutter build apk --release' -ForegroundColor Cyan flutter build apk --release if ($LASTEXITCODE -ne 0) { throw "flutter build failed" } $apk = 'build\app\outputs\flutter-apk\app-release.apk' if (Test-Path $apk) { $sizeMb = [math]::Round((Get-Item $apk).Length / 1MB, 1) Write-Host "==> Done. APK at $apk ($sizeMb MB)" -ForegroundColor Green } else { Write-Host '==> Done, but expected APK not found.' -ForegroundColor Yellow }