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

Add check for newer versions of cocoapods to avoid locking adding platforms on non synced pods repo #719

Merged
merged 3 commits into from
Nov 22, 2019

Conversation

renanccastro
Copy link
Contributor

Starting on 1.8.0, cocoapods now use CDN to avoid having to sync the master repo, so we don't need to check anymore if the repo is populated.

Even more, the "pod setup" command now doesn't do anything, and newer versions of cocoapods are actually incompatible with cordova-ios, as the repository filled check will kick in and make it impossible to use it.

Error example with meteor and cocoapods 1.8.4:

✗ CocoaPods: The CocoaPods repo has not been synced yet, this will take a long
time (approximately 500MB as of Sept 2016). Please run pod setup first to
sync the repo.

This also solves issue #700

Platforms affected

Motivation and Context

Description

Testing

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@codecov-io
Copy link

codecov-io commented Nov 17, 2019

Codecov Report

Merging #719 into master will increase coverage by 0.08%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #719      +/-   ##
==========================================
+ Coverage   74.24%   74.32%   +0.08%     
==========================================
  Files          11       11              
  Lines        1844     1850       +6     
==========================================
+ Hits         1369     1375       +6     
  Misses        475      475
Impacted Files Coverage Δ
bin/templates/scripts/cordova/lib/check_reqs.js 55% <87.5%> (+3.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8a041e...fa76d77. Read the comment docs.

const patch = parseInt(semver[2]);

// starting with 1.8.0 cocoapods now use cdn and we dont need to sync first
if ((major >= 1 && minor >= 8 && patch >= 0) || toolOptions.ignore) {

Choose a reason for hiding this comment

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

Hi,

maybe it's better this way:

if (((major > 1) || (major == 1 && minor >= 8 && patch >= 0)) || toolOptions.ignore) {

do not you think?

Copy link

Choose a reason for hiding this comment

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

It's maybe also sufficient to only check for major and minor version.

@erisu
Copy link
Member

erisu commented Nov 20, 2019

All that is missing now is resolving the AppVeyor test.

Since AppVeyor runs on Windows and there is no pod installation, you might want to skip the checking and return something to present that requirement was not met.

@renanccastro
Copy link
Contributor Author

All that is missing now is resolving the AppVeyor test.

Since AppVeyor runs on Windows and there is no pod installation, you might want to skip the checking and return something to present that requirement was not met.

Done!

@raphinesse
Copy link
Contributor

raphinesse commented Nov 20, 2019

@renanccastro When giving the code a thorough review, I noticed that we already get the cocoapods version passed in as part of the result from the check_cocoapod_tool call. I updated your code to use that and also used versions.compareVersions which internally uses semver but also gracefully handles non-semver versions.

It would be great to have a unit test that checks the behavior for pod versions starting with 1.8.0. Other than that, this is good to go for me now. Hopefully we can include this in the upcoming release. In any case: thanks for your contribution and patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants