Skip to content

Commit

Permalink
fixed #56
Browse files Browse the repository at this point in the history
app crashed when exporting a trimmed video due to a failure in the regift dependency
  • Loading branch information
dehlen committed Apr 5, 2019
1 parent 36d2e8f commit ae6a421
Show file tree
Hide file tree
Showing 29 changed files with 144 additions and 127 deletions.
2 changes: 1 addition & 1 deletion Capture/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<string>2.0.1</string>
<key>CFBundleVersion</key>
<string>2</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github "Clipy/KeyHolder"
github "Clipy/Magnet"
github "dehlen/Regift" ~> 1.5.1
github "dehlen/Regift" ~> 1.5.3
github "mxcl/PromiseKit"
github "PromiseKit/Foundation" ~> 3.0
github "dehlen/AboutWindowController" ~> 1.5.7
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github "Clipy/KeyHolder" "v3.0.1"
github "Clipy/Magnet" "v2.3.1"
github "PromiseKit/Foundation" "3.3.1"
github "PromiseKit/Foundation" "3.3.2"
github "dehlen/AboutWindowController" "1.5.7"
github "dehlen/Regift" "1.5.1"
github "mxcl/PromiseKit" "6.8.3"
github "dehlen/Regift" "1.5.3"
github "mxcl/PromiseKit" "6.8.4"
8 changes: 6 additions & 2 deletions Carthage/Checkouts/Foundation/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
osx_image: xcode10
env: SWIFT=4.2
name: pod lib lint --swift-version=4.2
- <<: *pod
osx_image: xcode10.2
env: SWIFT=5.0
name: pod lib lint --swift-version=5.0

- &linux
stage: compile
Expand Down Expand Up @@ -85,8 +89,8 @@ jobs:
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.2
name: Linux / Swift 4.2
- <<: *linux
env: SWIFT_BUILD_VERSION=5 SWIFT_VERSION=5.0-DEVELOPMENT-SNAPSHOT-2019-01-22-a
name: Linux / Swift 5.0 (2019-01-22)
env: SWIFT_BUILD_VERSION=5 SWIFT_VERSION=5.0
name: Linux / Swift 5.0

