Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-05 15:22:31 +08:00
parent 9b145b525a
commit 0bcc1a7f12
10 changed files with 92 additions and 93 deletions

73
lib/scripts/patch.ps1 Normal file
View File

@@ -0,0 +1,73 @@
param(
[string]$platform = ""
)
# TODO: remove
# https://github.com/flutter/flutter/issues/182468
$ToolTipFix = "56956c33ef102ac0b5fc46b62bd2dd9f50a86616";
# TODO: remove
# https://github.com/flutter/flutter/issues/182281
$NewOverScrollIndicator = "362b1de29974ffc1ed6faa826e1df870d7bec75f";
$BottomSheetPatch = "lib/scripts/bottom_sheet.patch"
# TODO: remove
# https://github.com/flutter/flutter/issues/90223
$ModalBarrierPatch = "lib/scripts/modal_barrier.patch"
# TODO: remove
# https://github.com/flutter/flutter/issues/182466
$MouseCursorPatch = "lib/scripts/mouse_cursor.patch"
Set-Location $env:FLUTTER_ROOT
$picks = @()
$reverts = @()
$patches = @($ModalBarrierPatch, $MouseCursorPatch)
switch ($platform.ToLower()) {
"android" {
$reverts += $NewOverScrollIndicator
$patches += $BottomSheetPatch
}
"ios" {}
"linux" {
$picks += $ToolTipFix
}
"macos" {
$picks += $ToolTipFix
}
"windows" {
$picks += $ToolTipFix
}
default {}
}
git config --global user.name "ci"
git config --global user.email "example@example.com"
foreach ($pick in $picks) {
git stash
git cherry-pick $pick --no-edit
if ($LASTEXITCODE -eq 0) {
git reset --soft HEAD~1
Write-Host "$pick picked"
}
git stash pop
}
foreach ($revert in $reverts) {
git stash
git revert $revert --no-edit
if ($LASTEXITCODE -eq 0) {
git reset --soft HEAD~1
Write-Host "$revert reverted"
}
git stash pop
}
foreach ($patch in $patches) {
git apply "$env:GITHUB_WORKSPACE/$patch"
if ($LASTEXITCODE -eq 0) {
Write-Host "$patch applied"
}
}