diff --git a/docs/dependencies.md b/docs/dependencies.md index aed576ad7..0bf7e69d5 100644 --- a/docs/dependencies.md +++ b/docs/dependencies.md @@ -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. diff --git a/packages/cli-types/src/ios.ts b/packages/cli-types/src/ios.ts index 3cb3183ac..71fb6281d 100644 --- a/packages/cli-types/src/ios.ts +++ b/packages/cli-types/src/ios.ts @@ -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; diff --git a/packages/cli/src/tools/config/schema.ts b/packages/cli/src/tools/config/schema.ts index 185a5ba5b..f6b1fb783 100644 --- a/packages/cli/src/tools/config/schema.ts +++ b/packages/cli/src/tools/config/schema.ts @@ -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(), }) diff --git a/packages/platform-ios/src/config/index.ts b/packages/platform-ios/src/config/index.ts index 965f397be..4bc786bd9 100644 --- a/packages/platform-ios/src/config/index.ts +++ b/packages/platform-ios/src/config/index.ts @@ -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