feat(react-native): run pod commands with bundler (#19727)
Signed-off-by: Stefano Formicola <stefano.formicola@cloudacademy.com> Co-authored-by: Stefano Formicola <stefano.formicola@cloudacademy.com>
This commit is contained in:
parent
2c850cfd27
commit
1f903ed924
@ -25,6 +25,11 @@
|
|||||||
"description": "Disallow any changes to the Podfile or the Podfile.lock during installation.",
|
"description": "Disallow any changes to the Podfile or the Podfile.lock during installation.",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
"useBundler": {
|
||||||
|
"description": "Run cocoapods within a Bundler environment, i.e. with the `bundle exec pod install` command",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["buildFolder"],
|
"required": ["buildFolder"],
|
||||||
|
|||||||
@ -2,4 +2,5 @@ export interface ReactNativePodInstallOptions {
|
|||||||
buildFolder: string; // default is './build'
|
buildFolder: string; // default is './build'
|
||||||
repoUpdate: boolean; // default is false
|
repoUpdate: boolean; // default is false
|
||||||
deployment: boolean; // default is false
|
deployment: boolean; // default is false
|
||||||
|
useBundler: boolean; // default is false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,11 @@
|
|||||||
"description": "Disallow any changes to the Podfile or the Podfile.lock during installation.",
|
"description": "Disallow any changes to the Podfile or the Podfile.lock during installation.",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
|
},
|
||||||
|
"useBundler": {
|
||||||
|
"description": "Run cocoapods within a Bundler environment, i.e. with the `bundle exec pod install` command",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["buildFolder"]
|
"required": ["buildFolder"]
|
||||||
|
|||||||
@ -28,10 +28,12 @@ export function runPodInstall(
|
|||||||
buildFolder?: string;
|
buildFolder?: string;
|
||||||
repoUpdate?: boolean;
|
repoUpdate?: boolean;
|
||||||
deployment?: boolean;
|
deployment?: boolean;
|
||||||
|
useBundler?: boolean;
|
||||||
} = {
|
} = {
|
||||||
buildFolder: './build',
|
buildFolder: './build',
|
||||||
repoUpdate: false,
|
repoUpdate: false,
|
||||||
deployment: false,
|
deployment: false,
|
||||||
|
useBundler: false,
|
||||||
}
|
}
|
||||||
): GeneratorCallback {
|
): GeneratorCallback {
|
||||||
return () => {
|
return () => {
|
||||||
@ -57,10 +59,12 @@ export function podInstall(
|
|||||||
buildFolder?: string;
|
buildFolder?: string;
|
||||||
repoUpdate?: boolean;
|
repoUpdate?: boolean;
|
||||||
deployment?: boolean;
|
deployment?: boolean;
|
||||||
|
useBundler?: boolean;
|
||||||
} = {
|
} = {
|
||||||
buildFolder: './build',
|
buildFolder: './build',
|
||||||
repoUpdate: false,
|
repoUpdate: false,
|
||||||
deployment: false,
|
deployment: false,
|
||||||
|
useBundler: false,
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
@ -70,15 +74,15 @@ export function podInstall(
|
|||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
execSync(
|
const podCommand = [
|
||||||
`pod install ${options.repoUpdate ? '--repo-update' : ''} ${
|
options.useBundler ? 'bundle exec pod install' : 'pod install',
|
||||||
options.deployment ? '--deployment' : ''
|
options.repoUpdate ? '--repo-update' : '',
|
||||||
}`,
|
options.deployment ? '--deployment' : '',
|
||||||
{
|
].join(' ');
|
||||||
cwd: iosDirectory,
|
execSync(podCommand, {
|
||||||
stdio: 'inherit',
|
cwd: iosDirectory,
|
||||||
}
|
stdio: 'inherit',
|
||||||
);
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error(podInstallErrorMessage);
|
logger.error(podInstallErrorMessage);
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user