From 7ceceb2cf17098677aa29969c697c2995833e7af Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 5 Aug 2021 00:03:38 +0200 Subject: [PATCH 1/3] initial commit --- packages/cli-types/src/ios.ts | 1 + packages/cli/src/tools/config/schema.ts | 1 + packages/platform-ios/src/commands/runIOS/index.ts | 2 +- packages/platform-ios/src/config/index.ts | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) 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/commands/runIOS/index.ts b/packages/platform-ios/src/commands/runIOS/index.ts index aaaaba870..04c0b467f 100644 --- a/packages/platform-ios/src/commands/runIOS/index.ts +++ b/packages/platform-ios/src/commands/runIOS/index.ts @@ -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]', 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 From a9a1014f26ecce5d3db7a2ed05e1265065c4f6e0 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 5 Aug 2021 00:07:44 +0200 Subject: [PATCH 2/3] chore: docs --- docs/dependencies.md | 4 ++++ 1 file changed, 4 insertions(+) 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. From 0a639f198c48d7feb1a597273c684a166b1c4155 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 5 Aug 2021 00:20:55 +0200 Subject: [PATCH 3/3] chore: revert changes --- packages/platform-ios/src/commands/runIOS/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/platform-ios/src/commands/runIOS/index.ts b/packages/platform-ios/src/commands/runIOS/index.ts index 04c0b467f..aaaaba870 100644 --- a/packages/platform-ios/src/commands/runIOS/index.ts +++ b/packages/platform-ios/src/commands/runIOS/index.ts @@ -618,7 +618,7 @@ export default { description: 'Path relative to project root where the Xcode project ' + '(.xcodeproj) lives.', - default: (ctx: Config) => ctx.project.ios ? ctx.project.ios.sourceDir : 'ios', + default: 'ios', }, { name: '--device [string]',