- &swiftpm
stage: compile
Expand Down
4 changes: 2 additions & 2 deletions Carthage/Checkouts/Foundation/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "AliSoftware/OHHTTPStubs" "6.1.0"
github "mxcl/PromiseKit" "6.5.0"
github "AliSoftware/OHHTTPStubs" "6.2.0"
github "mxcl/PromiseKit" "6.8.3"
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Max Howell";
TargetAttributes = {
63C7FFA61D5BEE09003BAE60 = {
Expand All @@ -204,17 +204,18 @@
};
63C7FFF11D5C020D003BAE60 = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKFoundation" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 63C7FF9D1D5BEE09003BAE60;
productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */;
Expand Down Expand Up @@ -344,7 +345,7 @@
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
Expand Down Expand Up @@ -402,7 +403,7 @@
PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions Carthage/Checkouts/Foundation/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/mxcl/PromiseKit.git",
"state": {
"branch": null,
"revision": "9e5bc43281cae89ab0b6e47df3ea25a2c44af7f0",
"version": "6.8.3"
"revision": "e0176e7886b3bef5b9a546bcc6b357f6f569f222",
"version": "6.8.4"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Foundation/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkg.products = [
pkg.dependencies = [
.package(url: "https://github.com/mxcl/PromiseKit.git", .upToNextMajor(from: "6.0.0"))
]
pkg.swiftLanguageVersions = [.v3, .v4, .v4_2]
pkg.swiftLanguageVersions = [.v3, .v4, .v4_2, .version("5")]

let target: Target = .target(name: "PMKFoundation")
target.path = "Sources"
Expand Down
15 changes: 8 additions & 7 deletions Carthage/Checkouts/Foundation/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@

This project adds promises to the Swift Foundation framework.

We support iOS, tvOS, watchOS, macOS and Linux, Swift 3.0, 3.1, 3.2, 4.0 and 4.1.
We support iOS, tvOS, watchOS, macOS and Linux, Swift 3.0, 3.1, 3.2, 4.0, 4.1,
4.2 and 5.0.

## CococaPods

```ruby
pod "PromiseKit/Foundation", "~> 6.0"
```

The extensions are built into `PromiseKit.framework` thus nothing else is needed.
The extensions are built into `PromiseKit.framework` thus nothing else is
needed.

## Carthage

> Note we can no longer support Swift 3 with Carthage due to Xcode 10.2 dropping
it and our only being able to provide a single `.xcodeproj`.

```ruby
github "PromiseKit/Foundation" ~> 3.0
```
Expand All @@ -35,11 +40,7 @@ import PMKFoundation
## SwiftPM

```swift
let package = Package(
dependencies: [
.Package(url: "https://github.com/PromiseKit/Foundation.git", majorVersion: 3)
]
)
package.dependencies.append(.package(url: "https://github.com/PromiseKit/Foundation.git", from: "3.0.0"))
```


Expand Down
8 changes: 0 additions & 8 deletions Carthage/Checkouts/PromiseKit/.github/.jazzy.yaml

This file was deleted.

12 changes: 4 additions & 8 deletions Carthage/Checkouts/PromiseKit/.github/PromiseKit.podspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Pod::Spec.new do |s|
s.name = "PromiseKit"

`xcodebuild -project PromiseKit.xcodeproj -showBuildSettings` =~ /CURRENT_PROJECT_VERSION = ((\d\.)+\d)/
abort("No version detected") if $1.nil?
s.version = $1
s.version = '0.0.1'

s.source = {
:git => "https://github.com/mxcl/#{s.name}.git",
Expand All @@ -13,17 +11,15 @@ Pod::Spec.new do |s|

s.license = 'MIT'
s.summary = 'Promises for Swift & ObjC.'
s.homepage = 'http://promisekit.org'
s.homepage = 'http://mxcl.dev/PromiseKit/'
s.description = 'A thoughtful and complete implementation of promises for iOS, macOS, watchOS and tvOS with first-class support for both Objective-C and Swift.'
s.social_media_url = 'https://twitter.com/mxcl'
s.authors = { 'Max Howell' => '[email protected]' }
s.documentation_url = 'http://promisekit.org/docs/'
s.documentation_url = 'http://mxcl.dev/PromiseKit/reference/v6/Classes/Promise.html'
s.default_subspecs = 'CorePromise', 'UIKit', 'Foundation'
s.requires_arc = true

# CocoaPods documentation (like usual) is unclear about the
# consequences of setting this; we support 3.2 THROUGH 4.2
# s.swift_version = '4.0'
s.swift_versions = ['3.1', '3.2', '3.3', '3.4', '4.0', '4.1', '4.2', '5.0']

# CocoaPods requires us to specify the root deployment targets
# even though for us it is nonsense. Our root spec has no
Expand Down
18 changes: 18 additions & 0 deletions Carthage/Checkouts/PromiseKit/.github/jazzy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module: PromiseKit
custom_categories:
- name: Core Components
children:
- Promise
- Guarantee
- Thenable
- CatchMixin
- Resolver
xcodebuild_arguments:
- UseModernBuildSystem=NO
output:
../output
# output directory is relative to config file… ugh
readme:
Documentation/README.md
theme:
fullwidth
1 change: 0 additions & 1 deletion Carthage/Checkouts/PromiseKit/.github/ranger.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
merges:
- action: delete_branch
- action: tag
53 changes: 28 additions & 25 deletions Carthage/Checkouts/PromiseKit/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
name: Carthage / Xcode 9.4
- <<: *carthage
osx_image: xcode10.1
name: Carthage / Xcode 10.0
name: Carthage / Xcode 10.1

- &pod
stage: lint
Expand All @@ -49,7 +49,7 @@ jobs:
cache: cocoapods
language: objective-c
before_install: mv .github/PromiseKit.podspec .
install: gem install cocoapods --prerelease --version 1.6.0.rc.2
install: gem install cocoapods --pre -v 1.7.0.beta.2
script: pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=$SWIFT
- <<: *pod
osx_image: xcode9.2
Expand All @@ -75,6 +75,10 @@ jobs:
osx_image: xcode10.1
env: SWIFT=4.2
name: pod lib lint --swift-version=4.2
- <<: *pod
osx_image: xcode10.2
env: SWIFT=4.2
name: pod lib lint --swift-version=5.0

- &linux
stage: compile
Expand Down Expand Up @@ -102,13 +106,13 @@ jobs:
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.1.2
name: Linux / Swift 4.1
- <<: *linux
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.2.1
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.2.2
name: Linux / Swift 4.2
stage: test
script: swift test -Xswiftc -swift-version -Xswiftc 4
- <<: *linux
env: SWIFT_BUILD_VERSION=5 SWIFT_VERSION=5.0-DEVELOPMENT-SNAPSHOT-2019-01-22-a
name: Linux / Swift 5.0 (2019-01-22)
env: SWIFT_BUILD_VERSION=5 SWIFT_VERSION=5.0
name: Linux / Swift 5.0
stage: test
script: swift test -Xswiftc -swift-version -Xswiftc 5

Expand Down Expand Up @@ -180,42 +184,41 @@ jobs:
name: SwiftPM / macOS / Xcode 10.1 / Swift 4.2

- stage: deploy
install: gem install cocoapods --pre -v 1.7.0.beta.2
before_script: |
mv .github/PromiseKit.podspec .
sed -i '' "s/s.version = '0.0.1'/s.version = '$TRAVIS_TAG'/g" PromiseKit.podspec
script: |
set -exo pipefail
gem install cocoapods --prerelease --version 1.6.0.rc.2
mv .github/PromiseKit.podspec .
pod trunk push --verbose --allow-warnings --swift-version=4.2 | ruby -e 'ARGF.each{ print "." }'
pod trunk push --verbose --allow-warnings | tee pod.log | ruby -e 'ARGF.each{ print "." }'
# ^^ pipe because Travis times us out if there is no output
# AND `pod` defaults to hardly any output
# BUT `--verbose` generates so much output that Travis kills our script due to *too much* output!
# --allow-warnings because Bolts generates warnings and CocoaPods fails you even if your deps emit warnings
os: osx
osx_image: xcode10.1
language: objective-c
language: swift
after_failure: cat pod.log | grep error

- stage: deploy
name: Generate Documentation
- name: Generate Documentation
os: osx
git.depth: false
osx_image: xcode10.1
language: swift
install: gem install jazzy
script: |
set -exo pipefail
jazzy \
--theme fullwidth \
--output foo \
--documentation=Documentation/*.md \
--readme Documentation/README.md \
--github_url https://github.com/mxcl/PromiseKit \
--xcodebuild-arguments UseModernBuildSystem=NO \
--module PromiseKit \
--module-version "$TRAVIS_TAG"
jazzy --config .github/jazzy.yml \
--github_url "https://github.com/$TRAVIS_REPO_SLUG" \
--module-version "$TRAVIS_TAG"
git remote update
git fetch origin gh-pages:gh-pages --depth 1
git checkout gh-pages
rm -rf reference
mv foo reference
git add reference
rm -rf reference/v6
mv output reference/v6
git add reference/v6
git config user.name "Travis"
git config user.email "bot@travis-ci.com"
git config user.email "jazzy@travis-ci.com"
git commit -m "Updated docs for v$TRAVIS_TAG"
git remote add secure-origin https://${GITHUB_TOKEN}@github.com/mxcl/PromiseKit.git
git remote add secure-origin https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git
git push secure-origin gh-pages
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ avoiding throwing an error because you couldn't be bothered to define a good glo
`Error` `enum`.


## Abstracting Away Asychronicity
## Abstracting Away Asynchronicity

```swift
var fetch = API.fetch()
Expand Down
12 changes: 6 additions & 6 deletions Carthage/Checkouts/PromiseKit/Documentation/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ use `weak self` (and check for `self == nil`) to prevent any such side effects.
should be protected against are in fact *not* side effects.

Side effects include changes to global application state. They *do not* include
changing the display state of a viewController. So, protect against setting UserDefaults or
changing the display state of a view-controller. So, protect against setting `UserDefaults` or
modifying the application database, and don't bother protecting against changing
the text in a `UILabel`.

[This stackoverflow question](https://stackoverflow.com/questions/39281214/should-i-use-weak-self-in-promisekit-blocks)
[This StackOverflow question](https://stackoverflow.com/questions/39281214/should-i-use-weak-self-in-promisekit-blocks)
has some good discussion on this topic.

## Do I need to retain my promises?
Expand Down Expand Up @@ -211,12 +211,12 @@ to a suitable problem, RxSwift can yield great benefits in robustness and simpli
But not all applications are suitable for RxSwift.

By contrast, PromiseKit selectively applies the best parts of reactive programming
to the hardest part of pure Swift development, the management of asynchrony. It's a broadly
to the hardest part of pure Swift development, the management of asynchronicity. It's a broadly
applicable tool. Most asynchronous code can be clarified, simplified and made more robust
just by converting it to use promises. (And the conversion process is easy.)

Promises make for code that is clear to most developers. RxSwift, perhaps not. Take a look at this
[signup panel](https://github.com/ReactiveX/RxSwift/tree/master/RxExample/RxExample/Examples/GitHubSignup)
[sign-up panel](https://github.com/ReactiveX/RxSwift/tree/master/RxExample/RxExample/Examples/GitHubSignup)
implemented in RxSwift and see what you think. (Note that this is one of RxSwift's own examples.)

Even where PromiseKit and RxSwift are broadly similar, there are many differences in implementation:
Expand Down Expand Up @@ -244,7 +244,7 @@ deallocated. All promises yield a single value, terminate and then automatically

You can find some additional discussion in [this ticket](https://github.com/mxcl/PromiseKit/issues/484).

## Why can’t I return from a catch like I can in Javascript?
## Why can’t I return from a catch like I can in JavaScript?

Swift demands that functions have one purpose. Thus, we have two error handlers:

Expand Down Expand Up @@ -377,7 +377,7 @@ By default PromiseKit emits console messages when certain events occur. These e
- A promise has been deallocated without being fulfilled
- An error which occurred while fulfilling a promise was swallowed using cauterize

You may turn off or redirect this output by setting a thread safe closure in [PMKCOnfiguration](https://github.com/mxcl/PromiseKit/blob/master/Sources/Configuration.swift) **before** processing any promises. For example, to turn off console output:
You may turn off or redirect this output by setting a thread safe closure in [PMKConfiguration](https://github.com/mxcl/PromiseKit/blob/master/Sources/Configuration.swift) **before** processing any promises. For example, to turn off console output:

```swift
conf.logHandler = { event in }
Expand Down
Loading

0 comments on commit ae6a421

Please sign in to comment.