What goes into your .gitignore if you're using CocoaPods?

前端 未结 19 1090
南旧
南旧 2020-11-29 14:47

I\'ve been doing iOS development for a couple of months now and just learned of the promising CocoaPods library for dependency management.

I tried it out on a person

19条回答
  •  没有蜡笔的小新
    2020-11-29 14:56

    Check in the Pods.

    I think this should be a tenet of software development

    • All builds must be reproducible
    • The only way to ensure builds are reproducible is to be in control of all dependencies; checking in all dependencies is therefore a must.
    • A new developer starting from scratch shall be able to check out your project and start working.

    Why?

    CocoaPods or any other external libraries might change which might break things. Or they might move, or be renamed, or be removed altogether. You can't rely on the internet to store things for you. Your laptop might have died and there is a critical bug in production that needs to be fixed. The main developer might get hit by a bus and his replacement has to start up in a hurry. And I wish that last one was a theoretical example but it actually happened at a startup I was with. RIP.

    Now, realistically, you can't really check in ALL dependencies. You can't check in an image of the machine you used to create builds; you can't check in the exact version of the compiler. And so on. There are realistic limits. But check in all you can - not doing so just makes your life harder. And we don't want that.

    Final word: Pods are not build artifacts. Build artifacts are what gets generated from your builds. Your build uses Pods, not generate them. I'm not even sure why this has to be debated.

提交回复
热议问题