feat(cli): command line arguments for different environments#138
Merged
russellwheatley merged 10 commits intomainfrom Jan 5, 2023
Merged
feat(cli): command line arguments for different environments#138russellwheatley merged 10 commits intomainfrom
russellwheatley merged 10 commits intomainfrom
Conversation
Lyokone
reviewed
Jan 4, 2023
Comment on lines
+120
to
+121
| 'debug-symbols-ios', | ||
| abbr: 'r', |
Contributor
There was a problem hiding this comment.
Suggested change
| 'debug-symbols-ios', | |
| abbr: 'r', | |
| 'debug-symbols-ios', | |
| abbr: 'dsi', |
Member
Author
There was a problem hiding this comment.
Unfortunately, we cannot change abbreviations to anything more than single characters 😓, @Lyokone
Comment on lines
+128
to
+129
| 'debug-symbols-macos', | ||
| abbr: 's', |
Contributor
There was a problem hiding this comment.
Suggested change
| 'debug-symbols-macos', | |
| abbr: 's', | |
| 'debug-symbols-macos', | |
| abbr: 'dsm', |
|
|
||
| argParser.addFlag( | ||
| 'overwrite-firebase-options', | ||
| abbr: 'f', |
Contributor
There was a problem hiding this comment.
Suggested change
| abbr: 'f', | |
| abbr: 'ow', |
Lyokone
approved these changes
Jan 5, 2023
1 task
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
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
Created command line arguments which negate the need to use the command prompts. The following command line arguments have been added:
ios-scheme- pass in the name of the scheme you wish to use for your iOS project.macos-scheme- pass in the name of the scheme you wish to use for your macOS project.ios-target- - pass in the name of the target you wish to use for your iOS project.macos-target- - pass in the name of the target you wish to use for your macOS project.debug-symbols-ios- This is a command line flag. It will add an upload debug symbols script to your iOS target or scheme (depending on whether you usedios-schemeorios-target). This replacesdebug-symbols-scriptwhich was a hidden flag in the last dev release. If you choose to negate the script (i.e.no-debug-symbol-ios), you will not be prompted asking if you wish to write it.debug-symbols-macos- This is a command line flag. It will add an upload debug symbols script to your macOS target or scheme (depending on whether you usedmacos-schemeormacos-target). If you choose to negate the script (i.e.no-debug-symbol-macos), you will not be prompted asking if you wish to write it.overwrite-firebase-options- This is a command line flag. This allows you to overwrite/not overwrite the currentfirebase_options.dartif you're runningflutterfire configureagain. If you choose to negate it (i.e.no-overwrite-firebase-options), you will not be prompted asking if you wish to write it.Notes
ios-schemeORios-target. If you try to set both, the script will throw an error.macos-schemeORmacos-target. If you try to set both, the script will throw an error.ios-schemeormacos-schemesetup, you have to specify a path forios-outormacos-out. If you don't, you will be prompted by the CLI for a path. This is because it is included in the app bundle at build time, and there needs to be a "GoogleService-Info.plist" in the project directory to use. If you choose the "target" method (i.e.ios-targetormacos-target), you do not have to specify a path for "GoogleService-Info.plist" file if you wish (i.e.ios-outormacos-out). This is because the CLI will add the "GoogleService-Info.plist" file to the bundle resources, and it will automatically place the file under the target (e.g.Runner/GoogleService-Info.plist).Examples of commands that completely negate any user input from prompts:
Note, it is required to specify the Firebase project via
--projectargument. You also need to include the--yesflag which does a few things. It will automatically choose all platforms on your project (e.g. iOS, macOS, android & web), will overwritefirebase_options.dart(can also use--overwrite-firebase-optionsfor this specific task), it will also force write necessary updates to androidbuild.gradle's for FlutterFire configuration.Note, the debug symbols scripts are not being written, nor is
firebase_options.dartbeing overwritten. I also removedandroid-outargument to demonstrate that by default, it will write toandroid/app/google-services.jsonas usual.Note, I was using VGV's CLI to create a project for testing as it has different schemes setup from the beginning (i.e. development, staging, production). macOS schemes will be fixed in a future release, so we use the target again here.
To use this dev release:
Related issues
Part of: #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