• Stars
    star
    1,304
  • Rank 36,083 (Top 0.8 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

integrate pods in form of prebuilt frameworks conveniently, reducing compile time

Build Status

A CocoaPods plugin to integrate pods in form of prebuilt frameworks, not source code, by adding just one flag in podfile. Speed up compiling dramatically.

Good news: Introduction on cocoapods offical site: Pre-compiling dependencies ( NOTE: This plugin is a community work, not official.)

Why

You may wonder why CocoaPods doesn't have a function to integrate libs in form of binaries, if there are dozens or hundreds of pods in your podfile and compile them for a great many times meaninglessly. Too many source code of libs slow down your compile and the response of IDE (e.g. code completion), and then reduce work efficiency, leaving us time to think about the meaning of life.

This plugin implements this simple wish. Replace the source code in pod target with prebuilt frameworks.

Why don't use Carthage? While Carthage also integrates libs in form of frameworks, there several reasons to use CocoaPods with this plugin:

  • Pod is a good simple form to organize files, manage dependencies. (private or local pods)
  • Fast switch between source code and binary, or partial source code, partial binaries.
  • Some libs don't support Carthage.

How it works

It will compile the source code of pods during the pod install process, and make CocoaPods use them. Which pod should be compiled is controlled by the flag in Podfile.

Under the hood

( You could leave this paragraph for further reading, and try it now. )

The plugin will do a separated completed 'Pod install' in the standard pre-install hook. But we filter the pods by the flag in Podfile here. Then build frameworks with this generated project by using xcodebuild. Store the frameworks in Pods/_Prebuild and save the manifest.lock file for the next pod install.

Then in the flowing normal install process, we hook the integration functions to modify pod specification to using our frameworks.

Installation

$ gem install cocoapods-binary

Usage

plugin 'cocoapods-binary'

use_frameworks!
# all_binary!

target "HP" do
    pod "ExpectoPatronum", :binary => true
end
  • Add plugin 'cocoapods-binary' in the head of Podfile
  • Add :binary => true as a option of one specific pod, or add all_binary! before all targets, which makes all pods binaries.
  • pod install, and that's all

Note: cocoapods-binary require use_frameworks!. If your worry about the boot time and other problems introduced by dynamic framework, static framework is a good choice. Another plugin made by me to make all pods static frameworks is recommended.

Options

If you want to disable binary for a specific pod when using all_binary!, place a :binary => false to it.

If your Pods folder is excluded from git, you may add keep_source_code_for_prebuilt_frameworks! in the head of Podfile to speed up pod install, as it won't download all the sources every time prebuilt pods have changes.

If bitcode is needed, add a enable_bitcode_for_prebuilt_frameworks! before all targets in Podfile

Known Issues

  • doesn't support watchos now
  • dSYM files is missing for dynamic frameworks using this plugin. Workaround: Don't use this plugin for a release build. Add a if condition with ENV around plugin 'cocoapods-binary'. (detail) (fix in 0.4.2)

License

MIT

Appreciate a 🌟 if you like it.

More Repositories

1

cocoapods-static-swift-framework

A cocoapods plugin enables static framework for all pods
Ruby
253
star
2

Neat

Fix the line height problems of TextKit
Objective-C
103
star
3

ComponentSwift

Bring ComponentKit to Swift, A React-inspired view framework for iOS
Objective-C++
49
star
4

fucking-beijing-bus-api

北京实时公交 API
Swift
47
star
5

cocoapods-developing-folder

a branch of tools for who heavily use development pods
Ruby
30
star
6

Mappable

flexible JSON to Model converter, specially optimized for immutable properties
Swift
27
star
7

RunMario

iOS jailbreak tweak that allow playing SuperMarioRun on jailbreak device
Logos
25
star
8

sketch-engineer-friendly-text

Sketch plugin that make text layer's metric friendly to iOS engineer
JavaScript
24
star
9

alternate-icon-demo

demo for changing icon dynamically for iOS app
Swift
15
star
10

LazyWarningChecker

move "Treat Warnings as Errors" to commit time
Python
7
star
11

Literal

convenient initializers for CGPoint and etc..
Swift
6
star
12

SmashTheAddress

崩溃日志符号化python脚本,使用atosl工具
Python
3
star
13

courses

复刻自己的一个android课程表app
Objective-C
3
star
14

JustMyPassword

Jailbreak tweak. Allow you add new card in wallet while using 4-digit password
Logos
3
star
15

Sketch-iOS-text-solution

Swift
3
star
16

MathjaxZhihu

use Mathjax to render equations in Zhihu.com
JavaScript
2
star
17

LEPhotoCollectionView

CollectionView and cell for viewing images like Photo app
Objective-C
2
star
18

go-optional

optional type for golang
Go
2
star
19

Shell

Run shell commands fastly
Swift
2
star
20

HiThere

popup an image beside the cursor
Swift
2
star
21

go-either

An Either type for golang with generics
Go
1
star
22

Ring

One ring to rule them all
Shell
1
star