1 | # cordova-plugin-cocoapod-support
|
2 | Are you tired of manually adding ios dependencies in Cordova apps? Me too. Android has Gradle support out of the box, but
|
3 | CocoaPods get no love. That is until now.
|
4 |
|
5 | With this plugin you can define your plugin or project CocoaPods dependencies right in your xml.
|
6 |
|
7 | After adding this plugin be sure to open the .xcworkspace in XCode instead of the .xcodeproj.
|
8 |
|
9 | Note: Dependencies defined in the config.xml take precedence of dependencies defined in plugin's.
|
10 |
|
11 | ## How does it work?
|
12 | It looks for <pod> entries the config.xml and plugin.xml, creates the Podfile, updates the necessary configs and
|
13 | then runs pod update for you.
|
14 |
|
15 | ## How do I install it?
|
16 |
|
17 | If you're like me and using [Cordova CLI](http://cordova.apache.org/):
|
18 | ```
|
19 | cordova plugin add cordova-plugin-cocoapod-support --save
|
20 | ```
|
21 |
|
22 | or
|
23 |
|
24 | ```
|
25 | phonegap local plugin add cordova-plugin-cocoapod-support
|
26 | ```
|
27 |
|
28 | ## How do I use it?
|
29 |
|
30 | In a plugin's plugin.xml
|
31 | ```xml
|
32 | <?xml version='1.0' encoding='UTF-8'?>
|
33 | <plugin id="cordova-plugin-withpods" version="1.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
34 | <name>A Plugin With CocoaPods Dependencies</name>
|
35 | <description>
|
36 | A plugin demonstrating the use of CocoaPods dependencies.
|
37 | </description>
|
38 |
|
39 | <dependency id="cordova-plugin-cocoapod-support"/>
|
40 |
|
41 | <platform name="ios">
|
42 | <pod id="LatestPod" />
|
43 | <pod id="VersionedPod" version="1.0.0" />
|
44 | <pod id="GitPod1" git="https://github.com/blakgeek/something" tag="v1.0.1" configuration="debug" />
|
45 | <pod id="GitPod2" git="https://github.com/blakgeek/something" branch="wood" configurations="release,debug" />
|
46 | <pod id="GitPod3" git="https://github.com/blakgeek/something" commit="1b33368" />
|
47 | </platform>
|
48 | </plugin>
|
49 | ```
|
50 |
|
51 | In a project's config.xml
|
52 | ```xml
|
53 | <?xml version='1.0' encoding='utf-8'?>
|
54 | <widget id="com.blakgeek.cordova.superdopeness" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
55 | <name>CocoapodsDemo</name>
|
56 | <description>
|
57 | An app demonstrating the use of CocoaPods dependencies.
|
58 | </description>
|
59 | <content src="index.html" />
|
60 | <access origin="*" />
|
61 | <platform name="ios">
|
62 | <!-- set platform :ios, defaults to 7.0 -->
|
63 | <preference name="pods_ios_min_version" value="8.0"/>
|
64 | <!-- add use_frameworks! to Podfile, this also disabled bridging headers -->
|
65 | <preference name="pods_use_frameworks" value="true">
|
66 | <pod id="LatestPod" />
|
67 | <pod id="VersionedPod" version="1.0.0" />
|
68 | <pod id="GitPod1" git="https://github.com/blakgeek/something" tag="v1.0.1" configuration="debug" />
|
69 | <pod id="GitPod2" git="https://github.com/blakgeek/something" branch="wood" configurations="release,debug" />
|
70 | <pod id="GitPod3" git="https://github.com/blakgeek/something" commit="1b33368" />
|
71 | </platform>
|
72 | ```
|
73 |
|
74 | or have a look at [the demo plugin](https://github.com/blakgeek/cordova-plugin-withpods).
|
75 |
|
76 | ## Notes
|
77 | * Enabling the pods_use_frameworks preference disables the bridged headers property added by
|
78 | [CB-10072](https://issues.apache.org/jira/browse/CB-10072). This might cause odd behavior in some projects.
|
79 |
|
80 |
|
81 | ##TODO:
|
82 | * Update with examples of all of the supported pod attributes (git, podspec, path, subspec, configuration(s) )
|
83 |
|
84 |
|
85 |
|
86 | [bad_resource]: ./bad_resource.png "Bad Resource"
|
87 | [linker_error]: ./linker_error.png "Linker Error"
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|