Skip to content

Commit eb5953b

Browse files
authored
Fix Windows build (#254)
1 parent 7013adc commit eb5953b

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

.github/workflows/flutter.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
2222
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
2323
bash ./.github/workflows/prepare.sh
24+
2425
- name: Setup Flutter
2526
uses: subosito/flutter-action@v2
2627
with:
@@ -312,13 +313,17 @@ jobs:
312313
shell: bash
313314
steps:
314315
- uses: actions/checkout@v4
315-
- uses: Vampire/setup-wsl@v2
316+
- uses: Vampire/setup-wsl@v3
316317
with:
317-
additional-packages: bash file git-crypt yq
318-
distribution: Alpine
318+
additional-packages: git-crypt
319+
distribution: Ubuntu-22.04
319320
- name: Prepare repo
320-
run: bash ./.github/workflows/prepare.sh
321321
shell: wsl-bash {0}
322+
run: |
323+
set -e
324+
325+
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
326+
bash ./.github/workflows/prepare.sh
322327
env:
323328
WSLENV: GITHUB_ENV:GITHUB_RUN_ATTEMPT:GITHUB_RUN_NUMBER:GIT_CRYPT_KEY
324329

@@ -330,6 +335,7 @@ jobs:
330335
- name: Prepare packages/api
331336
run: ./packages/api/tool/build.sh
332337
- run: flutter pub get
338+
- run: flutter build windows
333339
- name: Run flutter pub run msix:create
334340
run: flutter pub run msix:create --install-certificate=false
335341

@@ -343,7 +349,7 @@ jobs:
343349
run: |
344350
set -e
345351
346-
gsutil cp build/windows/runner/Release/the_app.msix "${GCS_PATH}/windows/the_app.msix"
352+
gsutil cp build/windows/x64/runner/Release/the_app.msix "${GCS_PATH}/windows/the_app.msix"
347353
348354
- name: Prepare markdown
349355
id: markdown

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,10 +849,10 @@ packages:
849849
dependency: "direct dev"
850850
description:
851851
name: msix
852-
sha256: "76c87b8207323803169626a55afd78bbb8413c984df349a76598b9fbf9224677"
852+
sha256: "519b183d15dc9f9c594f247e2d2339d855cf0eaacc30e19b128e14f3ecc62047"
853853
url: "https://pub.dev"
854854
source: hosted
855-
version: "3.16.1"
855+
version: "3.16.7"
856856
nested:
857857
dependency: transitive
858858
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dev_dependencies:
5656
flutter_test:
5757
sdk: flutter
5858
golden_toolkit: ^0.15.0
59-
msix: ^3.0.0
59+
msix: ^3.16.7
6060

6161
flutter:
6262
assets:

windows/flutter/generated_plugin_registrant.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@
66

77
#include "generated_plugin_registrant.h"
88

9+
#include <file_selector_windows/file_selector_windows.h>
10+
#include <firebase_core/firebase_core_plugin_c_api.h>
911
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
12+
#include <share_plus/share_plus_windows_plugin_c_api.h>
1013
#include <url_launcher_windows/url_launcher_windows.h>
1114

1215
void RegisterPlugins(flutter::PluginRegistry* registry) {
16+
FileSelectorWindowsRegisterWithRegistrar(
17+
registry->GetRegistrarForPlugin("FileSelectorWindows"));
18+
FirebaseCorePluginCApiRegisterWithRegistrar(
19+
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
1320
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
1421
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
22+
SharePlusWindowsPluginCApiRegisterWithRegistrar(
23+
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
1524
UrlLauncherWindowsRegisterWithRegistrar(
1625
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
1726
}

windows/flutter/generated_plugins.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
#
44

55
list(APPEND FLUTTER_PLUGIN_LIST
6+
file_selector_windows
7+
firebase_core
68
flutter_secure_storage_windows
9+
share_plus
710
url_launcher_windows
811
)
912

0 commit comments

Comments
 (0)