Skip to content

Commit

Permalink
(ios) Check if SKIP_FIREBASE_FIRESTORE_SWIFT environment variable is …
Browse files Browse the repository at this point in the history
…set if plugin variable IOS_USE_PRECOMPILED_FIRESTORE_POD is set to true
  • Loading branch information
Dave Alden committed Nov 6, 2024
1 parent d622044 commit 081b7d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,13 @@ The following plugin variables are used to specify the Firebase SDK versions as
- `IOS_GOOGLE_TAG_MANAGER_VERSION` - a specific version of the Google Tag Manager library to set in the Podfile
- If not specified, the default version defined in the `<pod>` element in the `plugin.xml` will be used.
- `IOS_USE_PRECOMPILED_FIRESTORE_POD` - if `true`, switches Podfile to use a [pre-compiled version of the Firestore pod](https://github.com/invertase/firestore-ios-sdk-frameworks.git) to reduce build time
- Since some users experienced long build times due to the Firestore pod (see [#407](https://github.com/dpa99c/cordova-plugin-firebasex/issues/407))
- However other users have experienced build issues with the pre-compiled version (see [#735](https://github.com/dpa99c/cordova-plugin-firebasex/issues/735))
- Defaults to `false` if not specified.
- Note that this is a [post-install plugin variable](#post-install-plugin-variables) so an additional step is required to activate the plugin variable the first time it is specified.
- Defaults to `false` if not specified.
- Since some users experienced long build times due to the Firestore pod (see [#407](https://github.com/dpa99c/cordova-plugin-firebasex/issues/407))
- However, other users have experienced build issues with the pre-compiled version (see [#735](https://github.com/dpa99c/cordova-plugin-firebasex/issues/735))
- If you set this option to `true`, you must ensure the environment variable `SKIP_FIREBASE_FIRESTORE_SWIFT` is set **globally** to a truthy value
- e.g. If using zsh: `echo 'export SKIP_FIREBASE_FIRESTORE_SWIFT=1' >> ~/.zshrc && source ~/.zshrc`
- This ensures the pre-built pod is compatible with the Cordova project environment ([see here](https://github.com/invertase/firestore-ios-sdk-frameworks/issues/62))
- Note that this is a [post-install plugin variable](#post-install-plugin-variables) so an additional step is required to activate the plugin variable the first time it is specified.
- `IOS_STRIP_DEBUG` - prevents symbolification of all libraries included via Cocoapods. See [Strip debug symbols](#strip-debug-symbols) for more info.
- e.g. `--variable IOS_STRIP_DEBUG=true`
- Defaults to `false` if not specified.
Expand Down
14 changes: 9 additions & 5 deletions scripts/ios/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,15 @@ end
}

if(pluginVariables['IOS_USE_PRECOMPILED_FIRESTORE_POD'] === 'true'){
var standardFirestorePodMatches = podFileContents.match(standardFirestorePodRegEx);
if(standardFirestorePodMatches){
podFileContents = podFileContents.replace(standardFirestorePodMatches[0], prebuiltFirestorePodTemplate.replace('{version}', standardFirestorePodMatches[1]));
podFileModified = true;
utilities.log("Configured Podfile for pre-built Firestore pod");
if(process.env.SKIP_FIREBASE_FIRESTORE_SWIFT){
var standardFirestorePodMatches = podFileContents.match(standardFirestorePodRegEx);
if(standardFirestorePodMatches){
podFileContents = podFileContents.replace(standardFirestorePodMatches[0], prebuiltFirestorePodTemplate.replace('{version}', standardFirestorePodMatches[1]));
podFileModified = true;
utilities.log("Configured Podfile for pre-built Firestore pod");
}
}else{
throw new Error("The environment variable SKIP_FIREBASE_FIRESTORE_SWIFT is not set. This is required to use the pre-built Firestore pod.")
}
}
if(podFileModified) {
Expand Down

0 comments on commit 081b7d7

Please sign in to comment.