feat(firebaseai): add spm support for firebase_ai, and update example to running with spm#18159
feat(firebaseai): add spm support for firebase_ai, and update example to running with spm#18159cynthiajoan wants to merge 8 commits intomainfrom
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces Swift Package Manager (SPM) support for the firebase_ai package on iOS and macOS and updates the example project configuration. Feedback highlights several critical issues: the record package upgrade introduces breaking changes that likely require code updates, and the macOS project file is missing a required package property for its Swift package dependency. Furthermore, the iOS configuration is now inconsistent due to the removal of CocoaPods build phases and the MinimumOSVersion key, and the migration metadata incorrectly replaced the Android platform entry instead of appending macOS.
I am having trouble creating individual review comments. Click here to see my feedback.
packages/firebase_ai/firebase_ai/example/pubspec.yaml (36)
The record package has been upgraded from ^5.2.1 to ^6.2.0. This is a major version update with breaking changes (e.g., the Record class was renamed to AudioRecorder). Please ensure that the example's Dart code has been updated to accommodate these changes, otherwise the app will fail to compile.
packages/firebase_ai/firebase_ai/example/macos/Runner.xcodeproj/project.pbxproj (825-828)
The XCSwiftPackageProductDependency entry for FlutterGeneratedPluginSwiftPackage is missing the package property. This property is required to link the product dependency to its corresponding package reference (781AD8BC2B33823900A9FFBB). Without it, Xcode will not be able to resolve the dependency, leading to build failures.
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
isa = XCSwiftPackageProductDependency;
package = 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */;
productName = FlutterGeneratedPluginSwiftPackage;
};
packages/firebase_ai/firebase_ai/example/ios/Runner.xcodeproj/project.pbxproj (198-205)
The CocoaPods build phases ([CP] Check Pods Manifest.lock and [CP] Embed Pods Frameworks) were removed from the iOS target. However, the project still contains a Podfile and depends on other plugins (like firebase_core) that likely still require CocoaPods. Removing these phases will break the build for those dependencies.
packages/firebase_ai/firebase_ai/example/ios/Flutter/AppFrameworkInfo.plist (23-24)
The MinimumOSVersion key was removed from AppFrameworkInfo.plist. This key is typically required for frameworks on iOS to specify their minimum supported version. Removing it may cause issues during the build process or when submitting the app.
packages/firebase_ai/firebase_ai/example/.metadata (18-20)
The android platform entry was replaced by macos in the migration metadata. This file should track all platforms associated with the project. Removing the android entry may cause issues with Flutter's migration and upgrade tools for that platform. Please add macos as a new entry instead of replacing the existing one.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces Swift Package Manager (SPM) support for the firebase_ai plugin on iOS and macOS, alongside updates to the example app's build configurations and dependencies. Feedback focuses on critical structural issues: the Package.swift files are incorrectly placed in subdirectories, which prevents automatic discovery by Flutter, and essential Firebase SDK dependencies are missing from the package definitions. Additionally, it is recommended to avoid hardcoding the library version to reduce maintenance overhead.
Lyokone
left a comment
There was a problem hiding this comment.
Looks great. You need to add firebase_ai to this: https://github.com/firebase/flutterfire/blob/main/.github/workflows/all_plugins.yaml#L139 so we can have the CI checking the SPM status as well :)
Description
Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change.
Related Issues
Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?