-
Notifications
You must be signed in to change notification settings - Fork 928
fix: install pods on ios-commands with New Arch #2122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {readFile} from 'fs-extra'; | ||
import path from 'path'; | ||
|
||
export default async function getArchitecture(iosSourceDir: string) { | ||
try { | ||
const project = await readFile( | ||
path.join(iosSourceDir, '/Pods/Pods.xcodeproj/project.pbxproj'), | ||
); | ||
|
||
return project.includes('-DRCT_NEW_ARCH_ENABLED=1'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cipolleschi is this fine if we use that to detect new arch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this should be enough. |
||
} catch { | ||
return false; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { | |
|
||
interface ResolvePodsOptions { | ||
forceInstall?: boolean; | ||
newArchEnabled?: boolean; | ||
} | ||
|
||
interface NativeDependencies { | ||
|
@@ -65,8 +66,9 @@ async function install( | |
) { | ||
const loader = getLoader('Installing CocoaPods...'); | ||
try { | ||
await installPods(loader, iosFolderPath, { | ||
await installPods(loader, { | ||
skipBundleInstall: !!cachedDependenciesHash, | ||
iosFolderPath, | ||
}); | ||
cacheManager.set(packageJson.name, 'dependencies', currentDependenciesHash); | ||
loader.succeed(); | ||
|
@@ -114,11 +116,26 @@ export default async function resolvePods( | |
!compareMd5Hashes(currentDependenciesHash, cachedDependenciesHash) || | ||
!arePodsInstalled | ||
) { | ||
await install( | ||
packageJson, | ||
cachedDependenciesHash, | ||
currentDependenciesHash, | ||
iosFolderPath, | ||
); | ||
const loader = getLoader('Installing CocoaPods...'); | ||
try { | ||
await installPods(loader, { | ||
skipBundleInstall: !!cachedDependenciesHash, | ||
newArchEnabled: options?.newArchEnabled, | ||
iosFolderPath, | ||
}); | ||
cacheManager.set( | ||
packageJson.name, | ||
'dependencies', | ||
currentDependenciesHash, | ||
); | ||
loader.succeed(); | ||
} catch { | ||
loader.fail(); | ||
throw new CLIError( | ||
`Something when wrong while installing CocoaPods. Please run ${chalk.bold( | ||
'pod install', | ||
)} manually`, | ||
); | ||
Comment on lines
+134
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I'm wondering should we add here info about flags that we added 🤔 |
||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the same logic in
doctor
command:cli/packages/cli-doctor/src/commands/info.ts
Lines 55 to 64 in 36d00ea
mind using this function also there - so we won't have in two places same code? 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's already here:
cli/packages/cli-doctor/src/commands/info.ts
Line 56 in ef7a66a