flutterfire_cli
flutterfire_cli copied to clipboard
feat: Try to Support flavors (android & ios)
Description
Firebase CLI will try to get all flavors for the android project and variant build configrations for the ios project and show a prompt to the ser
? Do you want to create a firebase project for each flavor? (y/n)
if the user selects "y" for each flavor firebase CLI will create a firebase project with selected platforms
-
create
firebase_options.dart
for each flavor For example: (lib/firebase_options_development.dart, lib/firebase_options_production.dart, lib/firebase_options_staging.dart) -
create
firebase_app_id_file.json
for each flavor For example: (ios/firebase_app_id_file_development.json, ios/firebase_app_id_file_production.json, ios/firebase_app_id_file_staging.json) -
create
google-services.json
for each flavor For example: (android/app/src/development/google-services.json, android/app/src/production/google-services.json, android/app/src/staging/google-services.json) -
create
GoogleService-Info.plist
for each flavor For example: (ios/Runner/development/GoogleService-Info.plist, ios/Runner/production/GoogleService-Info.plist, ios/Runner/staging/GoogleService-Info.plist)
For ios Project add shell script to copy the correct GoogleService-Info.plist
to the BUILT_PRODUCTS_DIR
based on the selected ios schema:
GOOGLE_SERVICE_INFO_PLIST_FROM="${PROJECT_DIR}/Runner/${FLAVOR}/GoogleService-Info.plist"
BUILD_APP_DIR="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}"
GOOGLE_SERVICE_INFO_PLIST_TO="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app"
cp "${GOOGLE_SERVICE_INFO_PLIST_FROM}" "${GOOGLE_SERVICE_INFO_PLIST_TO}"
Please try it ๐๐
Type of Change
- [x] โจ
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 refactor - [ ] โ
ci
-- Build configuration change - [ ] ๐
docs
-- Documentation - [ ] ๐๏ธ
chore
-- Chore
I opened this PR based on this issue https://github.com/invertase/flutterfire_cli/issues/14
I've try the PR using the VGV CLI:
very_good create project --desc "Project" --org "com.lyokone.project"
It produces the following result:
FileSystemException: Cannot open file, path = 'project/android/app/src/production/google-services.json' (OS Error: No such file or directory, errno = 2)
I feel like matching the name of the flavor with a folder can produce unexpected results on Android ๐ค
I've try the PR using the VGV CLI:
very_good create project --desc "Project" --org "com.lyokone.project"
It produces the following result:
FileSystemException: Cannot open file, path = 'project/android/app/src/production/google-services.json' (OS Error: No such file or directory, errno = 2)
I feel like matching the name of the flavor with a folder can produce unexpected results on Android ๐ค
I think Each flavor must have a folder with its name
I tried to fix this by checking if the folder exists before creating androidGoogleServicesJsonFile
any suggestions?
any news about this PR?
@ulisseshen, @russellwheatley is currently working on this feature in this PR: https://github.com/invertase/flutterfire_cli/pull/132
@ulisseshen, @russellwheatley is currently working on this feature in this PR: #132
thanks for response.
Closing as this is no longer necessary. See https://github.com/invertase/flutterfire_cli/pull/132