@@ -3051,7 +3051,6 @@ function promptQuestionsResult(result) {
30513051 writePodFile ( result ) ;
30523052 writeGoogleServiceCopyHook ( ) ;
30533053 writeBuildscriptHookForCrashlytics ( isSelected ( result . crashlytics ) ) ;
3054- writeBuildscriptHookForFirestore ( isSelected ( result . firestore ) ) ;
30553054 activateIOSCrashlyticsFramework ( isSelected ( result . crashlytics ) ) ;
30563055 activateIOSMLKitCameraFramework ( isSelected ( result . ml_kit ) ) ;
30573056 }
@@ -3395,98 +3394,6 @@ module.exports = function($logger, $projectData, hookArgs) {
33953394 }
33963395}
33973396
3398- /**
3399- * Create the iOS build script for setting the workspace to the legacy build system (for now).
3400- *
3401- * @param {any } enable is Firestore enabled
3402- */
3403- function writeBuildscriptHookForFirestore ( enable ) {
3404- var scriptPath = path . join ( appRoot , "hooks" , "after-prepare" , "firebase-firestore-buildscript.js" ) ;
3405-
3406- if ( ! enable ) {
3407- if ( fs . existsSync ( scriptPath ) ) {
3408- fs . unlinkSync ( scriptPath ) ;
3409- }
3410- return
3411- }
3412-
3413- console . log ( "Install Firestore buildscript hook." ) ;
3414- try {
3415- var scriptContent =
3416- `const fs = require('fs-extra');
3417- const path = require('path');
3418-
3419- module.exports = function($logger, $projectData, hookArgs) {
3420- const platformFromHookArgs = hookArgs && (hookArgs.platform || (hookArgs.prepareData && hookArgs.prepareData.platform));
3421- const platform = (platformFromHookArgs || '').toLowerCase();
3422- return new Promise(function(resolve, reject) {
3423- const isNativeProjectPrepared = hookArgs.prepareData ? (!hookArgs.prepareData.nativePrepare || !hookArgs.prepareData.nativePrepare.skipNativePrepare) : (!hookArgs.nativePrepare || !hookArgs.nativePrepare.skipNativePrepare);
3424- if (isNativeProjectPrepared) {
3425- try {
3426- if (platform !== 'ios') {
3427- resolve();
3428- return;
3429- }
3430-
3431- const sanitizedAppName = path.basename($projectData.projectDir).split('').filter((c) => /[a-zA-Z0-9]/.test(c)).join('');
3432-
3433- const xcodeWorkspacePath = path.join($projectData.platformsDir, 'ios', sanitizedAppName + '.xcworkspace');
3434- if (!fs.existsSync(xcodeWorkspacePath)) {
3435- $logger.error(xcodeWorkspacePath + ' is missing.');
3436- reject();
3437- return;
3438- }
3439-
3440- const xcodeWorkspaceShareddataPath = path.join($projectData.platformsDir, 'ios', sanitizedAppName + '.xcworkspace', 'xcshareddata');
3441- $logger.trace('Using Xcode workspace settings path', xcodeWorkspaceShareddataPath);
3442- console.log('Using Xcode workspace settings path: ' + xcodeWorkspaceShareddataPath);
3443-
3444- if (!fs.existsSync(xcodeWorkspaceShareddataPath)) {
3445- fs.mkdirSync(xcodeWorkspaceShareddataPath);
3446- }
3447-
3448- const xcodeWorkspaceSettingsFile = path.join(xcodeWorkspaceShareddataPath, 'WorkspaceSettings.xcsettings');
3449- // for this temp fix we assume that if the file is there, it contains the correct config
3450- if (!fs.existsSync(xcodeWorkspaceSettingsFile)) {
3451- fs.writeFileSync(xcodeWorkspaceSettingsFile, \`<?xml version="1.0" encoding="UTF-8"?>
3452- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3453- <plist version="1.0">
3454- <dict>
3455- <key>BuildSystemType</key>
3456- <string>Original</string>
3457- </dict>
3458- </plist>
3459- \`);
3460- $logger.trace('Xcode workspace file written');
3461- }
3462- resolve();
3463-
3464- } catch (e) {
3465- $logger.error('Unknown error during prepare Firestore', e);
3466- reject();
3467- }
3468- } else {
3469- $logger.trace("Native project not prepared.");
3470- resolve();
3471- }
3472- });
3473- };
3474- ` ;
3475- var afterPrepareDirPath = path . dirname ( scriptPath ) ;
3476- var hooksDirPath = path . dirname ( afterPrepareDirPath ) ;
3477- if ( ! fs . existsSync ( afterPrepareDirPath ) ) {
3478- if ( ! fs . existsSync ( hooksDirPath ) ) {
3479- fs . mkdirSync ( hooksDirPath ) ;
3480- }
3481- fs . mkdirSync ( afterPrepareDirPath ) ;
3482- }
3483- fs . writeFileSync ( scriptPath , scriptContent ) ;
3484- } catch ( e ) {
3485- console . log ( "Failed to install Firestore buildscript hook." ) ;
3486- console . log ( e ) ;
3487- }
3488- }
3489-
34903397/**
34913398 * Create the Android Gradle for installing the Firebase Android dependencies and service dependencies
34923399 *
@@ -3958,4 +3865,4 @@ function isPresent(value) {
39583865
39593866
39603867/***/ } )
3961- /******/ ] ) ;
3868+ /******/ ] ) ;
0 commit comments