Skip to content

Commit

Permalink
fix(cordova): Don't add as system library if it's a vendored library (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Apr 8, 2020
1 parent 6172932 commit 404574d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cli/src/ios/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,15 @@ async function generateCordovaPodspec(cordovaPlugins: Plugin[], config: Config,
}
});
});
const onlySystemLibraries = systemLibraries.filter(library => removeNoSystem(library, sourceFrameworks));
if (weakFrameworks.length > 0) {
frameworkDeps.push(`s.weak_frameworks = '${weakFrameworks.join(`', '`)}'`);
}
if (linkedFrameworks.length > 0) {
frameworkDeps.push(`s.frameworks = '${linkedFrameworks.join(`', '`)}'`);
}
if (systemLibraries.length > 0) {
frameworkDeps.push(`s.libraries = '${systemLibraries.join(`', '`)}'`);
if (onlySystemLibraries.length > 0) {
frameworkDeps.push(`s.libraries = '${onlySystemLibraries.join(`', '`)}'`);
}
if (customFrameworks.length > 0) {
frameworkDeps.push(`s.vendored_frameworks = '${customFrameworks.join(`', '`)}'`);
Expand Down Expand Up @@ -340,6 +341,11 @@ function filterARCFiles(plugin: Plugin) {
return sourcesARC.length > 0;
}

function removeNoSystem(library: string, sourceFrameworks: Array<string>) {
const libraries = sourceFrameworks.filter(framework => framework.includes(library));
return libraries.length === 0;
}

async function getPluginsTask(config: Config) {
return await runTask('Updating iOS plugins', async () => {
const allPlugins = await getPlugins(config);
Expand Down

0 comments on commit 404574d

Please sign in to comment.