publish/scripts/installer.js
/**
 * Create the iOS PodFile for installing the Firebase iOS dependencies and service dependencies
 *
 * @param {any} result The answers to the micro-service prompts
 */
Create the iOS PodFile for installing the Firebase iOS dependencies and service dependencies
@param {any} result The answers to the micro-service prompts
Create the iOS PodFile for installing the Firebase iOS dependencies and service dependencies @param { any } result The answers to the micro - service prompts
function writePodFile(result) {
  if (!fs.existsSync(directories.ios)) {
    fs.mkdirSync(directories.ios);
  }
  try {
    fs.writeFileSync(directories.ios + '/Podfile',
(isPresent(result.ml_kit) ? `` : `#`) + `platform :ios, '9.0'
pod 'Firebase/Core', '~> 5.12.0'
# Authentication
` + (!isPresent(result.authentication) || isSelected(result.authentication) ? `` : `#`) + `pod 'Firebase/Auth'
# Realtime DB
` + (!isPresent(result.realtimedb) || isSelected(result.realtimedb) ? `` : `#`) + `pod 'Firebase/Database'
# Cloud Firestore
` + (isSelected(result.firestore) ? `` : `#`) + `pod 'Firebase/Firestore'
# Remote Config
` + (isSelected(result.remote_config) ? `` : `#`) + `pod 'Firebase/RemoteConfig'
# Performance Monitoring
` + (isSelected(result.performance_monitoring) ? `` : `#`) + `pod 'Firebase/Performance'
# Crash Reporting
` + (isSelected(result.crash_reporting) && !isSelected(result.crashlytics) ? `` : `#`) + `pod 'Firebase/Crash'
# Crashlytics
` + (isSelected(result.crashlytics) ? `` : `#`) + `pod 'Fabric'
` + (isSelected(result.crashlytics) ? `` : `#`) + `pod 'Crashlytics'
` + (!isSelected(result.crashlytics) ? `` : `
# Crashlytics works best without bitcode
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ENABLE_BITCODE'] = "NO"
            config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = "YES"
        end
    end
end`) + `
# Firebase Cloud Messaging (FCM)
` + (isSelected(result.messaging) ? `` : `#`) + `pod 'Firebase/Messaging'
# Firebase Cloud Storage
` + (isSelected(result.storage) ? `` : `#`) + `pod 'Firebase/Storage'
# Firebase Cloud Functions
` + (isSelected(result.functions) ? `` : `#`) + `pod 'Firebase/Functions'
# AdMob
` + (isSelected(result.admob) ? `` : `#`) + `pod 'Firebase/AdMob'
# Invites
` + (isSelected(result.invites) ? `` : `#`) + `pod 'Firebase/Invites'
# Dynamic Links
` + (isSelected(result.dynamic_links) ? `` : `#`) + `pod 'Firebase/DynamicLinks'
# ML Kit
` + (isSelected(result.ml_kit) ? `` : `#`) + `pod 'Firebase/MLVision'
` + (isSelected(result.ml_kit) && isSelected(result.ml_kit_text_recognition) ? `` : `#`) + `pod 'Firebase/MLVisionTextModel'
` + (isSelected(result.ml_kit) && isSelected(result.ml_kit_barcode_scanning) ? `` : `#`) + `pod 'Firebase/MLVisionBarcodeModel'
` + (isSelected(result.ml_kit) && isSelected(result.ml_kit_face_detection) ? `` : `#`) + `pod 'Firebase/MLVisionFaceModel'
` + (isSelected(result.ml_kit) && isSelected(result.ml_kit_image_labeling) ? `` : `#`) + `pod 'Firebase/MLVisionLabelModel'
` + (isSelected(result.ml_kit) && isSelected(result.ml_kit_custom_model) ? `` : `#`) + `pod 'Firebase/MLModelInterpreter'
# Facebook Authentication
` + (isSelected(result.facebook_auth) ? `` : `#`) + `pod 'FBSDKCoreKit'
` + (isSelected(result.facebook_auth) ? `` : `#`) + `pod 'FBSDKLoginKit'
# Google Authentication
` + (isSelected(result.google_auth) ? `` : `#`) + `pod 'GoogleSignIn'`);
    console.log('Successfully created iOS (Pod) file.');
  } catch (e) {
    console.log('Failed to create iOS (Pod) file.');
    console.log(e);
  }
}
function writePodFile ( result ) { if ( ! fs . existsSync ( directories . ios ) ) { fs . mkdirSync ( directories . ios ) ; } try { fs . writeFileSync ( directories . ios + '/Podfile' , ( isPresent ( result . ml_kit ) ? ` ` : ` ` ) + ` ` + ( ! isPresent ( result . authentication ) || isSelected ( result . authentication ) ? ` ` : ` ` ) + ` ` + ( ! isPresent ( result . realtimedb ) || isSelected ( result . realtimedb ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . firestore ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . remote_config ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . performance_monitoring ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . crash_reporting ) && ! isSelected ( result . crashlytics ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . crashlytics ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . crashlytics ) ? ` ` : ` ` ) + ` ` + ( ! isSelected ( result . crashlytics ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . messaging ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . storage ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . functions ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . admob ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . invites ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . dynamic_links ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . ml_kit ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . ml_kit ) && isSelected ( result . ml_kit_text_recognition ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . ml_kit ) && isSelected ( result . ml_kit_barcode_scanning ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . ml_kit ) && isSelected ( result . ml_kit_face_detection ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . ml_kit ) && isSelected ( result . ml_kit_image_labeling ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . ml_kit ) && isSelected ( result . ml_kit_custom_model ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . facebook_auth ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . facebook_auth ) ? ` ` : ` ` ) + ` ` + ( isSelected ( result . google_auth ) ? ` ` : ` ` ) + ` ` ) ; console . log ( 'Successfully created iOS (Pod) file.' ) ; } catch ( e ) { console . log ( 'Failed to create iOS (Pod) file.' ) ; console . log ( e ) ; } }
Create the iOS PodFile for installing the Firebase iOS dependencies and service dependencies
 @param {any} result The answers to the micro-service prompts
Create the iOS PodFile for installing the Firebase iOS dependencies and service dependencies @param { any } result The answers to the micro - service prompts
// The MLVision pod requires a minimum of iOS 9, otherwise the build will fail