firebase_flavors 3.0.0
firebase_flavors: ^3.0.0 copied to clipboard
A Dart CLI tool for configuring Firebase for multiple Flutter flavors.
3.0.0 #
Breaking Changes #
iosConfigBase default changed
The default ios.configBase is now ios/<target> (e.g. ios/Runner) derived from ios.target, replacing the previous ios/Runner/Runner. The init generator and the example firebase_flavors.yaml now also write ios/Runner so all four sources of truth (model default, generator output, example file, README docs) agree.
Migration: if you relied on the old implicit default, either:
- move your plist files from
ios/<target>/<target>/<flavor>/GoogleService-Info.plisttoios/<target>/<flavor>/GoogleService-Info.plist, or - set
ios.configBase: ios/<target>/<target>explicitly infirebase_flavors.yamlto keep the previous layout.
Placeholder Firebase project IDs removed
init no longer writes your-firebase-project-id-for-<flavor> strings into the generated YAML. The firebaseProjectId field is emitted with an empty value and a TODO comment pointing at set-project-ids. configure now refuses to run if any selected flavor has an unset ID, instead of handing placeholders to flutterfire.
Migration: existing firebase_flavors.yaml files containing firebaseProjectId: your-firebase-project-id-for-<flavor> should be replaced with real IDs (run firebase_flavors set-project-ids).
xcodeprojPath YAML key now read with the documented casing
The model previously read xcodeProjPath (capital P). It now reads xcodeprojPath to match the README, init template, and example file. If your firebase_flavors.yaml accidentally used xcodeProjPath to "match" the parser, rename it to xcodeprojPath. Configurations that already used the documented casing (or relied on the default) are unaffected.
Fixed #
- iOS build-phase shell script no longer uses
declare -A, which is unsupported by the bash 3.2 / POSIX sh that Xcode runs. Existing projects need to rerunfirebase_flavors configure --skip-firebaseonce to regenerate the build phase. - iOS build-phase shell script no longer fails for non-flavor configurations (e.g. plain
Debugon a test target). Such configurations now exit 0 with a stderr notice. firebase_flavors --versionreads the tool's own version instead of the host project'spubspec.yaml.- pbxproj bundle ID extraction now walks the project graph to find the main app target, avoiding bundle IDs from test, UI test, or extension targets.
initno longer recursively scansios/looking forInfo.plist; it reads the canonicalios/<target>/Info.plistonly. Pods directories are no longer traversed.- The "Flavor X not found in configuration" warning no longer prints twice per typo.
configure --helpandset-project-ids --helpnow show command-specific flags (--skip-firebase,--from-files, etc.) alongside global flags.configureno longer mutates the caller'sflavorslist.
Changed #
set-project-idsinteractive prompts now display the current value (orunset) and treat an empty response as "keep current" instead of skipping with a warning.listshows[unset — run set-project-ids]for flavors with no Firebase project ID.logSuccessno longer adds an emoji prefix on top of the printer's automatic level emoji.- Library code throws
FirebaseFlavorsExceptioninstead of callingexit()directly; only the entry point translates exceptions to exit codes. - iOS pbxproj parsing extracted into
IosProjectParser(bin/src/utils/ios_project_parser.dart) so it is testable independently frominit. - YAML field updates use
package:yaml_editinstead of a hand-rolled line parser; comments and structure are now preserved.
Added #
IosProjectParserandYamlUpdatertest suites;FirebaseProjectServicetests coveringextractFromGoogleServices,extractFromGoogleServiceInfo,detectFromConfigFiles, andlistProjects.tool/sync_version.dartgeneratesbin/src/version.dartfrompubspec.yaml. CI verifies the two stay in sync.
Dependencies #
- Added
xcode_parser ^2.1.0for pbxproj parsing. - Added
yaml_edit ^2.2.4for surgical YAML field updates.
2.0.2 #
Fix iOS bundle IDs by replacing underscores with hyphens for Firebase compatibility.
2.0.1 #
Run dart format to fix formatting errors for CI workflow.
2.0.0 #
Breaking Changes #
Remove iosBundleId in favor of iosBundleSuffix
The behavior was changed to match the behavior of androidPackageSuffix.
Instead of supplying the full bundle ID, just supply the suffix. e.g.
iosBundleId: com.example.app.dev becomes iosBundleSuffix: .dev
1.1.0 #
Added #
- New
set-project-idscommand to set Firebase project IDs in the configuration file--from-files: Auto-detect project IDs from existinggoogle-services.jsonorGoogleService-Info.plistfiles--from-firebase: Interactive selection from Firebase CLI projects list--interactive: Prompt for project IDs interactively--project-ids: Direct specification via command line asflavor:project-idpairs
Changed #
- Improved argument parsing and command handling architecture
- Enhanced error messages and command usage information
Documentation #
- Updated README with comprehensive documentation for the new
set-project-idscommand - Added examples demonstrating different ways to use the new command
1.0.0 #
- Initial version.