Skip to content
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

Add flavors to macOS #1078

Merged
merged 8 commits into from
Dec 15, 2023
Merged

Add flavors to macOS #1078

merged 8 commits into from
Dec 15, 2023

Conversation

nilsreichardt
Copy link
Member

@nilsreichardt nilsreichardt commented Sep 22, 2023

Summary

With this PR, we support prod and dev flavors for our macOS app. Make you sure, you have the 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:

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

@github-actions
Copy link

github-actions bot commented Sep 22, 2023

Visit the preview URL for this PR (updated for commit 78c763a):

https://sharezone-test--pr1078-macos-flavor-2-lgsnw1cz.web.app

(expires Mon, 18 Dec 2023 14:39:47 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4cb3ae61e1e018abfd9841fd3239f5b49ccc034b

@nilsreichardt
Copy link
Member Author

Current status: The PR should be ready, but there is a bug in the flutterfire configure which broke our macOS app. Therefore, we can't build the macOS app anymore. When the following ticket is implemented, we should be able to build the app: invertase/flutterfire_cli#244.

);
MACOSX_DEPLOYMENT_TARGET = 10.15;
PRODUCT_BUNDLE_IDENTIFIER = de.codingbrain.sharezone.app.dev;
PRODUCT_NAME = dev_Sharezone;
Copy link
Member Author

Choose a reason for hiding this comment

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

On iOS, we use the product name "dev Sharezone" for the dev environment. However, the FlutterFire CLI has a bug and doesn't support spaces in the product name, see invertase/flutterfire_cli#243. Therefore, we use a workaround "dev_Sharezone" instead of "dev Sharezone" as product name.

@nilsreichardt nilsreichardt marked this pull request as ready for review December 14, 2023 19:59
Copy link
Collaborator

@Jonas-Sander Jonas-Sander left a comment

Choose a reason for hiding this comment

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

Nice, LGTM! 👍

@nilsreichardt nilsreichardt added this pull request to the merge queue Dec 15, 2023
Merged via the queue into main with commit 0100afb Dec 15, 2023
33 checks passed
@nilsreichardt nilsreichardt deleted the macos-flavor-2 branch December 15, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[macOS] Add Flutter flavors
2 participants