https://twitter.com/zonble/status/1190276523359535104?s=20


團隊開發時,除了 Xcode 以外,總是會有一些共用的工具,像是 Fastlane, CocoaPods, SwiftFormat。如果能夠把這些工具也版控起來,就可以減少團隊協同時的差異,開發者電腦跟 CI 環境的差異也能消除。

版控 Ruby

FastlaneCocoaPods 等常見工具都是用 Ruby 撰寫的,所以最好先把 Ruby 的版本給版控起來。常見的工具有兩種:

用哪一個都可以,要 commit 進 repo 根目錄的檔案一樣都是 .ruby-version ,內容就寫版號:

2.6.5

版控 Ruby 工具—Bundler

最好的方式就是用 Bundler + Gemfile

實際上要 commit 進 repo 的不只 Gemfile 還有 Gemfile.lock 。其原理跟 Podfile[Podfile.lock](<https://guides.cocoapods.org/using/using-cocoapods.html#what-is-podfilelock>) 的關係相同。

版控 Swift 工具—Mint

https://twitter.com/ethanhuang13/status/1287767383256338432?s=20

我在團隊或個人開發 iOS 專案時都會使用 Mint 來管理用到的 Swift 工具。例如: