Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 8117b0c

Browse files
author
James Criscuolo
committed
ios: remove legacy build system as its no longer needed:
- will be needed for ios-v8 - closes #1638
1 parent 33dadef commit 8117b0c

File tree

2 files changed

+1
-187
lines changed

2 files changed

+1
-187
lines changed

publish/scripts/installer.js

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ function promptQuestionsResult(result) {
253253
writePodFile(result);
254254
writeGoogleServiceCopyHook();
255255
writeBuildscriptHookForCrashlytics(isSelected(result.crashlytics));
256-
writeBuildscriptHookForFirestore(isSelected(result.firestore));
257256
activateIOSCrashlyticsFramework(isSelected(result.crashlytics));
258257
activateIOSMLKitCameraFramework(isSelected(result.ml_kit));
259258
}
@@ -597,98 +596,6 @@ module.exports = function($logger, $projectData, hookArgs) {
597596
}
598597
}
599598

600-
/**
601-
* Create the iOS build script for setting the workspace to the legacy build system (for now).
602-
*
603-
* @param {any} enable is Firestore enabled
604-
*/
605-
function writeBuildscriptHookForFirestore(enable) {
606-
var scriptPath = path.join(appRoot, "hooks", "after-prepare", "firebase-firestore-buildscript.js");
607-
608-
if (!enable) {
609-
if (fs.existsSync(scriptPath)) {
610-
fs.unlinkSync(scriptPath);
611-
}
612-
return
613-
}
614-
615-
console.log("Install Firestore buildscript hook.");
616-
try {
617-
var scriptContent =
618-
`const fs = require('fs-extra');
619-
const path = require('path');
620-
621-
module.exports = function($logger, $projectData, hookArgs) {
622-
const platformFromHookArgs = hookArgs && (hookArgs.platform || (hookArgs.prepareData && hookArgs.prepareData.platform));
623-
const platform = (platformFromHookArgs || '').toLowerCase();
624-
return new Promise(function(resolve, reject) {
625-
const isNativeProjectPrepared = hookArgs.prepareData ? (!hookArgs.prepareData.nativePrepare || !hookArgs.prepareData.nativePrepare.skipNativePrepare) : (!hookArgs.nativePrepare || !hookArgs.nativePrepare.skipNativePrepare);
626-
if (isNativeProjectPrepared) {
627-
try {
628-
if (platform !== 'ios') {
629-
resolve();
630-
return;
631-
}
632-
633-
const sanitizedAppName = path.basename($projectData.projectDir).split('').filter((c) => /[a-zA-Z0-9]/.test(c)).join('');
634-
635-
const xcodeWorkspacePath = path.join($projectData.platformsDir, 'ios', sanitizedAppName + '.xcworkspace');
636-
if (!fs.existsSync(xcodeWorkspacePath)) {
637-
$logger.error(xcodeWorkspacePath + ' is missing.');
638-
reject();
639-
return;
640-
}
641-
642-
const xcodeWorkspaceShareddataPath = path.join($projectData.platformsDir, 'ios', sanitizedAppName + '.xcworkspace', 'xcshareddata');
643-
$logger.trace('Using Xcode workspace settings path', xcodeWorkspaceShareddataPath);
644-
console.log('Using Xcode workspace settings path: ' + xcodeWorkspaceShareddataPath);
645-
646-
if (!fs.existsSync(xcodeWorkspaceShareddataPath)) {
647-
fs.mkdirSync(xcodeWorkspaceShareddataPath);
648-
}
649-
650-
const xcodeWorkspaceSettingsFile = path.join(xcodeWorkspaceShareddataPath, 'WorkspaceSettings.xcsettings');
651-
// for this temp fix we assume that if the file is there, it contains the correct config
652-
if (!fs.existsSync(xcodeWorkspaceSettingsFile)) {
653-
fs.writeFileSync(xcodeWorkspaceSettingsFile, \`<?xml version="1.0" encoding="UTF-8"?>
654-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
655-
<plist version="1.0">
656-
<dict>
657-
<key>BuildSystemType</key>
658-
<string>Original</string>
659-
</dict>
660-
</plist>
661-
\`);
662-
$logger.trace('Xcode workspace file written');
663-
}
664-
resolve();
665-
666-
} catch (e) {
667-
$logger.error('Unknown error during prepare Firestore', e);
668-
reject();
669-
}
670-
} else {
671-
$logger.trace("Native project not prepared.");
672-
resolve();
673-
}
674-
});
675-
};
676-
`;
677-
var afterPrepareDirPath = path.dirname(scriptPath);
678-
var hooksDirPath = path.dirname(afterPrepareDirPath);
679-
if (!fs.existsSync(afterPrepareDirPath)) {
680-
if (!fs.existsSync(hooksDirPath)) {
681-
fs.mkdirSync(hooksDirPath);
682-
}
683-
fs.mkdirSync(afterPrepareDirPath);
684-
}
685-
fs.writeFileSync(scriptPath, scriptContent);
686-
} catch (e) {
687-
console.log("Failed to install Firestore buildscript hook.");
688-
console.log(e);
689-
}
690-
}
691-
692599
/**
693600
* Create the Android Gradle for installing the Firebase Android dependencies and service dependencies
694601
*

src/scripts/postinstall.js

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)