diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 403fc8e31..cba54824e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,31 +78,9 @@ jobs: flutter-version-file: pubspec.yaml cache: true - - name: revert new overscrollindicator - working-directory: ${{ env.FLUTTER_ROOT }} - # https://github.com/flutter/flutter/issues/182281 - run: | - git config --global user.name "ci" - git config --global user.email "example@example.com" - git stash || true - git revert 362b1de29974ffc1ed6faa826e1df870d7bec75f --no-edit - git reset --soft HEAD~1 - git stash pop || true - continue-on-error: true - - - name: apply bottom sheet patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/bottom_sheet_patch.diff || true - continue-on-error: true - - - name: apply modal barrier patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/modal_barrier_patch.diff || true - continue-on-error: true - - - name: apply mouse cursor patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/mouse_cursor_patch.diff || true + - name: Apply Patch + shell: pwsh + run: lib/scripts/patch.ps1 android continue-on-error: true - name: Write key @@ -120,10 +98,10 @@ jobs: shell: pwsh run: lib/scripts/build.ps1 android - - name: flutter build apk + - name: Flutter Build Apk run: flutter build apk --release --split-per-abi --dart-define-from-file=pili_release.json --pub - - name: rename + - name: Rename run: | for file in build/app/outputs/flutter-apk/app-*-release.apk; do abi=$(echo "$file" | sed -E 's|.*app-(.*)-release\.apk|\1|') diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 8167269a7..629ae02ef 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -30,14 +30,9 @@ jobs: shell: pwsh run: lib/scripts/build.ps1 - - name: apply modal barrier patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/modal_barrier_patch.diff || true - continue-on-error: true - - - name: apply mouse cursor patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/mouse_cursor_patch.diff || true + - name: Apply Patch + shell: pwsh + run: lib/scripts/patch.ps1 iOS continue-on-error: true - name: Build iOS diff --git a/.github/workflows/linux_x64.yml b/.github/workflows/linux_x64.yml index 6b26e6c0e..65ad9d269 100644 --- a/.github/workflows/linux_x64.yml +++ b/.github/workflows/linux_x64.yml @@ -51,25 +51,9 @@ jobs: shell: pwsh run: lib/scripts/build.ps1 - - name: pick tooltip fix - working-directory: ${{ env.FLUTTER_ROOT }} - run: | - git config --global user.name "ci" - git config --global user.email "example@example.com" - git stash || true - git cherry-pick 56956c33ef102ac0b5fc46b62bd2dd9f50a86616 --no-edit - git reset --soft HEAD~1 - git stash pop || true - continue-on-error: true - - - name: apply modal barrier patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/modal_barrier_patch.diff || true - continue-on-error: true - - - name: apply mouse cursor patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/mouse_cursor_patch.diff || true + - name: Apply Patch + shell: pwsh + run: lib/scripts/patch.ps1 Linux continue-on-error: true #TODO: deb and rpm packages need to be build diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index d4c17b672..0996ac04e 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -30,25 +30,9 @@ jobs: shell: pwsh run: lib/scripts/build.ps1 - - name: pick tooltip fix - working-directory: ${{ env.FLUTTER_ROOT }} - run: | - git config --global user.name "ci" - git config --global user.email "example@example.com" - git stash || true - git cherry-pick 56956c33ef102ac0b5fc46b62bd2dd9f50a86616 --no-edit - git reset --soft HEAD~1 - git stash pop || true - continue-on-error: true - - - name: apply modal barrier patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/modal_barrier_patch.diff || true - continue-on-error: true - - - name: apply mouse cursor patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $GITHUB_WORKSPACE/lib/scripts/mouse_cursor_patch.diff || true + - name: Apply Patch + shell: pwsh + run: lib/scripts/patch.ps1 macOS continue-on-error: true - name: Build Mac diff --git a/.github/workflows/win_x64.yml b/.github/workflows/win_x64.yml index cea62ef43..42d90f278 100644 --- a/.github/workflows/win_x64.yml +++ b/.github/workflows/win_x64.yml @@ -26,27 +26,9 @@ jobs: channel: stable flutter-version-file: pubspec.yaml - - name: pick tooltip fix - working-directory: ${{ env.FLUTTER_ROOT }} - run: | - git config --global user.name "ci" - git config --global user.email "example@example.com" - git stash || true - git cherry-pick 56956c33ef102ac0b5fc46b62bd2dd9f50a86616 --no-edit - git reset --soft HEAD~1 - git stash pop || true - continue-on-error: true - - - name: apply modal barrier patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $env:GITHUB_WORKSPACE\lib\scripts\modal_barrier_patch.diff || true - shell: pwsh - continue-on-error: true - - - name: apply mouse cursor patch - working-directory: ${{ env.FLUTTER_ROOT }} - run: git apply $env:GITHUB_WORKSPACE\lib\scripts\mouse_cursor_patch.diff || true + - name: Apply Patch shell: pwsh + run: lib/scripts/patch.ps1 windows continue-on-error: true - name: Add fastforge and Inno Setup diff --git a/lib/common/widgets/image_viewer/loading_indicator.dart b/lib/common/widgets/image_viewer/loading_indicator.dart index e44850dee..e2516bd3d 100644 --- a/lib/common/widgets/image_viewer/loading_indicator.dart +++ b/lib/common/widgets/image_viewer/loading_indicator.dart @@ -95,6 +95,9 @@ class RenderLoadingIndicator extends RenderBox { final radius = size.width / 2 - strokeWidth; final center = size.center(.zero); + // TODO: remove + // https://github.com/flutter/flutter/issues/182708 + // https://github.com/flutter/flutter/issues/183083 if (Platform.isIOS) { context.canvas ..drawCircle( diff --git a/lib/scripts/bottom_sheet_patch.diff b/lib/scripts/bottom_sheet.patch similarity index 100% rename from lib/scripts/bottom_sheet_patch.diff rename to lib/scripts/bottom_sheet.patch diff --git a/lib/scripts/modal_barrier_patch.diff b/lib/scripts/modal_barrier.patch similarity index 100% rename from lib/scripts/modal_barrier_patch.diff rename to lib/scripts/modal_barrier.patch diff --git a/lib/scripts/mouse_cursor_patch.diff b/lib/scripts/mouse_cursor.patch similarity index 100% rename from lib/scripts/mouse_cursor_patch.diff rename to lib/scripts/mouse_cursor.patch diff --git a/lib/scripts/patch.ps1 b/lib/scripts/patch.ps1 new file mode 100644 index 000000000..4868b97ef --- /dev/null +++ b/lib/scripts/patch.ps1 @@ -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" + } +}