googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.25k stars 343 forks source link

Use CocoaPods CDN to speed up pod install #328

Open tomtwo opened 4 years ago

tomtwo commented 4 years ago

Please fill in the following fields:

Unity editor version: 2019.3.0f6 Play Services Resolver version: 1.2.135.0 Features in Play Services Resolver in use (Android Resolver, iOS Resolver, VersionHandler, etc.): iOS Resolver Plugins SDK in use (Firebase, Admob, Facebook, etc.): Firebase Platform you are using the Unity editor on (Mac, Windows, or Linux): Mac Platform you are targeting (iOS, Android, and/or desktop): iOS Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Please describe the issue here:

On some CI services (in my case TravisCI) sometimes the pod install step can slow to a crawl. This is due to GitHub throttling traffic to the CocoaPods/Specs.git source repo.

CocoaPods have since released support to use a CDN (in CocoaPods 1.7.2+). To opt-in, the source at the top of the Podfile should be changed over to https://cdn.cocoapods.org/.

The straightforward change to unity-jar-resolver would be to update this hardcoded string in IOSResolver to point to the CDN:

https://github.com/googlesamples/unity-jar-resolver/blob/master/source/IOSResolver/src/IOSResolver.cs#L80

However this is a breaking change since it drops support for CocoaPods < 1.7.2. Perhaps the better solution would be to allow configuring this URL in our build scripts before running the build.

Any thoughts?

google-oss-bot commented 4 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

stewartmiles commented 4 years ago

@tomtwo this sounds like a neat idea, perhaps the default source URL could be configured based upon the detected version of Cocoapods that is installed?

At the moment the version is only checked before pod install (see https://github.com/googlesamples/unity-jar-resolver/blob/8b7fb85d5f0d117fd6015dd06ca64b9fff71c896/source/IOSResolver/src/IOSResolver.cs#L2288 ) but could always happen before the Podfile is generated.

polmum commented 4 years ago

Hey! Any news on this issue? Using the CDN would speed up built times, and Cocoapods might eventually deprecate the old repo

capyvara commented 3 years ago

Bump

StephenHodgson commented 7 months ago

pretty sure this can be closed since it is using cdn now