Skip to content

Commit

Permalink
fix(cli): Add plugin to static list if pod has use-frameworks (#5232)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Nov 11, 2021
1 parent cd779c4 commit 8a0518b
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions cli/src/cordova.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,20 +519,24 @@ export function getIncompatibleCordovaPlugins(platform: string): string[] {
}

export function needsStaticPod(plugin: Plugin, config: Config): boolean {
let pluginList = [
'phonegap-plugin-push',
'@havesource/cordova-plugin-push',
'cordova-plugin-firebasex',
'@batch.com/cordova-plugin',
'onesignal-cordova-plugin',
'cordova-plugin-google-analytics',
];
let pluginList = ['phonegap-plugin-push', '@batch.com/cordova-plugin'];
if (config.app.extConfig?.cordova?.staticPlugins) {
pluginList = pluginList.concat(
config.app.extConfig?.cordova?.staticPlugins,
);
}
return pluginList.includes(plugin.id);
return pluginList.includes(plugin.id) || useFrameworks(plugin);
}

function useFrameworks(plugin: Plugin): boolean {
const podspecs = getPlatformElement(plugin, 'ios', 'podspec');
const frameworkPods = podspecs.filter(
(podspec: any) =>
podspec.pods.filter(
(pods: any) => pods.$ && pods.$['use-frameworks'] === 'true',
).length > 0,
);
return frameworkPods.length > 0;
}

export async function getCordovaPreferences(config: Config): Promise<any> {
Expand Down

0 comments on commit 8a0518b

Please sign in to comment.