XcodeGen icon indicating copy to clipboard operation
XcodeGen copied to clipboard

Support for checked-in Pods?

Open grav opened this issue 6 years ago • 3 comments

We're checking in our Pods directory into source control. This means that the pod install command is only ever run, if a developer wants to install a new dependency.

Reading through the CocoaPods part of the XcodeGen-docs, it seems that there isn't a good solution for this? I guess, if CocoaPods allowed for separating downloading deps from integrating deps, it should be possible to just integrate the pods after generating the project.

grav avatar Jun 25 '19 09:06 grav

Hi @grav

If you have podfile.lock checked in that operation should be pretty fast. As you say though it could be faster if cocoapods gave you a way to integrate only. There are a couple of possible solutions:

  • this issue tracks a post gen hook https://github.com/yonaskolb/XcodeGen/issues/479, which if you are using xcodegen caching, would then only run pod install if the project needed to be generated. You could also do this with a script that cleverly checked the output of xcodegen as well. This brings down the need to run pod install so often.
  • check the exact changes that the cocoapods integration process does to your project and just add them manually to your project spec. I haven't looked in a while but I'm guessing this is a combination of xcconfig paths, build settings, and run scripts. (This could potentially be added as a feature to XcodeGen as a integrateCocoapods option)
  • move from cocoapods to carthage. XcodeGen integrates with this much better
  • check in your project and only regenerate on merge conflicts

yonaskolb avatar Sep 27 '19 14:09 yonaskolb

A postGenCommand has been added here https://github.com/yonaskolb/XcodeGen/pull/759 This will allow for only running pod install if the project has actually changed

yonaskolb avatar Jan 23 '20 11:01 yonaskolb

@grav @yonaskolb Pod install on a CI build might try to pull your pods if you have not given exact versions so on CI build it might take longer time to do pod install depending on how large is your pod file.

bharathns avatar Jan 18 '22 19:01 bharathns