Skip to content

Commit c281739

Browse files
authored
Merge pull request #1221 from mxcl/extensions-in-repo
wip
2 parents e9ba885 + 0bfccc1 commit c281739

File tree

102 files changed

+3319
-768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3319
-768
lines changed

.github/workflows/cd.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ jobs:
1818
env: pods
1919

2020
- uses: actions/checkout@v2
21-
with:
22-
submodules: true
2321

2422
- run: pod trunk push --allow-warnings --skip-tests --skip-import-validation
2523
env:
2624
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
25+
PMKVersion: ${{ github.event.inputs.version }}
2726

2827
- name: Seal Deployment
2928
uses: bobheadxi/[email protected]
@@ -46,6 +45,10 @@ jobs:
4645
token: ${{ secrets.GITHUB_TOKEN }}
4746
env: docs
4847

48+
- run: echo "v=${v:0:1}" >> $GITHUB_ENV
49+
env:
50+
v: ${{ github.event.inputs.version }}
51+
4952
- uses: actions/checkout@v2
5053
- run: gem install jazzy
5154
- run: |
@@ -54,9 +57,9 @@ jobs:
5457
--module-version ${{ github.event.inputs.version }}
5558
- run: git remote update
5659
- run: git checkout gh-pages
57-
- run: rm -rf reference/v6
58-
- run: mv output reference/v6
59-
- run: git add reference/v6
60+
- run: rm -rf reference/v$v
61+
- run: mv output reference/v$v
62+
- run: git add reference/v$v
6063
- run: git config user.name github-actions
6164
- run: git config user.email [email protected]
6265
- run: git commit -m 'Updated docs for v${{ github.event.inputs.version }}'

.github/workflows/ci.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ jobs:
4242
with:
4343
file: ./info.lcov
4444

45-
macOS:
45+
apple:
4646
runs-on: macos-latest
4747
strategy:
4848
matrix:
4949
dst:
50-
- platform=macOS
51-
- platform=tvOS Simulator,OS=latest,name=Apple TV
52-
- platform=iOS Simulator,OS=latest,name=iPhone 12
50+
- platform=macOS
51+
- platform=tvOS Simulator,OS=latest,name=Apple TV
52+
- platform=iOS Simulator,OS=latest,name=iPhone 12
5353
steps:
5454
- uses: maxim-lobanov/setup-xcode@v1
5555
with:
@@ -58,8 +58,33 @@ jobs:
5858
- uses: sersoft-gmbh/xcodebuild-action@v1
5959
with:
6060
spm-package: ./
61-
scheme: PromiseKit
61+
scheme: PromiseKit-Package
6262
destination: ${{ matrix.dst }}
6363
action: test
6464
enable-code-coverage: true
6565
- uses: codecov/codecov-action@v1
66+
67+
watchOS:
68+
runs-on: macos-latest
69+
name: apple (watchOS)
70+
steps:
71+
- uses: maxim-lobanov/setup-xcode@v1
72+
with:
73+
xcode-version: ^12
74+
- uses: actions/checkout@v2
75+
# with Xcode 12.5 we can use the above matrix, but with 12.4
76+
# testing is not supported and trying to build with the Package.swift
77+
# tries to build the tests too 🙄
78+
- run: swift package generate-xcodeproj
79+
- uses: sersoft-gmbh/xcodebuild-action@v1
80+
with:
81+
project: PromiseKit.xcodeproj
82+
scheme: PromiseKit-Package
83+
destination: platform=watchOS Simulator,OS=latest,name=Apple Watch Series 5 - 40mm
84+
action: build
85+
86+
lint:
87+
runs-on: macos-latest
88+
steps:
89+
- uses: actions/checkout@v2
90+
- run: pod lib lint --fail-fast

Documents/Installation.md

Lines changed: 9 additions & 222 deletions
Original file line numberDiff line numberDiff line change
@@ -1,236 +1,23 @@
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:
52

63
```swift
74
package.dependencies.append(
85
.package(url: "https://github.com/mxcl/PromiseKit", from: "7.0.0-alpha.1")
96
)
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.
587

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"])
8910
)
9011
```
9112

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:
13114

13215
```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"
13918
```
14019

20+
## Carthage
14121

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

Comments
 (0)