-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathsetting-up-plugins.html.slim
85 lines (60 loc) · 2.98 KB
/
setting-up-plugins.html.slim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
title: How to use CocoaPods plugins
description: Understand how a CocoaPods plugin works and how to use them in your projects
order: 0
---
markdown:
## CocoaPods + Plugins
CocoaPods is a community project run by very few maintainers with a massive surface area to maintain. It's safe to say
that CocoaPods could never support every feature that Xcode supports, and even then the team has to say "no" to a lot of
potentially useful features.
Rather than let that be the end of the discussion, back in [2013 CocoaPods added support](https://blog.cocoapods.org/CocoaPods-0.28/) for CocoaPods Plugins.
The plugin architecture allowed others to extend CocoaPods to support features that don't fit the main goal of dependency
management and eco-system growth.
### What can CocoaPods Plugins do?
A CocoaPods Plugin can:
- Hook into the install process, both before and after
- Add new commands to `pod`
- Do whatever they want, because Ruby is a very dynamic language
This means the scope of a plugin is generally related to adding features to your build process, but can really do anything
you want. For example [`cocoapods-roulette`](https://github.com/sirlantis/cocoapods-roulette) generates a new iOS app
with three random Pods. We keep a relatively curated list of all plugins, you can see them at the end of this article.
### How do I install a plugin
You will want to use a `Gemfile`, if you've never used a Gemfile before or want a refresher - check out our guide
["Using a Gemfile"](/using/a-gemfile.html). All CocoaPods Plugins are Gems, and they are installed by first adding
them to the `Gemfile`, then you need to mention that they exist inside your Podfile.
For example, to use [cocoapods-repo-update](https://github.com/wordpress-mobile/cocoapods-repo-update) - you need to
amend your `Gemfile`:
<pre><code> source 'https://rubygems.org'
gem 'cocoapods'
+ gem 'cocoapods-repo-update'
gem 'fastlane'
</code></pre>
Then add a reference to it in your `Podfile`:
<pre><code> platform :ios, '9.0'
+ plugin 'cocoapods-repo-update'
use_frameworks!
# OWS Pods
pod 'SignalCoreKit', git: 'https://github.com/signalapp/SignalCoreKit.git', testspecs: ["Tests"]
</code></pre>
Running `bundle exec pod install` will then have the `cocoapods-repo-update` plugin executed also.
### What Plugins Exist?
There's quite a few! If you have some more to add, send us a PR to [this JSON file](https://github.com/CocoaPods/cocoapods-plugins/blob/master/plugins.json)
- json = JSON.parse(File.read "docs_data/plugins.json")
- plugins = json["plugins"].sort_by { |p| p["name"] }
</div></div>
css:
.quarter-or-xs-half {
width: 25%;
}
@media (max-width: 767px){
.quarter-or-xs-half {
width: 50%;
}
}
div style="padding: 20px; flex-wrap: wrap; display: flex;"
- plugins.each do |plugin|
div.quarter-or-xs-half style='padding: 20px;'
h4
a href=plugin["url"] = plugin["name"]
p = plugin["description"]