|
1 | | -# PromiseKit v7 |
2 | | - |
3 | | -We only support SwiftPM since supporting all package managers is untennable and |
4 | | -SwiftPM is the easiest. |
| 1 | +We support SwiftPM: |
5 | 2 |
|
6 | 3 | ```swift |
7 | 4 | package.dependencies.append( |
8 | 5 | .package(url: "https://github.com/mxcl/PromiseKit", from: "7.0.0-alpha.1") |
9 | 6 | ) |
10 | | -``` |
11 | | - |
12 | | -# PromiseKit v6 |
13 | | - |
14 | | -## Xcode 8.3, 9.x or 10.x / Swift 3 or 4 |
15 | | - |
16 | | -We recommend Carthage over CocoaPods, but both installation methods are supported. |
17 | | - |
18 | | -### CocoaPods |
19 | | - |
20 | | -```ruby |
21 | | -use_frameworks! |
22 | | - |
23 | | -target "Change Me!" do |
24 | | - pod "PromiseKit", "~> 6.8" |
25 | | -end |
26 | | -``` |
27 | | - |
28 | | -If the generated Xcode project gives you a warning that PromiseKit needs to be upgraded to |
29 | | -Swift 4.0 or Swift 4.2, then add the following: |
30 | | - |
31 | | -```ruby |
32 | | -post_install do |installer| |
33 | | - installer.pods_project.targets.each do |target| |
34 | | - if target.name == 'PromiseKit' |
35 | | - target.build_configurations.each do |config| |
36 | | - config.build_settings['SWIFT_VERSION'] = '4.2' |
37 | | - end |
38 | | - end |
39 | | - end |
40 | | -end |
41 | | -``` |
42 | | - |
43 | | -Adjust the value for `SWIFT_VERSION` as needed. |
44 | | - |
45 | | -CocoaPods are aware of this [issue](https://github.com/CocoaPods/CocoaPods/issues/7134). |
46 | | - |
47 | | -### Carthage |
48 | | - |
49 | | -```ruby |
50 | | -github "mxcl/PromiseKit" ~> 6.8 |
51 | | -``` |
52 | | - |
53 | | -> Please note, since PromiseKit 6.8.1 our Carthage support has transitioned to |
54 | | -> Swift 4 and above only. Strictly we *do* still support Swift 3.1 for Carthage, |
55 | | -> and if you like you could edit the PromiseKit `project.pbxproj` file during |
56 | | -> `carthage bootstrap` to make this possible. This change was involuntary and due |
57 | | -> to Xcode 10.2 dropping support for Swift 3. |
58 | 7 |
|
59 | | -From Xcode 12, you will likely need to build using `--use-xcframeworks`, eg: |
60 | | - |
61 | | - carthage build --use-xcframeworks |
62 | | - |
63 | | -### Accio |
64 | | - |
65 | | -Add the following to your `Package.swift`: |
66 | | - |
67 | | -```swift |
68 | | -.package(url: "https://github.com/mxcl/PromiseKit.git", .upToNextMajor(from: "6.8.4")), |
69 | | -``` |
70 | | - |
71 | | -Next, add `PromiseKit` to your App targets dependencies like so: |
72 | | - |
73 | | -```swift |
74 | | -.target( |
75 | | - name: "App", |
76 | | - dependencies: [ |
77 | | - "PromiseKit", |
78 | | - ] |
79 | | -), |
80 | | -``` |
81 | | - |
82 | | -Then run `accio update`. |
83 | | - |
84 | | -### SwiftPM |
85 | | - |
86 | | -```swift |
87 | | -package.dependencies.append( |
88 | | - .package(url: "https://github.com/mxcl/PromiseKit", from: "6.8.0") |
| 8 | +package.targets.append( |
| 9 | + .target(name: "MyTarget", dependencies: ["PromiseKit", "PMKFoundation"]) |
89 | 10 | ) |
90 | 11 | ``` |
91 | 12 |
|
92 | | -### Manually |
93 | | - |
94 | | -You can just drop `PromiseKit.xcodeproj` into your project and then add |
95 | | -`PromiseKit.framework` to your app’s embedded frameworks. |
96 | | - |
97 | | - |
98 | | -# PromiseKit vs. Xcode |
99 | | - |
100 | | -PromiseKit contains Swift, so there have been rev-lock issues with Xcode: |
101 | | - |
102 | | -| PromiseKit | Swift | Xcode | CI Status | Release Notes | |
103 | | -| ---------- | ----------------------- | -------------- | ------------ | ----------------- | |
104 | | -| 7 | >=5.3 | 12.x | ![ci-master] | | |
105 | | -| 6 | 3.2, 3.3, 4.x, 5.x | 8.3, 9.x, 10.x | ![ci-master] | [2018/02][news-6] | |
106 | | -| 5 | *Deprecated* | *n/a* | *n/a* | *n/a* | |
107 | | -| 4 | 3.0, 3.1, 3.2, 3.3, 4.x | 8.x, 9.x, 10.1 | ![ci-master] | [2016/09][news-4] | |
108 | | -| 3 | 2.x | 7.x, 8.0 | ![ci-swift2] | [2015/10][news-3] | |
109 | | -| 2 | 1.x | 7.x | *Deprecated* | [2015/10][news-3] | |
110 | | -| 1† | *N/A* | * | ![ci-legacy] | – | |
111 | | - |
112 | | -† PromiseKit 1 is pure Objective-C and thus can be used with any Xcode, it is |
113 | | -also your only choice if you need to support iOS 7 or below. |
114 | | - |
115 | | ---- |
116 | | - |
117 | | -We also maintain a series of branches to aid migration for PromiseKit 2: |
118 | | - |
119 | | -| Xcode | Swift | PromiseKit | Branch | CI Status | |
120 | | -| ----- | ----- | -----------| --------------------------- | --------- | |
121 | | -| 8.0 | 2.3 | 2 | [swift-2.3-minimal-changes] | ![ci-23] | |
122 | | -| 7.3 | 2.2 | 2 | [swift-2.2-minimal-changes] | ![ci-22] | |
123 | | -| 7.2 | 2.2 | 2 | [swift-2.2-minimal-changes] | ![ci-22] | |
124 | | -| 7.1 | 2.1 | 2 | [swift-2.0-minimal-changes] | ![ci-20] | |
125 | | -| 7.0 | 2.0 | 2 | [swift-2.0-minimal-changes] | ![ci-20] | |
126 | | - |
127 | | -We do **not** usually backport fixes to these branches, but pull requests are welcome. |
128 | | - |
129 | | - |
130 | | -## Xcode 8 / Swift 2.3 or Xcode 7 |
| 13 | +Or CocoaPods: |
131 | 14 |
|
132 | 15 | ```ruby |
133 | | -# CocoaPods |
134 | | -swift_version = "2.3" |
135 | | -pod "PromiseKit", "~> 3.5" |
136 | | - |
137 | | -# Carthage |
138 | | -github "mxcl/PromiseKit" ~> 3.5 |
| 16 | +pod "PromiseKit", "~> 6.8" |
| 17 | +pod "PromiseKit/Foundation", "~> 6.8" |
139 | 18 | ``` |
140 | 19 |
|
| 20 | +## Carthage |
141 | 21 |
|
142 | | -[travis]: https://travis-ci.org/mxcl/PromiseKit |
143 | | -[ci-master]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=master |
144 | | -[ci-legacy]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=legacy-1.x |
145 | | -[ci-swift2]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.x |
146 | | -[ci-23]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.3-minimal-changes |
147 | | -[ci-22]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.2-minimal-changes |
148 | | -[ci-20]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.0-minimal-changes |
149 | | -[news-2]: http://mxcl.dev/PromiseKit/news/2015/05/PromiseKit-2.0-Released/ |
150 | | -[news-3]: https://github.com/mxcl/PromiseKit/blob/212f31f41864d1e3ec54f5dd529bd8e1e5697024/CHANGELOG.markdown#300-oct-1st-2015 |
151 | | -[news-4]: http://mxcl.dev/PromiseKit/news/2016/09/PromiseKit-4.0-Released/ |
152 | | -[news-6]: http://mxcl.dev/PromiseKit/news/2018/02/PromiseKit-6.0-Released/ |
153 | | -[swift-2.3-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.3-minimal-changes |
154 | | -[swift-2.2-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.2-minimal-changes |
155 | | -[swift-2.0-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.0-minimal-changes |
156 | | - |
157 | | - |
158 | | -# Using Git Submodules for PromiseKit’s Extensions |
159 | | - |
160 | | -> *Note*: This is a more advanced technique. |
161 | | -
|
162 | | -If you use CocoaPods and a few PromiseKit extensions, then importing PromiseKit |
163 | | -causes that module to import all the extension frameworks. Thus, if you have an |
164 | | -app and a few app extensions (e.g., iOS app, iOS watch extension, iOS Today |
165 | | -extension) then all your final products that use PromiseKit will have forced |
166 | | -dependencies on all the Apple frameworks that PromiseKit provides extensions |
167 | | -for. |
168 | | - |
169 | | -This isn’t that bad, but every framework that loads entails overhead and |
170 | | -lengthens startup time. |
171 | | - |
172 | | -It’s both better and worse with Carthage. We build individual micro-frameworks |
173 | | -for each PromiseKit extension, so your final products link |
174 | | -against only the Apple frameworks that they actually need. However, Apple has |
175 | | -advised that apps link only against “about 12” frameworks for performance |
176 | | -reasons. So with Carthage, we are worse off on this metric. |
177 | | - |
178 | | -The solution is to instead import only CorePromise: |
179 | | - |
180 | | -```ruby |
181 | | -# CocoaPods |
182 | | -pod "PromiseKit/CorePromise" |
183 | | - |
184 | | -# Carthage |
185 | | -github "mxcl/PromiseKit" |
186 | | -# ^^ for Carthage *only* have this |
187 | | -``` |
188 | | - |
189 | | -And to use the extensions you need via `git submodules`: |
190 | | - |
191 | | -``` |
192 | | -git submodule init |
193 | | -git submodule add https://github.com/PromiseKit/UIKit Submodules/PMKUIKit |
194 | | -``` |
195 | | - |
196 | | -Then in Xcode you can add these sources to your targets on a per-target basis. |
197 | | - |
198 | | -Then when you `pod update`, ensure that you also update your submodules: |
199 | | - |
200 | | - pod update && git submodule update --recursive --remote |
201 | | - |
202 | | - |
203 | | - |
204 | | -# Release History |
205 | | - |
206 | | -## [6.0](https://github.com/mxcl/PromiseKit/releases/tag/6.0.0) Feb 13th, 2018 |
207 | | - |
208 | | -* [PromiseKit 6 announcement post][news-6]. |
209 | | - |
210 | | -## [4.0](https://github.com/mxcl/PromiseKit/releases/tag/4.0.0) |
211 | | - |
212 | | -* [PromiseKit 4 announcement post][news-4]. |
213 | | - |
214 | | -## [3.0](https://github.com/mxcl/PromiseKit/releases/tag/3.0.0) Oct 1st, 2015 |
215 | | - |
216 | | -In Swift 2.0 `catch` and `defer` became reserved keywords mandating we rename |
217 | | -our functions with these names. This forced a major semantic version change on |
218 | | -PromiseKit and thus we took the opportunity to make other minor (source |
219 | | -compatibility breaking) improvements. |
220 | | - |
221 | | -Thus if you cannot afford to adapt to PromiseKit 3 but still want to use |
222 | | -Xcode-7.0/Swift-2.0 we provide a [minimal changes branch] where `catch` and |
223 | | -`defer` are renamed `catch_` and `defer_` and all other changes are the bare |
224 | | -minimum to make PromiseKit 2 compile against Swift 2. |
225 | | - |
226 | | -If you still are using Xcode 6 and Swift 1.2 then use PromiseKit 2. |
227 | | - |
228 | | -[minimal changes branch]: https://github.com/mxcl/PromiseKit/tree/swift-2.0-minimal-changes |
229 | | - |
230 | | -## [2.0](https://github.com/mxcl/PromiseKit/releases/tag/2.0.0) May 14th, 2015 |
231 | | - |
232 | | -[PromiseKit 2 announcement post](http://mxcl.dev/PromiseKit/news/2015/05/PromiseKit-2.0-Released/). |
233 | | - |
234 | | -## [1.5](https://github.com/mxcl/PromiseKit/releases/tag/1.5.0) |
235 | | - |
236 | | -Swift 1.2 support. Xcode 6.3 required. |
| 22 | +We will support Carthage if you can PR an automated solution for generating the `.xcodeproj` on release. |
| 23 | +It will need to support all our extensions. |
0 commit comments