-
Notifications
You must be signed in to change notification settings - Fork 61
feat: new command line args & command prompts for Google service file output & write debug symbol scripts to negate the use of "firebase_app_id_file.json" #132
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 tasks
Lyokone
reviewed
Nov 24, 2022
Co-authored-by: Guillaume Bernos <[email protected]>
Lyokone
reviewed
Nov 29, 2022
Lyokone
approved these changes
Nov 30, 2022
The example should be |
@creativecreatorormaybenot yes, I've updated the description 👍 |
Closed
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Allow the option of writing iOS, macOS & android Google service file to a specified directory. How it works:
Example:
flutterfire configure --ios-out=/ios/GoogleService-Info.plist \ --android-out=/android/google-services.json \ --macos-out=/macos/GoogleService-Info.plist
It uses the Flutter project as the root and adds the service file to the path and file name specified in the CLI options. The above example would add the service files to the root of each platform folder:
cool_flutter_project/ios/GoogleService-Info.plist
cool_flutter_project/android/google-services.json
cool_flutter_project/macos/GoogleService-Info.plist
Implementation
android
There isn't much to do for android except to write the file. according to the multi-environment documentation, you simply need to write the service file to the correct directory (e.g.
android/app/src/development/google-services.json
).FFCLI also writes to the
android/build.gradle
&android/app/build.gradle
which are used across all builds & flavors.iOS & macOS
The approach I'm taking is to prompt the user to pick whether to write the service file for a scheme, target or to simply write to a path without any further configuration.
Find schemes available and add a build phase script that adds the file to the app bundle. You can have multiple scheme configurations and it will still add to the app bundle. For instance, suppose you were using VGV CLI, and you chose to add a service file to the
development
scheme. It will include the service file the app bundle for the following configurationsRelease-development
,Staging-development
&Debug-development
.Example of script added to build phases:
Target
This is more straight forward, a command prompt allows you to select the desired target to include the service file. It will then add it to the "Copy bundle resources" phase for that target.
Write with no further configuration
This command prompt will simply add the file to the desired destination, creating necessary directories and is for user who want to do their own config setup.
firebase_app_id.json
file write.I've removed the need to have a
firebase_app_id.json
. The user now has the option to update their build phases with a script that will upload the debug symbols for Crashlytics for their setup (i.e. target or scheme). If the user selects a project setup that uses schemes for example, the CLI will write a bash script that will run for that specific scheme.The example below is the script written if the user selects a "development" scheme script:
The below example is a target script. In this example, the target they selected is "Runner":
Here's an example of the scripts written when using "schemes" setup. They will only be written once for each

flutterfire configure
call:Notes
ios/firebase_app_id_file.json
&macos/firebase_app_id_file.json
because the script is now added in the build phases.closes #14
Type of Change
feat
-- New feature (non-breaking change which adds functionality)fix
-- Bug fix (non-breaking change which fixes an issue)!
-- Breaking change (fix or feature that would cause existing functionality to change)refactor
-- Code refactorci
-- Build configuration changedocs
-- Documentationchore
-- Chore