[Android|Windows|macOS|iOS] Rework flutter build helpers #5
@@ -15,10 +15,6 @@
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
.\flutter-build-apk.ps1 -buildType debug -buildName 1.0.0
|
.\flutter-build-apk.ps1 -buildType debug -buildName 1.0.0
|
||||||
Builds a debug APK with version 1.0.0.
|
Builds a debug APK with version 1.0.0.
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
.\flutter-build-apk.ps1 -Help
|
|
||||||
Displays this help message.
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
@@ -66,7 +62,7 @@ $buildsMap | ConvertTo-Json | Out-File $buildsRef
|
|||||||
$apkDir = "..\build\app\outputs\flutter-apk"
|
$apkDir = "..\build\app\outputs\flutter-apk"
|
||||||
$baseName = "org.igox.apps.android.busylight-buddy"
|
$baseName = "org.igox.apps.android.busylight-buddy"
|
||||||
|
|
||||||
# Build APK using an array for arguments
|
# Build an array for arguments
|
||||||
$flutterArgs = @(
|
$flutterArgs = @(
|
||||||
"--$buildType",
|
"--$buildType",
|
||||||
"--build-name=$buildName",
|
"--build-name=$buildName",
|
||||||
|
|||||||
@@ -1,22 +1,55 @@
|
|||||||
$buildName = if ($args[1]) { $args[1] } else { "0.0.0" }
|
<#
|
||||||
$buildNumber = "$(Get-Date -Format 'yyyyMMddHHmmss')"
|
.SYNOPSIS
|
||||||
|
Builds a Flutter Windows installer with versioning support.
|
||||||
|
|
||||||
cd $PSScriptRoot
|
.DESCRIPTION
|
||||||
|
This script builds a Flutter Windows application and creates an installer using Inno Setup.
|
||||||
|
|
||||||
|
.PARAMETER buildType
|
||||||
|
The build type (release or debug). Default is "release".
|
||||||
|
|
||||||
|
.PARAMETER buildName
|
||||||
|
The build name (version). Default is "0.0.0".
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
.\build-windows-installer.ps1 -buildType debug -buildName 1.0.0
|
||||||
|
Builds a debug Windows application with version 1.0.0.
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding()]
|
||||||
|
param (
|
||||||
|
[string]$buildType = "release", # Default value is "release"
|
||||||
|
[string]$buildName = "0.0.0" # Default value is "0.0.0"
|
||||||
|
)
|
||||||
|
|
||||||
|
$buildNumber = "$(Get-Date -Format 'yyyyMMddHHmmss')"
|
||||||
|
|
||||||
# Define the file path and the new version value
|
# Define the file path and the new version value
|
||||||
$issTplFile = "./busylight-buddy-windows-installer-builder.iss.tpl"
|
$issTplFile = "./busylight-buddy-windows-installer-builder.iss.tpl"
|
||||||
$issFile = "./busylight-buddy-windows-installer-builder.iss"
|
$issFile = "./busylight-buddy-windows-installer-builder.iss"
|
||||||
|
|
||||||
# Read the content of the file
|
cd $PSScriptRoot
|
||||||
|
|
||||||
|
# Build an array for arguments
|
||||||
|
$flutterArgs = @(
|
||||||
|
"--$buildType",
|
||||||
|
"--build-name=$buildName",
|
||||||
|
"--build-number=$buildNumber"
|
||||||
|
)
|
||||||
|
|
||||||
|
Write-Output "Building Windows application with arguments: $($flutterArgs -join ' ')"
|
||||||
|
|
||||||
|
# Build the Windows application using Flutter
|
||||||
|
flutter build windows @flutterArgs
|
||||||
|
|
||||||
|
# Build the Windows installer using Inno Setup Compiler (ISCC.exe)
|
||||||
|
# Read the content of Inno Setup template file
|
||||||
$content = Get-Content -Path $issTplFile -Raw
|
$content = Get-Content -Path $issTplFile -Raw
|
||||||
|
|
||||||
# Replace the placeholder with the new version value
|
# Replace the placeholder with the new version value
|
||||||
$updatedContent = $content -replace '%%MyAppVersion%%', $buildName
|
$updatedContent = $content -replace '%%MyAppVersion%%', $buildName
|
||||||
|
|
||||||
# Write the updated content back to the file
|
# Write the updated content back to Inno Setup file
|
||||||
$updatedContent | Set-Content -Path $issFile
|
$updatedContent | Set-Content -Path $issFile
|
||||||
|
|
||||||
# Build the Windows application using Flutter
|
|
||||||
flutter build windows --build-name=$buildName --build-number=$buildNumber
|
|
||||||
# Build the Windows installer using Inno Setup Compiler (ISCC.exe)
|
|
||||||
ISCC.exe $issFile
|
ISCC.exe $issFile
|
||||||
Reference in New Issue
Block a user