Skip to content

Commit ddadb2e

Browse files
chrfalchreact-native-bot
authored andcommitted
resolve xcframework paths from conf switch script (#52664)
Summary: When switching between debug/release we run a small script to make sure to copy the correct version of the RNDeps xcframework. This script was missing a resolve function that fixed up some path issues that we do when installing in the podspec. ## Changelog: [IOS] [FIXED] - Fixed issue with RNDeps release/debug switch failing Pull Request resolved: #52664 Test Plan: - Create new RN App - Install pod with prebuilt deps - Build (success) - Switch to release - Build (success) Reviewed By: cortinico Differential Revision: D78481590 Pulled By: cipolleschi fbshipit-source-id: 2d02b0bc55e8aef6f3fafb4f7aa193c4cf00414e
1 parent 828287d commit ddadb2e

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

packages/react-native/third-party-podspecs/replace_dependencies_version.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,25 @@ function replaceRNDepsConfiguration(
6767

6868
console.log('Extracting the tarball', tarballURLPath);
6969
execSync(`tar -xf ${tarballURLPath} -C ${finalLocation}`);
70+
71+
// Now we need to remove the extra third-party folder as we do in the podspec's prepare-script
72+
// We need to take the ReactNativeDependencies.xcframework folder and move it up one level
73+
// from ${finalLocation}/packages/react-native/third-party/ to ${finalLocation}/packages/react-native/
74+
console.log('Resolving ReactNativeDependencies.xcframework folder structure');
75+
const thirdPartyPath = `${finalLocation}/packages/react-native/third-party`;
76+
const sourcePath = `${thirdPartyPath}/ReactNativeDependencies.xcframework`;
77+
const destinationPath = `${finalLocation}/packages/react-native/ReactNativeDependencies.xcframework`;
78+
if (fs.existsSync(sourcePath)) {
79+
fs.renameSync(sourcePath, destinationPath);
80+
} else {
81+
throw new Error(
82+
`Expected ReactNativeDependencies.xcframework to be at ${sourcePath}, but it was not found.`,
83+
);
84+
}
85+
86+
if (fs.existsSync(thirdPartyPath)) {
87+
fs.rmSync(thirdPartyPath, {force: true, recursive: true});
88+
}
7089
}
7190

7291
function updateLastBuildConfiguration(configuration /*: string */) {

0 commit comments

Comments
 (0)