Skip to content

feat(cli-patform-ios): allow setting a path to a Podfile #1459

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ Custom path to `.xcodeproj`.

Custom path to `.podspec` file to use when auto-linking. Example: `node_modules/react-native-module/ios/module.podspec`.

#### platforms.ios.podfile

Custom path to `Podfile` file to use when auto-linking. Example: `ios/Podfile`.

#### platforms.ios.sharedLibraries

An array of shared iOS libraries to link with the dependency. E.g. `libc++`. This is mostly a requirement of the native code that a dependency ships with.
Expand Down
1 change: 1 addition & 0 deletions packages/cli-types/src/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface IOSProjectParams {
* @todo Log a warning when this is used.
*/
podspecPath?: string;
podfile?: string;
sharedLibraries?: string[];
libraryFolder?: string;
plist: Array<any>;
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/tools/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export const projectConfig = t
ios: t
.object({
project: t.string(),
podfile: t.string(),
sharedLibraries: t.array().items(t.string()),
libraryFolder: t.string(),
})
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-ios/src/commands/runIOS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export default {
description:
'Path relative to project root where the Xcode project ' +
'(.xcodeproj) lives.',
default: 'ios',
default: (ctx: Config) => ctx.project.ios ? ctx.project.ios.sourceDir : 'ios',
},
{
name: '--device [string]',
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-ios/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function projectConfig(folder: string, userConfig: IOSProjectParams) {
sourceDir,
folder,
pbxprojPath: path.join(projectPath, 'project.pbxproj'),
podfile: findPodfilePath(projectPath),
podfile: userConfig.podfile || findPodfilePath(sourceDir),
podspecPath:
userConfig.podspecPath ||
// podspecs are usually placed in the root dir of the library or in the
Expand Down