|
|
@@ -6,16 +6,28 @@ function Get-LatestDirectory {
|
|
|
Get-ChildItem -Path $Path | Where-Object {$_.PSIsContainer} | Sort-Object LastWriteTime -Descending | Select-Object -First 1
|
|
|
}
|
|
|
|
|
|
-Push-Location $PSScriptRoot
|
|
|
-
|
|
|
-$official_build_path = "flipperzero-firmware_official\build"
|
|
|
-$unleashed_build_path = "flipperzero-firmware_unleashed\build"
|
|
|
+$build_commands = @(
|
|
|
+ [PSCustomObject]@{
|
|
|
+ Name = "Official Dev";
|
|
|
+ FbtSwitch = "od";
|
|
|
+ FirmwarePath = "flipperzero-firmware_official_dev";
|
|
|
+ ArtifactName = "totp_official-dev-fw.fap"
|
|
|
+ }
|
|
|
+ [PSCustomObject]@{
|
|
|
+ Name = "Official Stable";
|
|
|
+ FbtSwitch = "os";
|
|
|
+ FirmwarePath = "flipperzero-firmware_official_stable";
|
|
|
+ ArtifactName = "totp_official-stable-fw.fap"
|
|
|
+ }
|
|
|
+ [PSCustomObject]@{
|
|
|
+ Name = "Unleashed";
|
|
|
+ FbtSwitch = "u";
|
|
|
+ FirmwarePath = "flipperzero-firmware_unleashed";
|
|
|
+ ArtifactName = "totp_unleashed-fw.fap"
|
|
|
+ }
|
|
|
+)
|
|
|
|
|
|
-Remove-Item "$official_build_path\*" -Recurse -Force
|
|
|
-Remove-Item "$unleashed_build_path\*" -Recurse -Force
|
|
|
-
|
|
|
-./fbt u COMPACT=1 DEBUG=0 VERBOSE=0 fap_totp
|
|
|
-./fbt o COMPACT=1 DEBUG=0 VERBOSE=0 fap_totp
|
|
|
+Push-Location $PSScriptRoot
|
|
|
|
|
|
if (!(Test-Path -PathType Container "build")) {
|
|
|
New-Item -ItemType Directory -Path "build"
|
|
|
@@ -23,10 +35,20 @@ if (!(Test-Path -PathType Container "build")) {
|
|
|
Remove-Item "build\*" -Recurse -Force
|
|
|
}
|
|
|
|
|
|
-$official_latest_dir = Get-LatestDirectory -Path $official_build_path
|
|
|
-Copy-Item "$official_build_path\$official_latest_dir\.extapps\totp.fap" -Destination "build\totp_official-fw.fap"
|
|
|
+foreach ($build_command in $build_commands) {
|
|
|
+ Write-Host "Building $($build_command.Name)"
|
|
|
+ $build_path = Join-Path -Path $build_command.FirmwarePath -ChildPath "build"
|
|
|
+ if (Test-Path -PathType Container $build_path) {
|
|
|
+ Remove-Item "$build_path\*" -Recurse -Force
|
|
|
+ }
|
|
|
|
|
|
-$unleashed_latest_dir = Get-LatestDirectory -Path $unleashed_build_path
|
|
|
-Copy-Item "$unleashed_build_path\$unleashed_latest_dir\.extapps\totp.fap" -Destination "build\totp_unleashed-fw.fap"
|
|
|
+ ./fbt $build_command.FbtSwitch COMPACT=1 DEBUG=0 VERBOSE=0 fap_totp
|
|
|
+
|
|
|
+ $latest_dir = Get-LatestDirectory -Path $build_path
|
|
|
+ $build_output_artifact = "build\$($build_command.ArtifactName)"
|
|
|
+ Copy-Item "$build_path\$latest_dir\.extapps\totp.fap" -Destination $build_output_artifact
|
|
|
+
|
|
|
+ Write-Host "Artifacts for $($build_command.Name) stored at $build_output_artifact"
|
|
|
+}
|
|
|
|
|
|
Pop-Location
|