Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cordova): Don't add as system library if it's a vendored library #2729

Merged
merged 2 commits into from
Apr 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should start preferring this syntax for TS arrays. Thoughts?

Suggested change
function removeNoSystem(library: string, sourceFrameworks: Array<string>) {
function removeNoSystem(library: string, sourceFrameworks: string[]) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no preference on one syntax over the other, but yeah, we should decide one or the other and always use the same.
Won't change it for now, but we can do a refactor later that replaces all of them.

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