Skip to content

Commit 1a2356b

Browse files
committed
update readme
1 parent 6ff3c37 commit 1a2356b

File tree

1 file changed

+48
-4
lines changed

1 file changed

+48
-4
lines changed

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,66 @@
22

33
[![Build Status](https://travis-ci.org/leavez/cocoapods-binary.svg?branch=master)](https://travis-ci.org/leavez/cocoapods-binary)
44

5-
A cocoapods plugin that enables to integrate pod in form of prebuilt framework, not source code, with **just one flag** in podfile. This can dramatically speed up your compile time.
5+
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.
66

7-
(This project is still in early stage.)
7+
## Why
8+
9+
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 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, giving us time to think about the meaning of life.
10+
11+
This plugin implements this simple wish. Replace the source code in pod target with prebuilt frameworks.
12+
13+
Why don't use Carthage? While Carthage also integrates libs in form of frameworks, there several reasons to use CocoaPods with this plugin:
14+
15+
- Pod is a good simple form to organize files, manage dependencies. (private or local pods)
16+
- Fast switch between source code and binary, or partial source code, partial binaries.
17+
- Some libs don't support Carthage.
18+
19+
## How it works
20+
21+
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.
22+
23+
#### Under the hood
24+
25+
( You could leave this paragraph for further reading, and try it now. )
26+
27+
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.
28+
29+
Then in the flowing normal install process, we hook the integration functions to modify pod specification to using our frameworks.
830

931
## Installation
1032

1133
$ gem install cocoapods-binary
1234

1335
## Usage
1436

15-
Add this in the podfile:
16-
1737
``` ruby
1838
plugin 'cocoapods-binary'
1939

40+
use_frameworks!
41+
# all_binary!
42+
2043
target "HP" do
2144
pod "ExpectoPatronum", :binary => true
2245
end
2346
```
47+
48+
- Add `plugin 'cocoapods-binary'` in the head of Podfile
49+
- 2 ways:
50+
- Add `:binary => true` as a option of one specific pod.
51+
- Or add `all_binary!` before all targets. This makes all pods binaries.
52+
53+
if you want to disable binary for a specific pod when using `all_binary!`, place a `:binary => false` to it.
54+
55+
**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](https://github.com/leavez/cocoapods-static-swift-framework) made by me to make all pods static frameworks is recommended.
56+
57+
#### Known Issue
58+
59+
- doesn't support watchos now
60+
61+
## License
62+
63+
MIT
64+
65+
Appreciate a 🌟 if you like it.
66+
67+

0 commit comments

Comments
 (0)