Repository navigation
Support using SPM for Flutter on macOS and iOS - #3835
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
📝 WalkthroughWalkthroughThe pull request adds XCFramework-based Flutter packaging, Swift Package Manager support, multiplatform GitHub Actions workflows, and a complete Flutter ChangesFlutter XCFramework integration
Flutter hello_world example
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant NativeBuild
participant FlutterPackage
participant FlutterExample
GitHubActions->>NativeBuild: build or download XCFramework and native libraries
NativeBuild->>FlutterPackage: copy framework or library artifacts
FlutterPackage->>FlutterExample: provide platform implementation
GitHubActions->>FlutterExample: build application and upload artifact
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (3)
flutter-examples/hello_world/README.md (1)
127-129: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a language tag to the fenced code block.
markdownlint-cli2reports MD040 on Line 127. Usetextfor this device-output block.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@flutter-examples/hello_world/README.md` around lines 127 - 129, Update the fenced code block containing “iPhone 16 Plus (UUID) (Booted)” in the README to specify the text language tag, resolving the MD040 markdownlint violation without changing the device output.Source: Linters/SAST tools
.github/workflows/test-dart-package.yaml (1)
84-86: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winDo not persist the checkout token.
No later step in this job needs Git authentication. Set
persist-credentials: falseand restrict the job token tocontents: read.[recommend_recommended_refactor]
Proposed hardening
test_dart_package_xcframework: + permissions: + contents: read steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + persist-credentials: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/test-dart-package.yaml around lines 84 - 86, Harden the checkout step using actions/checkout@v4 by setting persist-credentials to false, and configure the workflow job permissions so the GITHUB_TOKEN is limited to contents: read. Preserve the existing full fetch-depth behavior.Source: Linters/SAST tools
.github/workflows/test-flutter-package.yaml (1)
111-156: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd iOS Simulator build coverage.
The
ios_cocoapodsandios_spmjobs only runflutter build ios --no-codesign, which targets a physical device. One of the linked PR objectives is to ensure the plugin works on the iOS Simulator, but no job builds for the Simulator (for example withflutter build ios --simulator --no-codesign). Add a Simulator build job or step so this objective has CI coverage.Also applies to: 157-202
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/test-flutter-package.yaml around lines 111 - 156, Add iOS Simulator build coverage to the existing ios_cocoapods and ios_spm workflows, using the hello_world Flutter project and the simulator-specific build option alongside the current device builds. Keep the existing artifact behavior intact and ensure the Simulator build executes in CI for both dependency modes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release-dart-package.yaml:
- Around line 288-300: Update both XCFramework download steps at
.github/workflows/release-dart-package.yaml:288-300 and
.github/workflows/release-dart-package.yaml:854-866 to use an immutable release
artifact reference and verify its repository-controlled SHA-256 checksum or
signed provenance before extraction. Apply validation to each downloaded archive
before the existing unzip, rename, and publication flow; no direct change is
needed beyond these two sites.
In @.github/workflows/test-dart-package.yaml:
- Around line 99-104: Update the test_dart_package_xcframework workflow to
retain the existing Flutter 3.24.0 CocoaPods-compatible job and add a separate
Flutter 3.44+ SPM-enabled job. In the new job, run flutter pub get and flutter
config --enable-swift-package-manager before flutter test and the macOS/iOS
Simulator platform builds, covering the workflow steps around the Flutter setup
and lines 132-154.
In @.github/workflows/test-flutter-package.yaml:
- Around line 24-26: Add a top-level permissions block granting only contents:
read in both .github/workflows/test-flutter-package.yaml and
.github/workflows/test-flutter.yaml. In every listed actions/checkout@v4 step in
both workflows—package workflow ranges 24-26, 70-72, 116-118, 162-164, 212-214,
263-265, and 308-310; flutter workflow ranges 24-26, 106-108, 188-190, 263-265,
343-345, 438-440, and 515-517—set persist-credentials to false.
In `@flutter-examples/hello_world/.gitignore`:
- Around line 29-30: Update the ignore entries alongside
.flutter-plugins-dependencies to include the legacy .flutter-plugins metadata
file, ensuring supported Flutter versions do not leave it unignored.
In `@flutter-examples/hello_world/lib/main.dart`:
- Around line 2-7: Update the Flutter CI workflow covering the hello_world
example to exclude the web target, including removing the hello_world web
directory or otherwise preventing it from being built. Keep Android, iOS, Linux,
macOS, and Windows targets enabled, and preserve the existing main()
initialization for supported platforms.
In `@flutter-examples/hello_world/pubspec.yaml`:
- Around line 16-18: Ensure flutter-examples/hello_world/pubspec.yaml lines
16-18 uses a sherpa_onnx dependency that exports getOnnxruntimeVersion(), either
by activating the local package path or publishing/exporting the API. In
flutter-examples/hello_world/lib/main.dart line 35, call an available API or
remove the field; keep flutter-examples/hello_world/README.md line 72 consistent
with the resulting implementation.
In `@flutter-examples/hello_world/README.md`:
- Around line 145-159: Replace the “Or regenerate the iOS project” commands in
the README with a reproducible Xcode rebuild/manual-repair procedure that
recreates or removes the cached FlutterGeneratedPluginSwiftPackage and stale
project.pbxproj references. Keep the sherpa_onnx linker-error context and
explicitly identify the required Xcode project cleanup steps; do not present
flutter clean, flutter pub get, and flutter run as sufficient regeneration.
In `@flutter-examples/hello_world/windows/runner/flutter_window.cpp`:
- Around line 64-68: Guard the WM_FONTCHANGE handling in the switch before
dereferencing flutter_controller_, following the existing null-check pattern
near the top of the window procedure. Only call engine()->ReloadSystemFonts()
when flutter_controller_ is non-null, while preserving the current message
handling behavior otherwise.
---
Nitpick comments:
In @.github/workflows/test-dart-package.yaml:
- Around line 84-86: Harden the checkout step using actions/checkout@v4 by
setting persist-credentials to false, and configure the workflow job permissions
so the GITHUB_TOKEN is limited to contents: read. Preserve the existing full
fetch-depth behavior.
In @.github/workflows/test-flutter-package.yaml:
- Around line 111-156: Add iOS Simulator build coverage to the existing
ios_cocoapods and ios_spm workflows, using the hello_world Flutter project and
the simulator-specific build option alongside the current device builds. Keep
the existing artifact behavior intact and ensure the Simulator build executes in
CI for both dependency modes.
In `@flutter-examples/hello_world/README.md`:
- Around line 127-129: Update the fenced code block containing “iPhone 16 Plus
(UUID) (Booted)” in the README to specify the text language tag, resolving the
MD040 markdownlint violation without changing the device output.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: cac25159-892a-4868-b3c7-9cc085935354
⛔ Files ignored due to path filters (40)
dart-api-examples/non-streaming-asr/pubspec.lockis excluded by!**/*.lockflutter-examples/hello_world/android/app/src/main/res/mipmap-hdpi/ic_launcher.pngis excluded by!**/*.pngflutter-examples/hello_world/android/app/src/main/res/mipmap-mdpi/ic_launcher.pngis excluded by!**/*.pngflutter-examples/hello_world/android/app/src/main/res/mipmap-xhdpi/ic_launcher.pngis excluded by!**/*.pngflutter-examples/hello_world/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngis excluded by!**/*.pngflutter-examples/hello_world/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedatais excluded by!**/*.xcworkspace/contents.xcworkspacedataflutter-examples/hello_world/ios/Runner.xcworkspace/contents.xcworkspacedatais excluded by!**/*.xcworkspace/contents.xcworkspacedataflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.pngis excluded by!**/*.pngflutter-examples/hello_world/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.pngis excluded by!**/*.pngflutter-examples/hello_world/macos/Runner.xcworkspace/contents.xcworkspacedatais excluded by!**/*.xcworkspace/contents.xcworkspacedataflutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.pngis excluded by!**/*.pngflutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.pngis excluded by!**/*.pngflutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.pngis excluded by!**/*.pngflutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.pngis excluded by!**/*.pngflutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.pngis excluded by!**/*.pngflutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.pngis excluded by!**/*.pngflutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.pngis excluded by!**/*.pngflutter-examples/hello_world/web/favicon.pngis excluded by!**/*.pngflutter-examples/hello_world/web/icons/Icon-192.pngis excluded by!**/*.pngflutter-examples/hello_world/web/icons/Icon-512.pngis excluded by!**/*.pngflutter-examples/hello_world/web/icons/Icon-maskable-192.pngis excluded by!**/*.pngflutter-examples/hello_world/web/icons/Icon-maskable-512.pngis excluded by!**/*.pngflutter-examples/hello_world/windows/runner/resources/app_icon.icois excluded by!**/*.ico
📒 Files selected for processing (100)
.github/workflows/release-dart-package.yaml.github/workflows/test-dart-package.yaml.github/workflows/test-dart.yaml.github/workflows/test-flutter-package.yaml.github/workflows/test-flutter.yamlbuild-ios-shared.shdart-api-examples/version/bin/init.dartdart-api-examples/version/bin/main.dartdart-api-examples/version/pubspec.yamlflutter-examples/hello_world/.gitignoreflutter-examples/hello_world/.metadataflutter-examples/hello_world/README.mdflutter-examples/hello_world/analysis_options.yamlflutter-examples/hello_world/android/.gitignoreflutter-examples/hello_world/android/app/build.gradle.ktsflutter-examples/hello_world/android/app/src/debug/AndroidManifest.xmlflutter-examples/hello_world/android/app/src/main/AndroidManifest.xmlflutter-examples/hello_world/android/app/src/main/kotlin/com/k2fsa/hello_world/MainActivity.ktflutter-examples/hello_world/android/app/src/main/res/drawable-v21/launch_background.xmlflutter-examples/hello_world/android/app/src/main/res/drawable/launch_background.xmlflutter-examples/hello_world/android/app/src/main/res/values-night/styles.xmlflutter-examples/hello_world/android/app/src/main/res/values/styles.xmlflutter-examples/hello_world/android/app/src/profile/AndroidManifest.xmlflutter-examples/hello_world/android/build.gradle.ktsflutter-examples/hello_world/android/gradle.propertiesflutter-examples/hello_world/android/gradle/wrapper/gradle-wrapper.propertiesflutter-examples/hello_world/android/settings.gradle.ktsflutter-examples/hello_world/ios/.gitignoreflutter-examples/hello_world/ios/Flutter/AppFrameworkInfo.plistflutter-examples/hello_world/ios/Flutter/Debug.xcconfigflutter-examples/hello_world/ios/Flutter/Release.xcconfigflutter-examples/hello_world/ios/Runner.xcodeproj/project.pbxprojflutter-examples/hello_world/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistflutter-examples/hello_world/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettingsflutter-examples/hello_world/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemeflutter-examples/hello_world/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistflutter-examples/hello_world/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettingsflutter-examples/hello_world/ios/Runner/AppDelegate.swiftflutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.jsonflutter-examples/hello_world/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.jsonflutter-examples/hello_world/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.mdflutter-examples/hello_world/ios/Runner/Base.lproj/LaunchScreen.storyboardflutter-examples/hello_world/ios/Runner/Base.lproj/Main.storyboardflutter-examples/hello_world/ios/Runner/Info.plistflutter-examples/hello_world/ios/Runner/Runner-Bridging-Header.hflutter-examples/hello_world/ios/Runner/SceneDelegate.swiftflutter-examples/hello_world/ios/RunnerTests/RunnerTests.swiftflutter-examples/hello_world/lib/main.dartflutter-examples/hello_world/linux/.gitignoreflutter-examples/hello_world/linux/CMakeLists.txtflutter-examples/hello_world/linux/flutter/CMakeLists.txtflutter-examples/hello_world/linux/runner/CMakeLists.txtflutter-examples/hello_world/linux/runner/main.ccflutter-examples/hello_world/linux/runner/my_application.ccflutter-examples/hello_world/linux/runner/my_application.hflutter-examples/hello_world/macos/.gitignoreflutter-examples/hello_world/macos/Flutter/Flutter-Debug.xcconfigflutter-examples/hello_world/macos/Flutter/Flutter-Release.xcconfigflutter-examples/hello_world/macos/Runner.xcodeproj/project.pbxprojflutter-examples/hello_world/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistflutter-examples/hello_world/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemeflutter-examples/hello_world/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plistflutter-examples/hello_world/macos/Runner/AppDelegate.swiftflutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.jsonflutter-examples/hello_world/macos/Runner/Base.lproj/MainMenu.xibflutter-examples/hello_world/macos/Runner/Configs/AppInfo.xcconfigflutter-examples/hello_world/macos/Runner/Configs/Debug.xcconfigflutter-examples/hello_world/macos/Runner/Configs/Release.xcconfigflutter-examples/hello_world/macos/Runner/Configs/Warnings.xcconfigflutter-examples/hello_world/macos/Runner/DebugProfile.entitlementsflutter-examples/hello_world/macos/Runner/Info.plistflutter-examples/hello_world/macos/Runner/MainFlutterWindow.swiftflutter-examples/hello_world/macos/Runner/Release.entitlementsflutter-examples/hello_world/macos/RunnerTests/RunnerTests.swiftflutter-examples/hello_world/pubspec.yamlflutter-examples/hello_world/web/index.htmlflutter-examples/hello_world/web/manifest.jsonflutter-examples/hello_world/windows/.gitignoreflutter-examples/hello_world/windows/CMakeLists.txtflutter-examples/hello_world/windows/flutter/CMakeLists.txtflutter-examples/hello_world/windows/runner/CMakeLists.txtflutter-examples/hello_world/windows/runner/Runner.rcflutter-examples/hello_world/windows/runner/flutter_window.cppflutter-examples/hello_world/windows/runner/flutter_window.hflutter-examples/hello_world/windows/runner/main.cppflutter-examples/hello_world/windows/runner/resource.hflutter-examples/hello_world/windows/runner/runner.exe.manifestflutter-examples/hello_world/windows/runner/utils.cppflutter-examples/hello_world/windows/runner/utils.hflutter-examples/hello_world/windows/runner/win32_window.cppflutter-examples/hello_world/windows/runner/win32_window.hflutter/sherpa_onnx/lib/sherpa_onnx.dartflutter/sherpa_onnx_ios/ios/sherpa_onnx_ios.podspecflutter/sherpa_onnx_ios/ios/sherpa_onnx_ios/Package.swiftflutter/sherpa_onnx_ios/ios/sherpa_onnx_ios/Sources/sherpa_onnx_ios/SherpaOnnxIosPlugin.swiftflutter/sherpa_onnx_macos/macos/sherpa_onnx_macos.podspecflutter/sherpa_onnx_macos/macos/sherpa_onnx_macos/Package.swiftflutter/sherpa_onnx_macos/macos/sherpa_onnx_macos/Sources/sherpa_onnx_macos/SherpaOnnxMacosPlugin.swiftnew-release.shscripts/dart/version-pubspec.yaml
💤 Files with no reviewable changes (1)
- build-ios-shared.sh
| - name: Download pre-built xcframework | ||
| shell: bash | ||
| run: | | ||
| export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
| export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
| cmake --version | ||
| SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| cd flutter/sherpa_onnx_macos/macos | ||
|
|
||
| mkdir build | ||
| cd build | ||
| cmake \ | ||
| -D SHERPA_ONNX_ENABLE_PORTAUDIO=OFF \ | ||
| -D SHERPA_ONNX_ENABLE_TTS=ON \ | ||
| -D CMAKE_BUILD_TYPE=Release \ | ||
| -D BUILD_SHARED_LIBS=ON \ | ||
| -D CMAKE_INSTALL_PREFIX=./install \ | ||
| -D SHERPA_ONNX_ENABLE_JNI=OFF \ | ||
| -D SHERPA_ONNX_ENABLE_BINARY=OFF \ | ||
| -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ | ||
| .. | ||
|
|
||
| - name: Build sherpa-onnx | ||
| shell: bash | ||
| run: | | ||
| export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
| export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
| cmake --version | ||
| wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/xcframework/sherpa-onnx-${SHERPA_ONNX_VERSION}-macos-shared-onnxruntime-static.xcframework.zip | ||
| unzip sherpa-onnx-${SHERPA_ONNX_VERSION}-macos-shared-onnxruntime-static.xcframework.zip | ||
| rm sherpa-onnx-${SHERPA_ONNX_VERSION}-macos-shared-onnxruntime-static.xcframework.zip | ||
|
|
||
| cd build | ||
| make -j2 install | ||
| mv sherpa-onnx.xcframework sherpa_onnx_macos/SherpaOnnxC.xcframework | ||
|
|
||
| ls -lh install/lib/libsherpa-onnx-c-api.dylib | ||
| file install/lib/libsherpa-onnx-c-api.dylib | ||
| rm -v install/lib/libonnxruntime.dylib | ||
| ls -lh sherpa_onnx_macos/SherpaOnnxC.xcframework/ |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
gh api repos/k2-fsa/sherpa-onnx/releases/tags/xcframework \
--jq '.assets[] | [.name, .size, .updated_at] | `@tsv`'Repository: k2-fsa/sherpa-onnx
Length of output: 660
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files .github/workflows/release-dart-package.yaml CMakeLists.txt || true
sed -n '260,310p' .github/workflows/release-dart-package.yaml
sed -n '830,880p' .github/workflows/release-dart-package.yaml
rg -n "SHERPA_ONNX_VERSION|xcframework|download|unzip|sha|checksum|sign" .github/workflows/release-dart-package.yaml CMakeLists.txt || true
python3 - <<'PY'
from pathlib import Path
p=Path(".github/workflows/release-dart-package.yaml")
s=p.read_text()
for start,end in [(288,300),(854,866)]:
print(f"\n-- lines {start}-{end} --")
for i,l in enumerate(s.splitlines(), start=1):
if start <= i <= end:
print(f"{i}: {l}")
PYRepository: k2-fsa/sherpa-onnx
Length of output: 10185
Verify downloaded XCFramework archives before extraction.
Both macOS and iOS jobs pull executable native code from the mutable k2-fsa/sherpa-onnx/releases/download/xcframework tag. The tarball is renamed and published without checksum or signature validation. A replaced asset would be included in the published Flutter plugins.
Use an immutable release artifact reference and verify a repository-controlled SHA-256 or signed provenance before unzip. Apply the same flow to both .github/workflows/release-dart-package.yaml#L288-L300 and .github/workflows/release-dart-package.yaml#L854-R866.
📍 Affects 1 file
.github/workflows/release-dart-package.yaml#L288-L300(this comment).github/workflows/release-dart-package.yaml#L854-L866
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/release-dart-package.yaml around lines 288 - 300, Update
both XCFramework download steps at
.github/workflows/release-dart-package.yaml:288-300 and
.github/workflows/release-dart-package.yaml:854-866 to use an immutable release
artifact reference and verify its repository-controlled SHA-256 checksum or
signed provenance before extraction. Apply validation to each downloaded archive
before the existing unzip, rename, and publication flow; no direct change is
needed beyond these two sites.
| # see https://github.com/subosito/flutter-action/issues/345 | ||
| - name: Set up Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| channel: master | ||
| flutter-version: 3.24.0 |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 3 \
'flutter-version:|enable-swift-package-manager|flutter build (macos|ios)|simctl|xcodebuild|test-dart\.sh' \
.github/workflows .github/scriptsRepository: k2-fsa/sherpa-onnx
Length of output: 25585
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "## workflow relevant section"
sed -n '40,115p' .github/workflows/test-dart-package.yaml
sed -n '125,170p' .github/workflows/test-dart-package.yaml
echo
echo "## config/enabler occurrences in Dart package workflow"
rg -n 'flutter config|--enable-swift-package-manager|--no-enable-swift-package-manager|build mac|flutter build|pub get|test_dart_package_xcframework' .github/workflows/test-dart-package.yaml
echo
echo "## test script outline for reference"
sed -n '1,220p' .github/scripts/test-dart.shRepository: k2-fsa/sherpa-onnx
Length of output: 8591
🌐 Web query:
Flutter Swift Package Manager enabled by default starting Flutter 3.44
💡 Result:
Yes, starting with Flutter 3.44, Swift Package Manager (SwiftPM) is enabled by default as the dependency manager for iOS and macOS applications, replacing CocoaPods [1][2][3]. When developers upgrade to Flutter 3.44 or later and build or run their iOS or macOS apps, the Flutter CLI automatically manages the migration, updating the Xcode project to use SwiftPM [1][2]. This transition is intended to eliminate the need for developers to manage separate Ruby or CocoaPods installations [1][2]. If developers encounter breaking issues, they can temporarily opt out of using SwiftPM by adding the following configuration to their pubspec.yaml file [1][2]: flutter: config: enable-swift-package-manager: false Alternatively, this can be set via the command line using: flutter config --no-enable-swift-package-manager Please note that this opt-out mechanism is intended to be temporary and may be removed in future versions of Flutter [1][4]. Additionally, because CocoaPods is in maintenance mode, plugin authors are encouraged to add SwiftPM support to their packages to ensure compatibility and maintain their pub.dev scores [2].
Citations:
- 1: https://flutter.dev/blog/whats-new-in-flutter-3-44
- 2: https://flutter.dev/blog/saying-goodbye-to-cocoapods-swift-package-manager-is-soon-the-default-in-flutter
- 3: https://blog.flutter.dev/whats-new-in-flutter-3-44-b0cc1ad3c527
- 4: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/macos/swift_package_manager.dart
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "## xcframework build workflow Set up Flutter sections"
rg -n -C 4 'Set up Flutter|flutter-version:|enable-swift-package-manager|swift package resolve|xcodebuild' .github/workflows/build-xcframework.yaml | sed -n '1,240p'
echo
echo "## XCodeProj/SwiftPM project settings"
fd -a 'project.pbxproj|Package.swift|Package.resolved' . | sed -n '1,80p'
rg -n 'buildConfigurationList|PRODUCT_BUNDLE_IDENTIFIER|swift |PackageFrameworks|local package|remote package|Package.swift|dependency' . --glob '!build/**' --glob '!**/.pub-cache/**' --glob '!**/flutter/**' --glob '!**/ios-swift/**/**/build/**' | sed -n '1,260p'Repository: k2-fsa/sherpa-onnx
Length of output: 50375
Add a SPM-enabled Flutter 3.44+ job for the xcframework package test.
The test_dart_package_xcframework job still uses Flutter 3.24.0 and does not run flutter pub get ; flutter config --enable-swift-package-manager before flutter test or Flutter platform builds. Add a 3.44-or-later job that builds the macOS app and iOS Simulator app with Swift Package Manager enabled, and keep Flutter 3.24.0 for CocoaPods compatibility. Also applies to lines 132-154.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/test-dart-package.yaml around lines 99 - 104, Update the
test_dart_package_xcframework workflow to retain the existing Flutter 3.24.0
CocoaPods-compatible job and add a separate Flutter 3.44+ SPM-enabled job. In
the new job, run flutter pub get and flutter config
--enable-swift-package-manager before flutter test and the macOS/iOS Simulator
platform builds, covering the workflow steps around the Flutter setup and lines
132-154.
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Both new workflows persist git credentials and run with default, overly broad permissions. Neither .github/workflows/test-flutter-package.yaml nor .github/workflows/test-flutter.yaml sets persist-credentials: false on any actions/checkout@v4 step, and neither declares a top-level (or job-level) permissions: block, so every job keeps the default GITHUB_TOKEN scope and leaves git credentials persisted in the workspace for the whole job, including steps that run ./new-release.sh and flutter build.
.github/workflows/test-flutter-package.yaml#L24-L26: add a top-levelpermissions: contents: readblock, and addpersist-credentials: falseto this checkout step and the checkouts at lines 70-72, 116-118, 162-164, 212-214, 263-265, and 308-310..github/workflows/test-flutter.yaml#L24-L26: add a top-levelpermissions: contents: readblock, and addpersist-credentials: falseto this checkout step and the checkouts at lines 106-108, 188-190, 263-265, 343-345, 438-440, and 515-517.
🧰 Tools
🪛 zizmor (1.28.0)
[warning] 24-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
📍 Affects 2 files
.github/workflows/test-flutter-package.yaml#L24-L26(this comment).github/workflows/test-flutter-package.yaml#L70-L72.github/workflows/test-flutter-package.yaml#L116-L118.github/workflows/test-flutter-package.yaml#L162-L164.github/workflows/test-flutter-package.yaml#L212-L214.github/workflows/test-flutter-package.yaml#L263-L265.github/workflows/test-flutter-package.yaml#L308-L310.github/workflows/test-flutter.yaml#L24-L26.github/workflows/test-flutter.yaml#L106-L108.github/workflows/test-flutter.yaml#L188-L190.github/workflows/test-flutter.yaml#L263-L265.github/workflows/test-flutter.yaml#L343-L345.github/workflows/test-flutter.yaml#L438-L440.github/workflows/test-flutter.yaml#L515-L517
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/test-flutter-package.yaml around lines 24 - 26, Add a
top-level permissions block granting only contents: read in both
.github/workflows/test-flutter-package.yaml and
.github/workflows/test-flutter.yaml. In every listed actions/checkout@v4 step in
both workflows—package workflow ranges 24-26, 70-72, 116-118, 162-164, 212-214,
263-265, and 308-310; flutter workflow ranges 24-26, 106-108, 188-190, 263-265,
343-345, 438-440, and 515-517—set persist-credentials to false.
Source: Linters/SAST tools
| .dart_tool/ | ||
| .flutter-plugins-dependencies |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== candidate files =="
fd -a '^(pubspec\.yaml|\.gitignore)$' . | sed 's#^\./##' | head -50
echo
echo "== hello_world files =="
if [ -f flutter-examples/hello_world/pubspec.yaml ]; then
cat -n flutter-examples/hello_world/pubspec.yaml | sed -n '1,80p'
fi
if [ -f flutter-examples/hello_world/.gitignore ]; then
cat -n flutter-examples/hello_world/.gitignore | sed -n '1,80p'
fi
echo
echo "== all .flutter-plugins mentions =="
rg -n --hidden --glob '!**/.git' --glob '!**/.dart_tool/**' '\.flutter-plugins|flutter-plugins-configuration|flutter-plugins' . || trueRepository: k2-fsa/sherpa-onnx
Length of output: 4810
🌐 Web query:
Flutter breaking changes .flutter-plugins deprecated stable 3.32 dart_tool flutter-plugins-dependencies
💡 Result:
The.flutter-plugins file has been officially replaced by the.flutter-plugins-dependencies file [1][2]. This change is part of a transition to a more robust, JSON-based metadata format for plugin dependencies [1][3]. Key Details: - Background: The.flutter-plugins-dependencies file was introduced in 2019 to replace the legacy.flutter-plugins format, which was a source of technical debt [1][2]. - Implementation: The Flutter tool no longer generates the.flutter-plugins file as of the stable 3.32 release [1][2]. - Migration: Projects or build scripts—particularly custom Gradle configurations—that explicitly rely on the existence of the.flutter-plugins file must be updated to reference.flutter-plugins-dependencies instead [1][2]. - Testing/Verification: If you need to check if your build process still relies on the deprecated.flutter-plugins file, you can use the feature flag --explicit-package-dependencies (though this behavior has become the default in recent versions) [1][2][4]. If your build scripts are failing due to this change, you should update your project's Gradle configuration (e.g., settings.gradle or build.gradle files) to parse the new.flutter-plugins-dependencies JSON file rather than the previous key-value based.flutter-plugins file [1][2]. For many standard projects, this migration is handled automatically by the Flutter tool when using modern project templates [1][2].
Citations:
- 1: https://docs.flutter.dev/release/breaking-changes/flutter-plugins-configuration
- 2: https://github.com/flutter/website/blob/main/sites/docs/src/content/release/breaking-changes/flutter-plugins-configuration.md
- 3: https://groups.google.com/g/flutter-announce/c/VRn2_NBNSd4
- 4: [flutter_tools] Migrate platforms away from .flutter-plugins flutter/flutter#48918.
🌐 Web query:
site:docs.flutter.dev/release/breaking-changes/flutter-plugins-configuration Flutter plugins .flutter-plugins deprecated
💡 Result:
The.flutter-plugins file has been deprecated and replaced by the.flutter-plugins-dependencies file [1]. The Flutter tool no longer outputs.flutter-plugins, relying instead on.flutter-plugins-dependencies to manage plugin metadata [1]. This change was implemented to reduce technical debt and allow for better management of plugin dependencies, such as ensuring dev_dependency plugins are not bundled in release applications [1]. If your project or build scripts (particularly custom Gradle configurations) still reference.flutter-plugins, they must be updated to use.flutter-plugins-dependencies [1]. If you are using legacy code, such as older settings.gradle files generated by previous versions of flutter create, these may need to be updated to modern build script patterns to avoid failures [1]. You can test whether your project build depends on the legacy file by using the explicit-package-dependencies feature flag [1]. If your build relies on the output of the deprecated file, it will fail when that flag is enabled or as the Flutter SDK evolves to stop generating the legacy file entirely [1].
Citations:
Ignore the legacy .flutter-plugins metadata.
flutter-examples/hello_world/pubspec.yaml allows Flutter >=3.24.0, but Flutter only stopped generating .flutter-plugins in stable 3.32. Add .flutter-plugins next to .flutter-plugins-dependencies so supported Flutter 3.24 checkouts do not create an unignored file.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@flutter-examples/hello_world/.gitignore` around lines 29 - 30, Update the
ignore entries alongside .flutter-plugins-dependencies to include the legacy
.flutter-plugins metadata file, ensuring supported Flutter versions do not leave
it unignored.
| import 'package:flutter/material.dart'; | ||
| import 'package:sherpa_onnx/sherpa_onnx.dart'; | ||
|
|
||
| void main() { | ||
| WidgetsFlutterBinding.ensureInitialized(); | ||
| initBindings(); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== candidate files =="
fd -a 'pubspec|web|main\.dart|ci|github' . | sed -E 's#^\./##' | rg 'flutter-examples|^\.github|^ci|^web|pubspec|main\.dart' || true
echo "== hello_world main =="
if [ -f flutter-examples/hello_world/lib/main.dart ]; then
cat -n flutter-examples/hello_world/lib/main.dart
fi
echo "== hello_world pubspec =="
if [ -f flutter-examples/hello_world/pubspec.yaml ]; then
cat -n flutter-examples/hello_world/pubspec.yaml
fi
echo "== web directory files =="
fd -a . flutter-examples/hello_world/web 2>/dev/null | sed -E 's#^\./##' || true
echo "== web runner references =="
rg -n "index\.html|flutter\.js|main\.dart\.js|platforms:|web|build web|flutter run|sherpa_onnx|initBindings" flutter-examples/hello_world .github -S || trueRepository: k2-fsa/sherpa-onnx
Length of output: 50374
🌐 Web query:
sherpa_onnx pub.dev official documentation Android iOS Linux macOS Windows web support
💡 Result:
The sherpa_onnx package is available on pub.dev and provides cross-platform support for speech recognition, speech synthesis, and other audio processing tasks [1][2]. Official Documentation: The primary official documentation for sherpa-onnx, including its Dart and Flutter APIs, is hosted at https://k2-fsa.github.io/sherpa/onnx/ [1][3]. Platform Support: The sherpa_onnx package supports the following platforms for its Flutter and Dart APIs: - Android [4][2] - iOS [4][2] - Linux [4][2] - macOS [4][2] - Windows [4][2] - HarmonyOS [4][2] Additionally, the broader sherpa-onnx project supports WebAssembly (Web) and various embedded systems, and mentions a React Native wrapper that includes support for Web [5]. While the core project supports WebAssembly, users of the Flutter/Dart package should refer to the official repository and documentation for specific implementation details regarding web support, as support levels can vary by specific task [4][2][5]. Note that for some platforms, such as iOS, building from source may be required for certain features [4].
Citations:
- 1: https://pub.dev/packages/sherpa_onnx
- 2: https://github.com/k2-fsa/sherpa-onnx
- 3: https://k2-fsa.github.io/sherpa/onnx/
- 4: https://pub.dev/packages/sherpa_onnx/versions/1.13.3
- 5: https://raw.githubusercontent.com/k2-fsa/sherpa-onnx/master/README.md
Remove the unsupported web target.
hello_world imports sherpa_onnx and calls initBindings() from main(), while sherpa_onnx 1.13.4 only supports Android, iOS, Linux, macOS, and Windows for the Flutter package. The flutter-examples/hello_world/web directory remains, and CI includes a Flutter workflow that exercises this example; exclude web from the runner so unsupported builds do not run before the package adds a web implementation or conditional API.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@flutter-examples/hello_world/lib/main.dart` around lines 2 - 7, Update the
Flutter CI workflow covering the hello_world example to exclude the web target,
including removing the hello_world web directory or otherwise preventing it from
being built. Keep Android, iOS, Linux, macOS, and Windows targets enabled, and
preserve the existing main() initialization for supported platforms.
| sherpa_onnx: ^1.13.4 | ||
| # sherpa_onnx: | ||
| # path: ../../flutter/sherpa_onnx |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '--- pubspec ---\n'
cat -n flutter-examples/hello_world/pubspec.yaml
printf '\n--- main excerpt ---\n'
sed -n '1,80p' flutter-examples/hello_world/lib/main.dart | cat -n
printf '\n--- README excerpt ---\n'
sed -n '60,80p' flutter-examples/hello_world/README.md | cat -n
printf '\n--- search for getOnnxruntimeVersion in repo ---\n'
rg -n "getOnnxruntimeVersion|getOnnxruntime|onnxruntime" flutter-examples/hello_world . --glob '!packages/**/.pub-cache/**' --glob '!build/**' || true
printf '\n--- available sherpa_onnx package references ---\n'
rg -n "^ sherpa_onnx:|sherpa_onnx:" pubspec.yaml flutter-examples -g 'pubspec.yaml' || trueRepository: k2-fsa/sherpa-onnx
Length of output: 247
🌐 Web query:
sherpa_onnx pub 1.13.4 getOnnxruntimeVersion documentation
💡 Result:
In the sherpa-onnx library, there is no function named getOnnxruntimeVersion [1][2][3]. The project provides APIs to retrieve version information for the sherpa-onnx library itself, such as SherpaOnnxGetVersionStr [1][2][3], but it does not expose a direct function to query the underlying ONNX Runtime version at runtime through the C API [1][3]. For build configuration and dependency management, the ONNX Runtime version used by sherpa-onnx is typically managed via CMake build variables (such as SHERPA_ONNX_ONNXRUNTIME_VERSION) or environment variables [4][5]. Users building from source or configuring environments can override the default ONNX Runtime version during the build process [5]. For pre-compiled binaries, the ONNX Runtime version is determined by the specific release package [6].
Citations:
- 1: Add API to get version information #2309
- 2: https://github.com/k2-fsa/sherpa-onnx/blob/c6691594/sherpa-onnx/c-api/c-api.cc
- 3: https://github.com/k2-fsa/sherpa-onnx/blob/54374075/sherpa-onnx/c-api/c-api.h
- 4: https://github.com/k2-fsa/sherpa/blob/master/docs/source/onnx/install/linux.rst
- 5: build: allow overriding ONNX Runtime for mobile #3617
- 6: https://k2-fsa.github.io/sherpa/onnx/install/windows/generated/download/windows_x64.html
🌐 Web query:
sherpa_onnx pub.dev 1.13.4 API getOnnxruntimeVersion
💡 Result:
In the sherpa_onnx Flutter package version 1.13.4, there is no API method named getOnnxruntimeVersion [1][2]. The available version-related API functions for the sherpa_onnx library are: * getVersion - Returns the sherpa-onnx version string compiled into the native library [1]. * getGitSha1 - Returns the Git SHA1 of the native library build [1]. * getGitDate - Returns the Git date of the native library build [1]. While sherpa_onnx does internally utilize onnxruntime, and its changelog tracks updates to the onnxruntime version (e.g., updating to 1.27.0 in version 1.13.4) [3][4], this underlying dependency version is not exposed via a dedicated getOnnxruntimeVersion API method in the Dart/Flutter package [1].
Citations:
- 1: https://pub.dev/documentation/sherpa_onnx/latest/sherpa_onnx/
- 2: https://pub.dev/documentation/sherpa_onnx/latest/index.html
- 3: https://github.com/k2-fsa/sherpa-onnx/blob/14280725/CHANGELOG.md
- 4: https://pub.dev/packages/sherpa_onnx/changelog
Use a dependency that exports getOnnxruntimeVersion().
The example and README call getOnnxruntimeVersion(), but the active published sherpa_onnx 1.13.4 package does not export this API. The commented local package path would be needed to provide it, so activation of that path or publishing/exporting the function restores example analysis and documentation accuracy.
flutter-examples/hello_world/pubspec.yaml#L16-L18: publish/exportgetOnnxruntimeVersion()or activate the local package path for repository validation.flutter-examples/hello_world/lib/main.dart#L35-L35: call an available API or remove the field.flutter-examples/hello_world/README.md#L72-L72: keep the documentation sample consistent with the implementation.
📍 Affects 3 files
flutter-examples/hello_world/pubspec.yaml#L16-L18(this comment)flutter-examples/hello_world/lib/main.dart#L35-L35flutter-examples/hello_world/README.md#L72-L72
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@flutter-examples/hello_world/pubspec.yaml` around lines 16 - 18, Ensure
flutter-examples/hello_world/pubspec.yaml lines 16-18 uses a sherpa_onnx
dependency that exports getOnnxruntimeVersion(), either by activating the local
package path or publishing/exporting the API. In
flutter-examples/hello_world/lib/main.dart line 35, call an available API or
remove the field; keep flutter-examples/hello_world/README.md line 72 consistent
with the resulting implementation.
| If you see `ld: framework 'sherpa_onnx' not found`, it means the Xcode | ||
| project has stale Swift Package Manager (SPM) references. Remove them: | ||
|
|
||
| ```bash | ||
| cd ios | ||
| # Remove SPM references from the Xcode project | ||
| # (edit Runner.xcodeproj/project.pbxproj to remove FlutterGeneratedPluginSwiftPackage entries) | ||
| ``` | ||
|
|
||
| Or regenerate the iOS project: | ||
|
|
||
| ```bash | ||
| flutter clean | ||
| flutter pub get | ||
| flutter run -d <UUID> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== file around lines =="
if [ -f flutter-examples/hello_world/README.md ]; then
nl -ba flutter-examples/hello_world/README.md | sed -n '130,175p'
else
echo "README not found"
fi
echo "== search for FlutterGeneratedPluginSwiftPackage references =="
rg -n "FlutterGeneratedPluginSwiftPackage|framework 'sherpa_onnx'|ld: framework|Spm|SPM|swift package" -S README.md flutter-examples/hello_world/README.md 2>/dev/null || true
echo "== dart/flutter package files =="
for f in flutter-examples/hello_world/pubspec.yaml flutter-examples/hello_world/pubspec.lock; do
if [ -f "$f" ]; then
echo "--- $f"
sed -n '1,220p' "$f"
fi
done
echo "== current branch/diff stat/name-only (if available) =="
git diff --stat HEAD~1..HEAD 2>/dev/null || true
git diff --name-only HEAD~1..HEAD 2>/dev/null || trueRepository: k2-fsa/sherpa-onnx
Length of output: 220
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== available Flutter docs / references =="
which flutter || true
if which flutter >/dev/null 2>&1; then
flutter --version 2>&1 | head -5 || true
fi
echo "== docs repo package references if present =="
if [ -d flutter-src ]; then
rg -n "FlutterGeneratedPluginSwiftPackage|flutter clean|--no-delete|--delete|ios xcode build|flutter pub get" flutter-src -S | head -80 || true
fi
echo "== deterministic check of FlutterClean command behavior from docs repo/source if present =="
rg -n "Flutter clean|Deletes the build output|Deletes the contents of the build directory|build directory" -S --glob '!*.lock' . | head -120 || true
echo "== package manager / plugin dependency snippets in hello world =="
for f in flutter-examples/hello_world/ios/Runner.xcodeproj/project.pbxproj flutter-examples/hello_world/pubspec.yaml flutter-examples/hello_world/pubspec.lock; do
if [ -f "$f" ]; then
echo "--- $f"
rg -n "FlutterGeneratedPluginSwiftPackage|Package.swift|dependency|package:" "$f" -C 3 || true
fi
doneRepository: k2-fsa/sherpa-onnx
Length of output: 5533
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== README lines 138-170 =="
cat -n flutter-examples/hello_world/README.md | sed -n '138,170p;1,137p' | sed -n '138,170p'
echo "== Flutter package file availability =="
for f in flutter-examples/hello_world/ios/Flutter/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift; do
if [ -e "$f" ]; then
echo "FOUND $f"
cat -n "$f"
else
echo "MISSING $f"
fi
done
echo "== flutter installed? =="
path="$(command -v flutter 2>/dev/null || true)"
echo "path=$path"
if [ -n "$path" ]; then
flutter --version 2>&1 | head -5 || true
fi
echo "== locate flutter docs/source locally if present =="
find /opt /home /run /tmp /usr -maxdepth 5 -path '*flutter*' -type d 2>/dev/null | head -40 || trueRepository: k2-fsa/sherpa-onnx
Length of output: 3102
🌐 Web query:
Flutter flutter clean removes build directories and .dart_tool does not regenerate ios Runner.xcodeproj
💡 Result:
The command flutter clean is designed to remove build artifacts and ephemeral files to ensure a clean state, but it is not intended to remove your source-controlled project configuration, such as ios/Runner.xcodeproj [1][2]. If your Runner.xcodeproj file is missing or failing to regenerate, it is likely due to an issue outside the scope of flutter clean [3]. Here are the key points to understand regarding this behavior: 1. Purpose of flutter clean: The command removes the build/ directory and ephemeral files (such as Generated.xcconfig and other dynamically generated environment files) to fix inconsistent build states [1][2][4]. It does not delete the ios/Runner.xcodeproj or ios/Runner.xcworkspace files, which are essential parts of your project source [1][3]. 2. If your Runner.xcodeproj is missing: If the file is genuinely missing from your ios/ directory, it was likely deleted manually, excluded via version control, or corrupted [3]. flutter clean will not restore or regenerate this file because it is treated as a permanent part of your project structure [3]. 3. How to recover or regenerate: If your project structure is damaged, you can regenerate the iOS platform directory using the following command in your project root: flutter create --platforms ios. [5] Warning: Using flutter create can overwrite existing custom changes in your ios/ directory (e.g., custom build settings, signing configurations, or native code additions) [6][5]. Always ensure your changes are backed up or committed to Git before running this command. 4. Common build errors after cleaning: Often, users confuse a missing Xcode project file with missing build artifacts. After a flutter clean, you must re-run build commands to regenerate the ephemeral files needed for Xcode to function correctly [7][4][8]. Use the following sequence to fully restore a broken build state: flutter clean [8] flutter pub get [8] cd ios [8] pod install [8] cd.. [8] flutter run [8] If you continue to see errors about a missing project, verify the contents of your ios/ directory manually to confirm if Runner.xcodeproj exists [3].
Citations:
- 1:
flutter cleandoesn't clean everything flutter/flutter#12631 - 2: https://codebrowser.dev/flutter/flutter/packages/flutter_tools/lib/src/commands/clean.dart.html
- 3:
flutter build iosdoes not generatexcworkspacewith Xcode 16.0 flutter/flutter#155911 - 4: Flutter clean deletes
Generated.xcconfigand does not regenerate it flutter/flutter#118055 - 5: https://stackoverflow.com/questions/53294148/recreate-flutters-ios-and-android-folder-with-swift-and-kotlin
- 6: https://stackoverflow.com/questions/67405994/unable-to-find-a-target-named-runner-in-project-runner-xcodeproj-did-find-d
- 7: Flutter clean deletes
Generated.xcconfigand does not regenerate it flutter/flutter#118055 - 8: https://codemia.io/knowledge-hub/path/error_flutterflutterh_file_not_found_when_flutter_run_on_ios
🌐 Web query:
Flutter documentation flutter clean deletes contents build directory .dart_tool ephemeral build output
💡 Result:
The flutter clean command is designed to remove generated build artifacts and ephemeral directories to ensure a fresh build state [1][2]. Specifically, it deletes the build/ directory and the .dart_tool/ directory [1][3]. Beyond these primary folders, flutter clean also removes various platform-specific ephemeral directories and generated configuration files, including: - Android: Ephemeral directories [2][4][5]. - iOS/macOS: Ephemeral directories, generated Xcode properties, environment variable export scripts, and deprecated frameworks [2][5]. - Linux/Windows: Ephemeral directories [2][5]. - Plugin management: Files such as .flutter-plugins and .flutter-plugins-dependencies [5]. - Xcode workspaces: The command triggers a cleanup of Xcode workspaces, which removes intermediate artifacts (like DerivedData), though users can control this behavior with the --xcode-clean option [2][6][7]. This process helps resolve issues stemming from stale build output, corrupted caches, or configuration mismatches after dependency updates [8]. If the command fails to delete these folders, it is often because background processes (such as the Dart compiler or IDE integration) have locked the files [9].
Citations:
- 1: https://docs.flutter.dev/reference/flutter-cli
- 2: https://codebrowser.dev/flutter/flutter/packages/flutter_tools/lib/src/commands/clean.dart.html
- 3: https://github.com/flutter/website/blob/main/src/content/reference/flutter-cli.md
- 4: https://github.com/flutter/flutter/blob/5c6367c2/packages/flutter_tools/test/commands.shard/hermetic/clean_test.dart
- 5: https://github.com/flutter/flutter/blob/f98c4683170a14d1b9bfa563acad5f01eda304cd/packages/flutter_tools/lib/src/commands/clean.dart
- 6: flutter clean: add --xcode-clean option to control Xcode cleaning flutter/flutter#180988
- 7: https://github.com/flutter/flutter/blob/5c6367c2/packages/flutter_tools/lib/src/commands/clean.dart
- 8: https://medium.com/@14mcal157.dipak/deep-dive-into-flutter-clean-9fb37510504e
- 9: flutter clean can't delete .dart_tool folder flutter/flutter#179264
🌐 Web query:
FlutterGeneratedPluginSwiftPackage Flutter iOS ephemeral Packages FlutterGeneratedPluginSwiftPackage Package.swift
💡 Result:
FlutterGeneratedPluginSwiftPackage is a generated local Swift Package created by the Flutter CLI to manage native dependencies for Flutter plugins that support Swift Package Manager (SPM) [1][2]. Key aspects of this package include: 1. Purpose and Location: The package acts as a bridge, aggregating dependencies for SPM-compatible Flutter plugins [1]. It is located in the ephemeral directory of your iOS project at ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage (or the corresponding macos/ directory) [3][2][4]. Because it is stored within the ephemeral directory, it is managed by the Flutter build system and should not be manually edited [5][4][6]. 2. Integration: The Flutter tool automatically generates a Package.swift manifest file inside this directory [1][7]. This file defines the package's dependencies, which are determined based on the plugins your Flutter project uses [1][2]. The package is added as a local dependency to your Xcode project's project.pbxproj file, typically appearing in the Xcode Project Navigator under Package Dependencies [3][8][2]. 3. Build System Role: As of recent Flutter versions, SwiftPM integration is enabled by default [3]. The Flutter CLI ensures this package is correctly linked in Xcode so that plugins can be properly resolved and built [1][2]. It is configured as an Xcode root package, which allows Xcode to automatically re-resolve the package when changes are detected, improving build consistency [8]. 4. Troubleshooting and Management: Because the directory is ephemeral, the Flutter tool creates and updates it during the build process [2][4]. If you encounter issues (such as dependency resolution errors), ensure your project is properly configured for SwiftPM and that the build environment is synchronized, often by performing a clean build or re-running flutter build ios --config-only [5]. You do not need to manually add or modify this package in your Xcode project settings unless migration instructions for a specific Flutter version require it [3][2].
Citations:
- 1: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/macos/swift_package_manager.dart
- 2: Add Swift Package Manager as new opt-in feature for iOS and macOS flutter/flutter#146256
- 3: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers
- 4: https://github.com/flutter/flutter/blob/5c6367c2/packages/flutter_tools/lib/src/xcode_project.dart
- 5: [SwiftPM] Xcode build does not update the generated package's supported platforms flutter/flutter#162196
- 6: https://deepwiki.com/flutter/flutter/7.2-ios-and-macos-build-system-(xcode)
- 7: https://codebrowser.dev/flutter/flutter/packages/flutter_tools/lib/src/macos/swift_packages.dart.html
- 8: Make FlutterGeneratedPluginSwiftPackage an Xcode root package flutter/flutter#168789
Replace the nonreproducible SPM repair steps.
flutter clean removes build and ephemeral generated files but does not recreate the cached FlutterGeneratedPluginSwiftPackage package or remove stale project.pbxproj references. The README should list an exact Xcode rebuild/manual-repair path instead of presenting this as regeneration.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@flutter-examples/hello_world/README.md` around lines 145 - 159, Replace the
“Or regenerate the iOS project” commands in the README with a reproducible Xcode
rebuild/manual-repair procedure that recreates or removes the cached
FlutterGeneratedPluginSwiftPackage and stale project.pbxproj references. Keep
the sherpa_onnx linker-error context and explicitly identify the required Xcode
project cleanup steps; do not present flutter clean, flutter pub get, and
flutter run as sufficient regeneration.
| switch (message) { | ||
| case WM_FONTCHANGE: | ||
| flutter_controller_->engine()->ReloadSystemFonts(); | ||
| break; | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Add a null check before dereferencing flutter_controller_ on WM_FONTCHANGE.
Line 66 calls flutter_controller_->engine()->ReloadSystemFonts() without checking flutter_controller_ for null. flutter_controller_ is null before OnCreate finishes and after OnDestroy clears it. If WM_FONTCHANGE arrives during either window, this dereferences a null pointer. The guard above, at line 55, already shows the correct pattern.
🐛 Proposed fix
switch (message) {
case WM_FONTCHANGE:
- flutter_controller_->engine()->ReloadSystemFonts();
+ if (flutter_controller_) {
+ flutter_controller_->engine()->ReloadSystemFonts();
+ }
break;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| switch (message) { | |
| case WM_FONTCHANGE: | |
| flutter_controller_->engine()->ReloadSystemFonts(); | |
| break; | |
| } | |
| switch (message) { | |
| case WM_FONTCHANGE: | |
| if (flutter_controller_) { | |
| flutter_controller_->engine()->ReloadSystemFonts(); | |
| } | |
| break; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@flutter-examples/hello_world/windows/runner/flutter_window.cpp` around lines
64 - 68, Guard the WM_FONTCHANGE handling in the switch before dereferencing
flutter_controller_, following the existing null-check pattern near the top of
the window procedure. Only call engine()->ReloadSystemFonts() when
flutter_controller_ is non-null, while preserving the current message handling
behavior otherwise.
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds Swift Package Manager (SPM) support for the Flutter plugin on Apple platforms and introduces a cross-platform Flutter “hello_world” sample + CI updates to validate CocoaPods/SPM builds.
Changes:
- Add SPM
Package.swiftdefinitions forsherpa_onnx_iosandsherpa_onnx_macos, and adjust podspecs to vendor the xcframework. - Update Dart/Flutter dynamic library loading to use
SherpaOnnxC.frameworkpaths for Apple platforms, and add a full multi-platform Flutter example app. - Expand/adjust GitHub Actions workflows to build/test Flutter/Dart across platforms and handle xcframework artifacts.
Reviewed changes
Copilot reviewed 98 out of 140 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/dart/version-pubspec.yaml | Adds path dependency for Dart scripts. |
| new-release.sh | Bumps workflow version replacement coverage. |
| flutter/sherpa_onnx_macos/macos/sherpa_onnx_macos/Sources/sherpa_onnx_macos/SherpaOnnxMacosPlugin.swift | Adds minimal Swift source for SPM target. |
| flutter/sherpa_onnx_macos/macos/sherpa_onnx_macos/Package.swift | Adds SPM package definition for macOS plugin. |
| flutter/sherpa_onnx_macos/macos/sherpa_onnx_macos.podspec | Switches macOS podspec to vendored xcframework + min macOS 10.15. |
| flutter/sherpa_onnx_ios/ios/sherpa_onnx_ios/Sources/sherpa_onnx_ios/SherpaOnnxIosPlugin.swift | Adds minimal Swift source for SPM target. |
| flutter/sherpa_onnx_ios/ios/sherpa_onnx_ios/Package.swift | Adds SPM package definition for iOS plugin. |
| flutter/sherpa_onnx_ios/ios/sherpa_onnx_ios.podspec | Switches iOS podspec to vendored xcframework. |
| flutter/sherpa_onnx/lib/sherpa_onnx.dart | Updates Apple platform library loading paths for framework/xcframework. |
| flutter-examples/hello_world/windows/runner/win32_window.h | Adds Windows runner window abstraction. |
| flutter-examples/hello_world/windows/runner/win32_window.cpp | Adds Win32 window implementation incl. DPI + theming. |
| flutter-examples/hello_world/windows/runner/utils.h | Adds Windows runner utility declarations. |
| flutter-examples/hello_world/windows/runner/utils.cpp | Adds console + UTF conversion helpers for Windows runner. |
| flutter-examples/hello_world/windows/runner/runner.exe.manifest | Adds Windows manifest (PerMonitorV2 DPI). |
| flutter-examples/hello_world/windows/runner/resource.h | Adds Windows resource identifiers. |
| flutter-examples/hello_world/windows/runner/main.cpp | Adds Windows app entrypoint for sample. |
| flutter-examples/hello_world/windows/runner/flutter_window.h | Adds Flutter-hosting window wrapper (Windows). |
| flutter-examples/hello_world/windows/runner/flutter_window.cpp | Implements Flutter-hosting window (Windows). |
| flutter-examples/hello_world/windows/runner/Runner.rc | Adds Windows resources/version info for sample. |
| flutter-examples/hello_world/windows/runner/CMakeLists.txt | Adds Windows runner CMake build. |
| flutter-examples/hello_world/windows/flutter/CMakeLists.txt | Adds generated Flutter Windows build integration. |
| flutter-examples/hello_world/windows/CMakeLists.txt | Adds top-level Windows CMake config for sample. |
| flutter-examples/hello_world/windows/.gitignore | Ignores Windows ephemeral/build artifacts for sample. |
| flutter-examples/hello_world/web/manifest.json | Adds web manifest for sample. |
| flutter-examples/hello_world/web/index.html | Adds web bootstrap HTML for sample. |
| flutter-examples/hello_world/pubspec.yaml | Adds Flutter sample pubspec (depends on sherpa_onnx). |
| flutter-examples/hello_world/macos/RunnerTests/RunnerTests.swift | Adds macOS RunnerTests stub. |
| flutter-examples/hello_world/macos/Runner/Release.entitlements | Adds macOS release entitlements for sample. |
| flutter-examples/hello_world/macos/Runner/MainFlutterWindow.swift | Adds macOS window host for Flutter sample. |
| flutter-examples/hello_world/macos/Runner/Info.plist | Adds macOS Info.plist for sample. |
| flutter-examples/hello_world/macos/Runner/DebugProfile.entitlements | Adds macOS debug/profile entitlements for sample. |
| flutter-examples/hello_world/macos/Runner/Configs/Warnings.xcconfig | Adds warning settings for macOS sample. |
| flutter-examples/hello_world/macos/Runner/Configs/Release.xcconfig | Adds macOS release xcconfig includes. |
| flutter-examples/hello_world/macos/Runner/Configs/Debug.xcconfig | Adds macOS debug xcconfig includes. |
| flutter-examples/hello_world/macos/Runner/Configs/AppInfo.xcconfig | Adds macOS app metadata config. |
| flutter-examples/hello_world/macos/Runner/Base.lproj/MainMenu.xib | Adds macOS UI resources for sample. |
| flutter-examples/hello_world/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json | Adds macOS app icon set metadata. |
| flutter-examples/hello_world/macos/Runner/AppDelegate.swift | Adds macOS app delegate for sample. |
| flutter-examples/hello_world/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | Adds macOS workspace checks file. |
| flutter-examples/hello_world/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | Adds macOS scheme for sample. |
| flutter-examples/hello_world/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | Adds macOS project workspace checks. |
| flutter-examples/hello_world/macos/Runner.xcodeproj/project.pbxproj | Adds macOS Xcode project config (incl. SPM plugin package ref). |
| flutter-examples/hello_world/macos/Flutter/Flutter-Release.xcconfig | Adds macOS Flutter release config include. |
| flutter-examples/hello_world/macos/Flutter/Flutter-Debug.xcconfig | Adds macOS Flutter debug config include. |
| flutter-examples/hello_world/macos/.gitignore | Ignores macOS Pods/ephemeral artifacts. |
| flutter-examples/hello_world/linux/runner/my_application.h | Adds Linux runner application declaration. |
| flutter-examples/hello_world/linux/runner/my_application.cc | Adds Linux runner implementation. |
| flutter-examples/hello_world/linux/runner/main.cc | Adds Linux runner entrypoint. |
| flutter-examples/hello_world/linux/runner/CMakeLists.txt | Adds Linux runner build config. |
| flutter-examples/hello_world/linux/flutter/CMakeLists.txt | Adds Linux Flutter build integration. |
| flutter-examples/hello_world/linux/CMakeLists.txt | Adds top-level Linux CMake config for sample. |
| flutter-examples/hello_world/linux/.gitignore | Ignores Linux ephemeral dir. |
| flutter-examples/hello_world/lib/main.dart | Adds Flutter UI showing version/git/runtime info. |
| flutter-examples/hello_world/ios/RunnerTests/RunnerTests.swift | Adds iOS RunnerTests stub. |
| flutter-examples/hello_world/ios/Runner/SceneDelegate.swift | Adds iOS SceneDelegate for sample. |
| flutter-examples/hello_world/ios/Runner/Runner-Bridging-Header.h | Adds iOS bridging header for plugin registrant. |
| flutter-examples/hello_world/ios/Runner/Info.plist | Adds iOS Info.plist for sample. |
| flutter-examples/hello_world/ios/Runner/Base.lproj/Main.storyboard | Adds iOS main storyboard for sample. |
| flutter-examples/hello_world/ios/Runner/Base.lproj/LaunchScreen.storyboard | Adds iOS launch storyboard for sample. |
| flutter-examples/hello_world/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md | Adds iOS launch image README. |
| flutter-examples/hello_world/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json | Adds iOS launch image set metadata. |
| flutter-examples/hello_world/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json | Adds iOS app icon set metadata. |
| flutter-examples/hello_world/ios/Runner/AppDelegate.swift | Adds iOS AppDelegate + implicit engine registration. |
| flutter-examples/hello_world/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | Adds iOS workspace settings. |
| flutter-examples/hello_world/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | Adds iOS workspace checks file. |
| flutter-examples/hello_world/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | Adds iOS scheme for sample. |
| flutter-examples/hello_world/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | Adds iOS project workspace settings. |
| flutter-examples/hello_world/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | Adds iOS project workspace checks. |
| flutter-examples/hello_world/ios/Runner.xcodeproj/project.pbxproj | Adds iOS Xcode project config (incl. SPM plugin package ref). |
| flutter-examples/hello_world/ios/Flutter/Release.xcconfig | Adds iOS Flutter release config include. |
| flutter-examples/hello_world/ios/Flutter/Debug.xcconfig | Adds iOS Flutter debug config include. |
| flutter-examples/hello_world/ios/Flutter/AppFrameworkInfo.plist | Adds iOS Flutter framework Info.plist. |
| flutter-examples/hello_world/ios/.gitignore | Ignores iOS Pods/DerivedData/ephemeral artifacts. |
| flutter-examples/hello_world/android/settings.gradle.kts | Adds Android Gradle settings for sample. |
| flutter-examples/hello_world/android/gradle/wrapper/gradle-wrapper.properties | Adds Gradle wrapper config for sample. |
| flutter-examples/hello_world/android/gradle.properties | Adds Gradle properties for sample. |
| flutter-examples/hello_world/android/build.gradle.kts | Adds top-level Android build config for sample. |
| flutter-examples/hello_world/android/app/src/profile/AndroidManifest.xml | Adds profile manifest (INTERNET) for sample. |
| flutter-examples/hello_world/android/app/src/main/res/values/styles.xml | Adds light theme resources for sample. |
| flutter-examples/hello_world/android/app/src/main/res/values-night/styles.xml | Adds dark theme resources for sample. |
| flutter-examples/hello_world/android/app/src/main/res/drawable/launch_background.xml | Adds splash background drawable for sample. |
| flutter-examples/hello_world/android/app/src/main/res/drawable-v21/launch_background.xml | Adds v21 splash background drawable for sample. |
| flutter-examples/hello_world/android/app/src/main/kotlin/com/k2fsa/hello_world/MainActivity.kt | Adds Android MainActivity for sample. |
| flutter-examples/hello_world/android/app/src/main/AndroidManifest.xml | Adds Android app manifest for sample. |
| flutter-examples/hello_world/android/app/src/debug/AndroidManifest.xml | Adds debug manifest (INTERNET) for sample. |
| flutter-examples/hello_world/android/app/build.gradle.kts | Adds Android app build config for sample. |
| flutter-examples/hello_world/android/.gitignore | Ignores Android build/keys/local props. |
| flutter-examples/hello_world/analysis_options.yaml | Adds analyzer config for Flutter sample. |
| flutter-examples/hello_world/README.md | Documents setup/build/troubleshooting for sample. |
| flutter-examples/hello_world/.metadata | Adds Flutter tool metadata for sample. |
| flutter-examples/hello_world/.gitignore | Adds top-level ignore rules for sample. |
| dart-api-examples/version/pubspec.yaml | Adds path dependency for version Dart example. |
| dart-api-examples/version/bin/main.dart | Initializes sherpa_onnx for CLI before version calls. |
| dart-api-examples/version/bin/init.dart | Links to shared init logic (symlink). |
| dart-api-examples/non-streaming-asr/pubspec.lock | Removes committed lockfile. |
| build-ios-shared.sh | Removes stale note about onnxruntime static libs. |
| .github/workflows/test-flutter.yaml | Adds multi-platform Flutter CI incl. CocoaPods vs SPM. |
| .github/workflows/test-flutter-package.yaml | Adds/updates package-based Flutter CI across platforms. |
| .github/workflows/test-dart.yaml | Updates Dart CI to build xcframework on macOS. |
| .github/workflows/test-dart-package.yaml | Adds macOS xcframework-based Dart package test job. |
| .github/workflows/release-dart-package.yaml | Switches Apple release packaging to download prebuilt xcframeworks. |
Files not reviewed (3)
- flutter-examples/hello_world/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Generated file
- flutter-examples/hello_world/ios/Runner.xcworkspace/contents.xcworkspacedata: Generated file
- flutter-examples/hello_world/macos/Runner.xcworkspace/contents.xcworkspacedata: Generated file
Suppressed comments (3)
flutter-examples/hello_world/windows/runner/utils.cpp:1
freopen_sreturns 0 on success, but the currentif (freopen_s(...))branches run only on failure, so stdout/stderr redirection is skipped in the success path. Invert the condition (e.g., check== 0) and ensure stderr duplicates_fileno(stderr)(or duplicates to fd 2 from the stderr stream) rather than duplicating stdout in both cases.
flutter/sherpa_onnx/lib/sherpa_onnx.dart:1- The macOS Dart-CLI fallback hard-codes the xcframework variant directory (
macos-arm64_x86_64), which will fail if the xcframework contains a different slice directory (e.g.,macos-arm64,macos-x86_64, or other naming depending on how it was produced). Prefer selecting the correct variant based onAbi.current()(fromdart:ffi) or attempt a small ordered set of known variant paths and open the first one that exists.
flutter/sherpa_onnx/lib/sherpa_onnx.dart:1 - The comment has a grammatical error; consider changing 'not-empty' to 'non-empty' (or rephrasing to 'This is non-empty for Dart CLI').
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - master | ||
| - dart-api | ||
| - dart | ||
| paths: | ||
| - '.github/workflows/test-dart.yaml' | ||
| - '.github/scripts/test-dart.sh' | ||
| - 'dart-api-examples/**' | ||
| - 'flutter/**' | ||
|
|
||
| workflow_dispatch: |
Fixes #3428
Fixes #3704
Fixes #1527
Fixes #1172
Fixes #1283
@abdallahshaban557
@uakihir0
@docaohuynh
@xyhuangjia
@ermi14
@22826165
@GigaDroid
@BrutalCoding
@helang1991
@eschmidbauer
@hantrungkien
@w-rui
@keyur2maru
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests