Skip to content

[macOS] Add Flutter flavors #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nilsreichardt opened this issue Feb 21, 2023 · 0 comments · Fixed by #1078
Closed

[macOS] Add Flutter flavors #352

nilsreichardt opened this issue Feb 21, 2023 · 0 comments · Fixed by #1078
Labels
code quality Code quality itself (readable) but e.g. also how we might enforce better quality automatically. enhancement New functionality that we agreed on to add in the future. platform: macos

Comments

@nilsreichardt
Copy link
Member

Flutter has added the option to run Flutter flavors for macOS (flutter/flutter#119564). Note that this feature is not available on Flutter stable branch yet.

Flavors allow use to use different Firebase projects (like our dev Firebase project) or different app icons. Especially the ability to use different Firebase projects is really import for in the development process.

@nilsreichardt nilsreichardt added code quality Code quality itself (readable) but e.g. also how we might enforce better quality automatically. platform: macos enhancement New functionality that we agreed on to add in the future. labels Feb 21, 2023
This was referenced Sep 22, 2023
github-merge-queue bot pushed a commit that referenced this issue Dec 15, 2023
## Summary 

With this PR, we support `prod` and `dev` flavors for our macOS app.
Make you sure, you have the [FlutterFire
CLI](https://pub.dev/packages/flutterfire_cli) installed (version
0.3.0-dev.18 or higher), if you want to build for macOS. The FlutterFire
CLI is used during the build process in the XCode build phases
(configuring bundle service files and uploading Crashlytics symbols).

## Details

Because the process of adding Firebase flavors to our macOS isn't
documented well (there is a open PR with more documentation:
invertase/flutterfire_cli#224), I'm describing
here, what I did to support flavors.

First, I needed to execute the following commands:

```sh
flutterfire configure \
  --project=sharezone-debug \
  --platforms=macos \
  --out=lib/firebase_options_dev.g.dart \
  --macos-build-config=Debug-dev \
  --macos-out=macos/config/dev \
  --macos-bundle-id=de.codingbrain.sharezone.app.dev

flutterfire configure \
  --project=sharezone-debug \
  --platforms=macos \
  --out=lib/firebase_options_dev.g.dart \
  --macos-build-config=Profile-dev \
  --macos-out=macos/config/dev \
  --macos-bundle-id=de.codingbrain.sharezone.app.dev

flutterfire configure \
  --project=sharezone-debug \
  --platforms=macos \
  --out=lib/firebase_options_dev.g.dart \
  --macos-build-config=Release-dev \
  --macos-out=macos/config/dev \
  --macos-bundle-id=de.codingbrain.sharezone.app.dev

flutterfire configure \
  --project=sharezone-c2bd8 \
  --platforms=macos \
  --out=lib/firebase_options_prod.g.dart \
  --macos-build-config=Debug-prod \
  --macos-out=macos/config/prod \
  --macos-bundle-id=de.codingbrain.sharezone.app

flutterfire configure \
  --project=sharezone-c2bd8 \
  --platforms=macos \
  --out=lib/firebase_options_prod.g.dart \
  --macos-build-config=Profile-prod \
  --macos-out=macos/config/prod \
  --macos-bundle-id=de.codingbrain.sharezone.app

flutterfire configure \
  --project=sharezone-c2bd8 \
  --platforms=macos \
  --out=lib/firebase_options_prod.g.dart \
  --macos-build-config=Release-prod \
  --macos-out=macos/config/prod \
  --macos-bundle-id=de.codingbrain.sharezone.app
```

The commands configure Firebase for each build config (`Debug-dev`,
`Profile-dev`, `Release-dev`, `Debug-prod`, `Profile-prod`,
`Release-prod`).

Additionally, I needed to set `debug information format` to `DWARF with
dSYM File`, see
https://firebase.google.com/docs/crashlytics/get-started?platform=ios#set-up-dsym-uploading.

## Related Tickets

Closes #352
Related to invertase/flutterfire_cli#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Code quality itself (readable) but e.g. also how we might enforce better quality automatically. enhancement New functionality that we agreed on to add in the future. platform: macos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant