Skip to content

feat(firebaseai): add spm support for firebase_ai, and update example to running with spm#18159

Open
cynthiajoan wants to merge 8 commits intomainfrom
firebaseai/example_no_cocoapod
Open

feat(firebaseai): add spm support for firebase_ai, and update example to running with spm#18159
cynthiajoan wants to merge 8 commits intomainfrom
firebaseai/example_no_cocoapod

Conversation

@cynthiajoan
Copy link
Copy Markdown
Collaborator

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.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

@cynthiajoan
Copy link
Copy Markdown
Collaborator Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

high

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)

high

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)

high

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)

medium

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)

medium

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.

@cynthiajoan
Copy link
Copy Markdown
Collaborator Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@Lyokone Lyokone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants