Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to switch between source code and binary when using pre-compiling in Cocoapods

I have a huge Xcode project, using CocoaPods with more than 150 dependencies. The indexing time and building time without Xcode building cache is a nightmare, Xcode is less responsive. All of these causes prevents us from effective development. So we are going to use Pre-compiling in our project.

What this CocoaPods plugin mainly does are:

  1. download source code to Pods/_prebuild/xxx folder
  2. Build static frameworks in a temperate folder Pods/build folder
  3. Generate static frameworks and finally store them in Pods/_prebuild/generatedFrameworks folder
  4. After building completed, delete the source code in the Pods/_prebuild/xxx, and generate the xxx folder in the Podsfolder, which contains a symbolic link to the static framework in Pods/_prebuild/generatedFrameworks folder. Besides, you can preserve the source code in the Pods/_prebuild/ folder, if you use keep_source_code_for_prebuilt_frameworks in the Podfile.

But, once the dependencies are converted into binary files. It is very difficult for developers to debug when development.

  1. A naive solution is to use pod "ExpectoPatronum", :binary => true | false and do pod install again. cocoapods-binary provides this optional to determine if this pod should be source code or should be converted into binary.

  2. It seems this plugin is from a Chinese unicorn, Mei Tuan. And, instead of using the solution 1 to switch between source code and binary, they use a more tricky way to convert the binary into source code.

Currently, I am trying to find more solutions to switch between source code and binary when using pre-compiling in CocoaPods . Would you like to shed some light on it? Thank you.

like image 642
RY_ Zheng Avatar asked Feb 05 '26 19:02

RY_ Zheng


1 Answers

I've had similar problems and developed my own utility 🏈 Rugby.
In the current version, Rugby can cache all remote pods dependencies and remove their targets from the Pods project.

Also, Rugby doesn't change Podfile. You can use pod install && rugby for working with cache or just pod install for working with sources.

like image 105
SwiftyFinch Avatar answered Feb 15 '26 13:02

SwiftyFinch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!