diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6fdf296 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +## Build generated +build/ +DerivedData/ + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +.build/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build \ No newline at end of file diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000..bf92021 --- /dev/null +++ b/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved new file mode 100644 index 0000000..0ce5bfa --- /dev/null +++ b/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.5.2" diff --git a/Carthage/Checkouts/PromiseKit/.github/.jazzy.yaml b/Carthage/Checkouts/PromiseKit/.github/.jazzy.yaml new file mode 100644 index 0000000..d990792 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.github/.jazzy.yaml @@ -0,0 +1,8 @@ +root_url: + https://promisekit.org/reference/ +readme: + foo.md +exclude: + - Sources/Deprecations.swift + - Sources/AnyPromise.swift + \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/.github/ISSUE_TEMPLATE.md b/Carthage/Checkouts/PromiseKit/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..77d52ff --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,8 @@ +[PLEASE READ THE TROUBLESHOOTING GUIDE](https://github.com/mxcl/PromiseKit/blob/master/Documentation/Troubleshooting.md). + +--- + +You read the guide but it didn’t help? OK, we’re here to help. + +* Please specify the PromiseKit major version you are using +* [Please format your code in triple backticks and ensure readable indentation](https://help.github.com/articles/creating-and-highlighting-code-blocks/) diff --git a/Carthage/Checkouts/PromiseKit/.github/LinuxMain.stencil b/Carthage/Checkouts/PromiseKit/.github/LinuxMain.stencil new file mode 100644 index 0000000..11d1618 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.github/LinuxMain.stencil @@ -0,0 +1,19 @@ +@testable import Core +@testable import A_ +import XCTest + +//TODO get this to run on CI and don’t have it committed +//NOTE problem is Sourcery doesn’t support Linux currently +//USAGE: cd PromiseKit/Sources/.. && sourcery --config .github/sourcery.yml + +{% for type in types.classes|based:"XCTestCase" %} +extension {{ type.name }} { + static var allTests = [ + {% for method in type.methods %}{% if method.parameters.count == 0 and method.shortName|hasPrefix:"test" %} ("{{ method.shortName }}", {{type.name}}.{{ method.shortName }}), + {% endif %}{% endfor %}] +} + +{% endfor %} +XCTMain([ +{% for type in types.classes|based:"XCTestCase" %}{% if not type.annotations.excludeFromLinuxMain %} testCase({{ type.name }}.allTests), +{% endif %}{% endfor %}]) diff --git a/Carthage/Checkouts/PromiseKit/.github/PromiseKit.podspec b/Carthage/Checkouts/PromiseKit/.github/PromiseKit.podspec new file mode 100644 index 0000000..ae5b63b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.github/PromiseKit.podspec @@ -0,0 +1,281 @@ +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.source = { + :git => "https://github.com/mxcl/#{s.name}.git", + :tag => s.version, + :submodules => true + } + + s.license = 'MIT' + s.summary = 'Promises for Swift & ObjC.' + s.homepage = 'http://promisekit.org' + 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' => 'mxcl@me.com' } + s.documentation_url = 'http://promisekit.org/docs/' + 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' + + # CocoaPods requires us to specify the root deployment targets + # even though for us it is nonsense. Our root spec has no + # sources. + s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.10' + s.watchos.deployment_target = '2.0' + s.tvos.deployment_target = '9.0' + + s.pod_target_xcconfig = { + 'OTHER_SWIFT_FLAGS' => '-DPMKCocoaPods', + } + + s.subspec 'Accounts' do |ss| + ss.ios.source_files = ss.osx.source_files = 'Extensions/Accounts/Sources/*' + ss.ios.frameworks = ss.osx.frameworks = 'Accounts' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + end + + s.subspec 'Alamofire' do |ss| + ss.source_files = 'Extensions/Alamofire/Sources/*' + ss.dependency 'Alamofire', '~> 4.0' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.11' + ss.watchos.deployment_target = '2.0' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'AddressBook' do |ss| + ss.ios.source_files = 'Extensions/AddressBook/Sources/*' + ss.ios.frameworks = 'AddressBook' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + end + + s.subspec 'AssetsLibrary' do |ss| + ss.ios.source_files = 'Extensions/AssetsLibrary/Sources/*' + ss.ios.frameworks = 'AssetsLibrary' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + end + + s.subspec 'AVFoundation' do |ss| + ss.ios.source_files = 'Extensions/AVFoundation/Sources/*' + ss.ios.frameworks = 'AVFoundation' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + end + + s.subspec 'Bolts' do |ss| + ss.source_files = 'Extensions/Bolts/Sources/*' + ss.dependency 'PromiseKit/CorePromise' + ss.dependency 'Bolts', '~> 1.9.0' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.watchos.deployment_target = '2.0' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'CloudKit' do |ss| + ss.source_files = 'Extensions/CloudKit/Sources/*' + ss.frameworks = 'CloudKit' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '10.0' + ss.osx.deployment_target = '10.12' + ss.tvos.deployment_target = '10.0' + ss.watchos.deployment_target = '3.0' + end + + s.subspec 'CoreBluetooth' do |ss| + ss.ios.source_files = ss.osx.source_files = ss.tvos.source_files = 'Extensions/CoreBluetooth/Sources/*' + ss.ios.frameworks = ss.osx.frameworks = ss.tvos.frameworks = 'CoreBluetooth' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'CorePromise' do |ss| + hh = Dir['Sources/*.h'] - Dir['Sources/*+Private.h'] + + cc = Dir['Sources/*.swift'] - ['Sources/SwiftPM.swift'] + cc << 'Sources/{after,AnyPromise,GlobalState,dispatch_promise,hang,join,PMKPromise,when,race}.m' + cc += hh + + ss.source_files = cc + ss.public_header_files = hh + ss.preserve_paths = 'Sources/AnyPromise+Private.h', 'Sources/PMKCallVariadicBlock.m', 'Sources/NSMethodSignatureForBlock.m' + ss.frameworks = 'Foundation' + + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.watchos.deployment_target = '2.0' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'CoreLocation' do |ss| + ss.source_files = 'Extensions/CoreLocation/Sources/*' + ss.watchos.source_files = 'Extensions/CoreLocation/Sources/CLGeocoder*' + ss.dependency 'PromiseKit/CorePromise' + ss.frameworks = 'CoreLocation' + + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.watchos.deployment_target = '3.0' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'EventKit' do |ss| + ss.ios.source_files = ss.osx.source_files = ss.watchos.source_files = 'Extensions/EventKit/Sources/*' + ss.ios.frameworks = ss.osx.frameworks = ss.watchos.frameworks = 'EventKit' + ss.dependency 'PromiseKit/CorePromise' + + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.watchos.deployment_target = '2.0' + end + + s.subspec 'Foundation' do |ss| + ss.source_files = Dir['Extensions/Foundation/Sources/*'] + ss.dependency 'PromiseKit/CorePromise' + ss.frameworks = 'Foundation' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.watchos.deployment_target = '2.0' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'HealthKit' do |ss| + ss.source_files = Dir['Extensions/HealthKit/Sources/*'] + ss.dependency 'PromiseKit/CorePromise' + ss.frameworks = 'HealthKit' + ss.ios.deployment_target = '9.0' + ss.watchos.deployment_target = '2.0' + end + + s.subspec 'HomeKit' do |ss| + ss.source_files = Dir['Extensions/HomeKit/Sources/*'] + ss.dependency 'PromiseKit/CorePromise' + ss.frameworks = 'HomeKit' + ss.ios.deployment_target = '8.0' + ss.watchos.deployment_target = '3.0' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'MapKit' do |ss| + ss.ios.source_files = ss.osx.source_files = ss.tvos.source_files = 'Extensions/MapKit/Sources/*' + ss.ios.frameworks = ss.osx.frameworks = ss.tvos.frameworks = 'MapKit' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.watchos.deployment_target = '2.0' + ss.tvos.deployment_target = '9.2' + end + + s.subspec 'MessageUI' do |ss| + ss.ios.source_files = 'Extensions/MessagesUI/Sources/*' + ss.ios.frameworks = 'MessageUI' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + end + + s.subspec 'OMGHTTPURLRQ' do |ss| + ss.source_files = 'Extensions/OMGHTTPURLRQ/Sources/*' + ss.dependency 'PromiseKit/Foundation' + ss.dependency 'OMGHTTPURLRQ', '~> 3.2' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.watchos.deployment_target = '2.0' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'Photos' do |ss| + ss.ios.source_files = ss.tvos.source_files = ss.osx.source_files = 'Extensions/Photos/Sources/*' + ss.ios.frameworks = ss.tvos.frameworks = ss.osx.frameworks = 'Photos' + ss.dependency 'PromiseKit/CorePromise' + + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.13' + ss.tvos.deployment_target = '10.0' + end + + s.subspec 'QuartzCore' do |ss| + ss.osx.source_files = ss.ios.source_files = ss.tvos.source_files = 'Extensions/QuartzCore/Sources/*' + ss.osx.frameworks = ss.ios.frameworks = ss.tvos.frameworks = 'QuartzCore' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'Social' do |ss| + ss.ios.source_files = 'Extensions/Social/Sources/*' + ss.osx.source_files = Dir['Extensions/Social/Sources/*'] - ['Categories/Social/Sources/*SLComposeViewController+Promise.swift'] + ss.ios.frameworks = ss.osx.frameworks = 'Social' + ss.dependency 'PromiseKit/Foundation' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + end + + s.subspec 'StoreKit' do |ss| + ss.ios.source_files = ss.osx.source_files = ss.tvos.source_files = 'Extensions/StoreKit/Sources/*' + ss.ios.frameworks = ss.osx.frameworks = ss.tvos.frameworks = 'StoreKit' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'SystemConfiguration' do |ss| + ss.ios.source_files = ss.osx.source_files = ss.tvos.source_files = 'Extensions/SystemConfiguration/Sources/*' + ss.ios.frameworks = ss.osx.frameworks = ss.tvos.frameworks = 'SystemConfiguration' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.osx.deployment_target = '10.10' + ss.tvos.deployment_target = '9.0' + end + + picker_cc = 'Extensions/UIKit/Sources/UIImagePickerController+Promise.swift' + + s.subspec 'UIKit' do |ss| + ss.ios.source_files = ss.tvos.source_files = Dir['Extensions/UIKit/Sources/*'] - [picker_cc] + ss.tvos.frameworks = ss.ios.frameworks = 'UIKit' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.tvos.deployment_target = '9.0' + end + + s.subspec 'UIImagePickerController' do |ss| + # Since iOS 10, App Store submissions that contain references to + # UIImagePickerController (even if unused in 3rd party libraries) + # are rejected unless an Info.plist key is specified, thus we + # moved this code to a sub-subspec. + # + # This *was* a subspec of UIKit, but bizarrely CocoaPods would + # include this when specifying *just* UIKit…! + + ss.ios.source_files = picker_cc + ss.ios.frameworks = 'UIKit' + ss.ios.xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => '$(inherited) PMKImagePickerController=1' } + ss.dependency 'PromiseKit/UIKit' + ss.ios.deployment_target = '8.0' + end + + s.subspec 'WatchConnectivity' do |ss| + ss.ios.source_files = ss.watchos.source_files = 'Extensions/WatchConnectivity/Sources/*' + ss.ios.frameworks = ss.watchos.frameworks = 'WatchConnectivity' + ss.dependency 'PromiseKit/CorePromise' + ss.ios.deployment_target = '8.0' + ss.watchos.deployment_target = '2.0' + end +end diff --git a/Carthage/Checkouts/PromiseKit/.github/codecov.yml b/Carthage/Checkouts/PromiseKit/.github/codecov.yml new file mode 100644 index 0000000..8ffbde7 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.github/codecov.yml @@ -0,0 +1,29 @@ +ignore: + - "Tests" + - "README.md" + - "Documentation" + - ".travis.yml" + +codecov: + notify: + require_ci_to_pass: yes + +coverage: + precision: 1 + round: up + range: "70...100" + + status: + project: yes + patch: yes + changes: no + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: off diff --git a/Carthage/Checkouts/PromiseKit/.github/sourcery.yml b/Carthage/Checkouts/PromiseKit/.github/sourcery.yml new file mode 100644 index 0000000..e965499 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.github/sourcery.yml @@ -0,0 +1,12 @@ +sources: + include: + - ../Tests/A+ + - ../Tests/CorePromise + exclude: + - ../Tests/A+/0.0.0.swift + - ../Tests/CorePromise/Utilities.swift +templates: + include: + - LinuxMain.stencil +output: + ../Tests/LinuxMain.swift diff --git a/Carthage/Checkouts/PromiseKit/.gitignore b/Carthage/Checkouts/PromiseKit/.gitignore new file mode 100644 index 0000000..a966dc1 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.gitignore @@ -0,0 +1,9 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store +DerivedData +/PromiseKit.podspec +/Extensions/Carthage +/Tests/JS-A+/build diff --git a/Carthage/Checkouts/PromiseKit/.gitmodules b/Carthage/Checkouts/PromiseKit/.gitmodules new file mode 100644 index 0000000..9a18709 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.gitmodules @@ -0,0 +1,69 @@ +[submodule "Extensions/Foundation"] + path = Extensions/Foundation + url = https://github.com/PromiseKit/Foundation.git +[submodule "Extensions/UIKit"] + path = Extensions/UIKit + url = https://github.com/PromiseKit/UIKit.git +[submodule "Extensions/Accounts"] + path = Extensions/Accounts + url = https://github.com/PromiseKit/Accounts.git +[submodule "Extensions/MessagesUI"] + path = Extensions/MessagesUI + url = https://github.com/PromiseKit/MessagesUI.git +[submodule "Extensions/WatchConnectivity"] + path = Extensions/WatchConnectivity + url = https://github.com/PromiseKit/WatchConnectivity.git +[submodule "Extensions/Photos"] + path = Extensions/Photos + url = https://github.com/PromiseKit/Photos.git +[submodule "Extensions/MapKit"] + path = Extensions/MapKit + url = https://github.com/PromiseKit/MapKit.git +[submodule "Extensions/CloudKit"] + path = Extensions/CloudKit + url = https://github.com/PromiseKit/CloudKit.git +[submodule "Extensions/AddressBook"] + path = Extensions/AddressBook + url = https://github.com/PromiseKit/AddressBook.git +[submodule "Extensions/AssetsLibrary"] + path = Extensions/AssetsLibrary + url = https://github.com/PromiseKit/AssetsLibrary.git +[submodule "Extensions/CoreLocation"] + path = Extensions/CoreLocation + url = https://github.com/PromiseKit/CoreLocation.git +[submodule "Extensions/QuartzCore"] + path = Extensions/QuartzCore + url = https://github.com/PromiseKit/QuartzCore.git +[submodule "Extensions/Social"] + path = Extensions/Social + url = https://github.com/PromiseKit/Social.git +[submodule "Extensions/StoreKit"] + path = Extensions/StoreKit + url = https://github.com/PromiseKit/StoreKit.git +[submodule "Extensions/Bolts"] + path = Extensions/Bolts + url = https://github.com/PromiseKit/Bolts.git +[submodule "Extensions/CoreBluetooth"] + path = Extensions/CoreBluetooth + url = https://github.com/PromiseKit/CoreBluetooth.git +[submodule "Extensions/EventKit"] + path = Extensions/EventKit + url = https://github.com/PromiseKit/EventKit.git +[submodule "Extensions/SystemConfiguration"] + path = Extensions/SystemConfiguration + url = https://github.com/PromiseKit/SystemConfiguration +[submodule "Extensions/Alamofire"] + path = Extensions/Alamofire + url = https://github.com/PromiseKit/Alamofire +[submodule "Extensions/OMGHTTPURLRQ"] + path = Extensions/OMGHTTPURLRQ + url = https://github.com/PromiseKit/OMGHTTPURLRQ +[submodule "Extensions/AVFoundation"] + path = Extensions/AVFoundation + url = https://github.com/PromiseKit/AVFoundation +[submodule "Extensions/HomeKit"] + path = Extensions/HomeKit + url = https://github.com/PromiseKit/HomeKit.git +[submodule "Extensions/HealthKit"] + path = Extensions/HealthKit + url = https://github.com/PromiseKit/PMKHealthKit diff --git a/Carthage/Checkouts/PromiseKit/.travis.yml b/Carthage/Checkouts/PromiseKit/.travis.yml new file mode 100644 index 0000000..35baf2e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/.travis.yml @@ -0,0 +1,324 @@ +branches: + only: + - master + - ^\d+\.\d+\.\d+$ +stages: + - lint + - compile + - test + - deploy +jobs: + include: + - &macOS + stage: compile + osx_image: xcode8.3 + env: SWIFT=3.1 + name: macOS / Swift 3.1 + os: osx + language: objective-c + install: + xcodebuild -scheme PromiseKit -target PromiseKit SWIFT_VERSION=$SWIFT -quiet SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: "true" + + - <<: *macOS + osx_image: xcode9.2 + env: SWIFT=3.2 + name: macOS / Swift 3.2 + - <<: *macOS + osx_image: xcode9.4 + env: SWIFT=3.3 + name: macOS / Swift 3.3 + - <<: *macOS + osx_image: xcode10 + env: SWIFT=3.4 + name: macOS / Swift 3.4 + - <<: *macOS + osx_image: xcode9.2 + env: SWIFT=4.0 + name: macOS / Swift 4.0 + - <<: *macOS + osx_image: xcode9.4 + env: SWIFT=4.1 + name: macOS / Swift 4.1 + - <<: *macOS + osx_image: xcode10 + env: SWIFT=4.2 + name: macOS / Swift 4.2 + stage: test + script: + xcodebuild -scheme PromiseKit test -enableCodeCoverage YES + after_success: + bash <(curl -s https://codecov.io/bash) + + + - &iOS + stage: compile + osx_image: xcode8.3 + env: SWIFT=3.1 DST="OS=10.3.1,name=iPhone SE" + name: iOS 10 / Swift 3.1 + os: osx + language: objective-c + install: + xcodebuild -scheme PromiseKit -target PromiseKit SWIFT_VERSION=$SWIFT -destination "$DST" -quiet SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: "true" + + - <<: *iOS + osx_image: xcode9.2 + env: SWIFT=3.2 DST="OS=11.2,name=iPhone SE" + name: iOS 11 / Swift 3.2 + - <<: *iOS + osx_image: xcode9.4 + env: SWIFT=3.3 DST="OS=11.4,name=iPhone SE" + name: iOS 11 / Swift 3.3 + - <<: *iOS + osx_image: xcode10 + env: SWIFT=3.4 DST="OS=12.0,name=iPhone SE" + name: iOS 12 / Swift 3.4 + - <<: *iOS + osx_image: xcode9.2 + env: SWIFT=4.0 DST="OS=11.2,name=iPhone SE" + name: iOS 11 / Swift 4.0 + + - <<: *iOS + osx_image: xcode + env: SWIFT=4.1 DST="OS=8.4,name=iPhone 4s" + name: iOS 8 / Swift 4.1 + - <<: *iOS + osx_image: xcode9.4 + env: SWIFT=4.1 DST="OS=9.3,name=iPhone 5s" + name: iOS 9 / Swift 4.1 + - <<: *iOS + osx_image: xcode9.4 + env: SWIFT=4.1 DST="OS=10.3.1,name=iPhone SE" + name: iOS 10 / Swift 4.1 + - <<: *iOS + osx_image: xcode9.4 + env: SWIFT=4.1 DST="OS=11.4,name=iPhone SE" + name: iOS 11 / Swift 4.1 + + - <<: *iOS + osx_image: xcode10 + env: SWIFT=4.2 DST="OS=12.0,name=iPhone SE" + name: iOS 12 / Swift 4.2 + stage: test + script: + xcodebuild -scheme PromiseKit -destination "$DST" test -enableCodeCoverage YES + after_success: + bash <(curl -s https://codecov.io/bash) + + + - &tvOS + stage: compile + name: tvOS 10 / Swift 3.1 + osx_image: xcode8.3 + env: SWIFT=3.1 DST="OS=10.2,name=Apple TV 1080p" + os: osx + language: objective-c + install: + xcodebuild -scheme PromiseKit -target PromiseKit SWIFT_VERSION=$SWIFT -destination "$DST" -quiet SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: "true" + + - <<: *tvOS + osx_image: xcode9.2 + env: SWIFT=3.2 DST="OS=11.2,name=Apple TV" + name: tvOS 11 / Swift 3.2 + - <<: *tvOS + osx_image: xcode9.4 + env: SWIFT=3.3 DST="OS=11.4,name=Apple TV" + name: tvOS 11 / Swift 3.3 + - <<: *tvOS + osx_image: xcode10 + env: SWIFT=3.4 DST="OS=11.4,name=Apple TV" + name: tvOS 11 / Swift 3.4 + - <<: *tvOS + osx_image: xcode9.2 + env: SWIFT=4.0 DST="OS=11.2,name=Apple TV" + name: tvOS 11 / Swift 4.0 + + - <<: *tvOS + osx_image: xcode9.3 + env: SWIFT=4.1 DST="OS=9.2,name=Apple TV 1080p" + name: tvOS 9 / Swift 4.1 + - <<: *tvOS + osx_image: xcode9.3 + env: SWIFT=4.1 DST="OS=10.2,name=Apple TV 1080p" + name: tvOS 10 / Swift 4.1 + - <<: *tvOS + osx_image: xcode9.4 + env: SWIFT=4.1 DST="OS=11.4,name=Apple TV" + name: tvOS 11 / Swift 4.1 + + - <<: *tvOS + osx_image: xcode10 + env: SWIFT=4.2 DST="OS=12.0,name=Apple TV" + name: tvOS 12 / Swift 4.2 + stage: test + script: + xcodebuild -scheme PromiseKit -destination "$DST" test -enableCodeCoverage YES + after_success: + bash <(curl -s https://codecov.io/bash) + + + - &watchOS + stage: compile + osx_image: xcode10 + env: SWIFT=4.2 DST="OS=5.0,name=Apple Watch Series 3 - 42mm" + name: watchOS 5 / Swift 4.2 + os: osx + language: objective-c + script: + xcodebuild -scheme PromiseKit SWIFT_VERSION=$SWIFT -destination "$DST" -quiet SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + + - <<: *watchOS + osx_image: xcode8.3 + env: SWIFT=3.1 DST="OS=3.2,name=Apple Watch - 38mm" + name: watchOS 3 / Swift 3.1 + - <<: *watchOS + osx_image: xcode9.2 + env: SWIFT=3.2 DST="OS=4.2,name=Apple Watch - 38mm" + name: watchOS 4 / Swift 3.2 + - <<: *watchOS + osx_image: xcode9.4 + env: SWIFT=3.3 DST="OS=4.3,name=Apple Watch - 38mm" + name: watchOS 4 / Swift 3.3 + - <<: *watchOS + osx_image: xcode10 + env: SWIFT=3.4 DST="OS=5.0,name=Apple Watch Series 3 - 42mm" + name: watchOS 5 / Swift 3.4 + - <<: *watchOS + osx_image: xcode9.2 + env: SWIFT=4.0 DST="OS=4.2,name=Apple Watch - 38mm" + name: watchOS 4 / Swift 4.0 + + - <<: *watchOS + osx_image: xcode9.3 + env: SWIFT=4.1 DST="OS=2.2,name=Apple Watch - 38mm" + name: watchOS 2 / Swift 4.1 + - <<: *watchOS + osx_image: xcode9.3 + env: SWIFT=4.1 DST="OS=3.2,name=Apple Watch - 38mm" + name: watchOS 3 / Swift 4.1 + - <<: *watchOS + osx_image: xcode9.4 + env: SWIFT=4.1 DST="OS=4.3,name=Apple Watch - 38mm" + name: watchOS 4 / Swift 4.1 + + - <<: *watchOS + osx_image: xcode10 + env: SWIFT=4.2 DST="OS=5.0,name=Apple Watch Series 3 - 42mm" + name: watchOS 5 / Swift 4.2 + + + - &pod + stage: lint + osx_image: xcode10 + env: SWIFT=4.2 + name: pod lib lint --swift-version=4.2 + os: osx + language: objective-c + before_install: | + mv .github/PromiseKit.podspec . + gem install cocoapods --prerelease --version 1.6.0.beta.1 + script: + pod lib lint --subspec=PromiseKit/CorePromise --fail-fast --swift-version=$SWIFT + + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=4.1 + name: pod lib lint --swift-version=4.1 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=4.0 + name: pod lib lint --swift-version=4.0 + - <<: *pod + osx_image: xcode10 + env: SWIFT=3.4 + name: pod lib lint --swift-version=3.4 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=3.3 + name: pod lib lint --swift-version=3.3 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=3.2 + name: pod lib lint --swift-version=3.2 + - <<: *pod + osx_image: xcode8.3 + env: SWIFT=3.1 + name: pod lib lint --swift-version=3.1 + + + - &linux + stage: compile + env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.0.3 + name: Linux / Swift 3.2 + os: linux + dist: trusty + sudo: required + language: generic + before_install: + eval "$(curl -sL https://swiftenv.fuller.li/install.sh)" + install: + swift build -Xswiftc -swift-version -Xswiftc $SWIFT_BUILD_VERSION + + - <<: *linux + env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.1.2 + name: Linux / Swift 3.3 + - <<: *linux + env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.2 + name: Linux / Swift 3.4 + - <<: *linux + env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.0.3 + name: Linux / Swift 4.0 + stage: test + install: swift test -Xswiftc -swift-version -Xswiftc 4 + - <<: *linux + env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.1.2 + name: Linux / Swift 4.1 + stage: test + install: swift test -Xswiftc -swift-version -Xswiftc 4 + - <<: *linux + env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.2 + name: Linux / Swift 4.2 + stage: test + install: swift test -Xswiftc -swift-version -Xswiftc 4 + + + # only run one instance of these since they test behavior + - stage: test + name: Promises/A+ via Javascript Bridge + language: objective-c + os: osx + osx_image: xcode10 + before_install: + npm install -g npm + # ^^ need newer npm than comes with the image + install: | + cd Tests/JS-A+ + set -e + npm ci + npm run build + set +e + # ^^ `cd` on travis returns a non-zero exit code! + cd ../.. + xcodebuild -scheme PromiseKit -quiet SWIFT_VERSION=4.2 SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: + xcodebuild -scheme PromiseKit SWIFT_VERSION=4.2 test + # TODO only run the A+ tests + # TODO shouldn’t build twice! Be kind to Travis. + cache: + - Tests/JS-A+/build + - Tests/JS-A+/node_modules + + + - stage: deploy + if: tag IS present + script: | + set -euxo pipefail + pod trunk push --verbose --swift-version=4.2 | ruby -e 'ARGF.each{ print "." }' + # This 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! + os: osx + osx_image: xcode10 + language: objective-c diff --git a/Carthage/Checkouts/PromiseKit/Documentation/Appendix.md b/Carthage/Checkouts/PromiseKit/Documentation/Appendix.md new file mode 100644 index 0000000..d3797f4 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/Appendix.md @@ -0,0 +1,211 @@ +# Common Misusage + +## Doubling up Promises + +Don’t do this: + +```swift +func toggleNetworkSpinnerWithPromise(funcToCall: () -> Promise) -> Promise { + return Promise { seal in + firstly { + setNetworkActivityIndicatorVisible(true) + return funcToCall() + }.then { result in + seal.fulfill(result) + }.always { + setNetworkActivityIndicatorVisible(false) + }.catch { err in + seal.reject(err) + } + } +} +``` + +Do this: + +```swift +func toggleNetworkSpinnerWithPromise(funcToCall: () -> Promise) -> Promise { + return firstly { + setNetworkActivityIndicatorVisible(true) + return funcToCall() + }.always { + setNetworkActivityIndicatorVisible(false) + } +} +``` + +You already *had* a promise, you don’t need to wrap it in another promise. + + +## Optionals in Promises + +When we see `Promise`, it usually implies a misuse of promises. For +example: + +```swift +return firstly { + getItems() +}.then { items -> Promise<[Item]?> in + guard !items.isEmpty else { + return .value(nil) + } + return Promise(value: items) +} +``` + +The second `then` chooses to return `nil` in some circumstances. This choice +imposes the need to check for `nil` on the consumer of the promise. + +It's usually better to shunt these sorts of exceptions away from the +happy path and onto the error path. In this case, we can create a specific +error type for this condition: + +```swift +return firstly { + getItems() +}.map { items -> [Item]> in + guard !items.isEmpty else { + throw MyError.emptyItems + } + return items +} +``` + +> *Note*: Use `compactMap` when an API outside your control returns an Optional and you want to generate an error instead of propagating `nil`. + +# Tips n’ Tricks + +## Background-Loaded Member Variables + +```swift +class MyViewController: UIViewController { + private let ambience: Promise = DispatchQueue.global().async(.promise) { + guard let asset = NSDataAsset(name: "CreepyPad") else { throw PMKError.badInput } + let player = try AVAudioPlayer(data: asset.data) + player.prepareToPlay() + return player + } +} +``` + +## Chaining Animations + +```swift +firstly { + UIView.animate(.promise, duration: 0.3) { + self.button1.alpha = 0 + } +}.then { + UIView.animate(.promise, duration: 0.3) { + self.button2.alpha = 1 + } +}.then { + UIView.animate(.promise, duration: 0.3) { + adjustConstraints() + self.view.layoutIfNeeded() + } +} +``` + + +## Voiding Promises + +It is often convenient to erase the type of a promise to facilitate chaining. +For example, `UIView.animate(.promise)` returns `Guarantee` because UIKit’s +completion API supplies a `Bool`. However, we usually don’t need this value and +can chain more simply if it is discarded (that is, converted to `Void`). We can use +`asVoid()` to achieve this conversion: + +```swift +UIView.animate(.promise, duration: 0.3) { + self.button1.alpha = 0 +}.asVoid().done(self.nextStep) +``` + +For situations in which we are combining many promises into a `when`, `asVoid()` +becomes essential: + +```swift +let p1 = foo() +let p2 = bar() +let p3 = baz() +//… +let p10 = fluff() + +when(fulfilled: p1.asVoid(), p2.asVoid(), /*…*/, p10.asVoid()).then { + let value1 = p1.value! // safe bang since all the promises fulfilled + // … + let value10 = p10.value! +}.catch { + //… +} +``` + +You normally don't have to do this explicitly because `when` does it for you +for up to 5 parameters. + + +## Blocking (Await) + +Sometimes you have to block the main thread to await completion of an asynchronous task. +In these cases, you can (with caution) use `wait`: + +```swift +public extension UNUserNotificationCenter { + var wasPushRequested: Bool { + let settings = Guarantee(resolver: getNotificationSettings).wait() + return settings != .notDetermined + } +} +``` + +The task under the promise **must not** call back onto the current thread or it +will deadlock. + +## Starting a Chain on a Background Queue/Thread + +`firstly` deliberately does not take a queue. A detailed rationale for this choice +can be found in the ticket tracker. + +So, if you want to start a chain by dispatching to the background, you have to use +`DispatchQueue.async`: + +```swift +DispatchQueue.global().async(.promise) { + return value +}.done { value in + //… +} +``` + +However, this function cannot return a promise because of Swift compiler ambiguity +issues. Thus, if you must start a promise on a background queue, you need to +do something like this: + + +```swift +Promise { seal in + DispatchQueue.global().async { + seal(value) + } +}.done { value in + //… +} +``` + +Or more simply (though with caveats; see the documentation for `wait`): + +```swift +DispatchQueue.global().async(.promise) { + return try fetch().wait() +}.done { value in + //… +} +``` + +However, you shouldn't need to do this often. If you find yourself wanting to use +this technique, perhaps you should instead modify the code for `fetch` to make it do +its work on a background thread. + +Promises abstract asynchronicity, so exploit and support that model. Design your +APIs so that consumers don’t have to care what queue your functions run on. diff --git a/Carthage/Checkouts/PromiseKit/Documentation/CommonPatterns.md b/Carthage/Checkouts/PromiseKit/Documentation/CommonPatterns.md new file mode 100644 index 0000000..6958338 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/CommonPatterns.md @@ -0,0 +1,480 @@ +# Common Patterns + +One feature of promises that makes them particularly useful is that they are composable. +This fact enables complex, yet safe asynchronous patterns that would otherwise be quite +intimidating when implemented with traditional methods. + + +## Chaining + +The most common pattern is chaining: + +```swift +firstly { + fetch() +}.then { + map($0) +}.then { + set($0) + return animate() +}.ensure { + cleanup() +}.catch { + handle(error: $0) +} +``` + +If you return a promise in a `then`, the next `then` *waits* on that promise +before continuing. This is the essence of promises. + +Promises are easy to compose, so they encourage you to develop highly asynchronous +apps without fear of the spaghetti code (and associated refactoring pains) of +asynchronous systems that use completion handlers. + + +## APIs That Use Promises + +Promises are composable, so return them instead of accepting completion blocks: + +```swift +class MyRestAPI { + func user() -> Promise { + return firstly { + URLSession.shared.dataTask(.promise, with: url) + }.compactMap { + try JSONSerialization.jsonObject(with: $0.data) as? [String: Any] + }.map { dict in + User(dict: dict) + } + } + + func avatar() -> Promise { + return user().then { user in + URLSession.shared.dataTask(.promise, with: user.imageUrl) + }.compactMap { + UIImage(data: $0.data) + } + } +} +``` + +This way, asynchronous chains can cleanly and seamlessly incorporate code from all over +your app without violating architectural boundaries. + +> *Note*: We provide [promises for Alamofire](https://github.com/PromiseKit/Alamofire-) too! + + +## Background Work + +```swift +class MyRestAPI { + func avatar() -> Promise { + let bgq = DispatchQueue.global(qos: .userInitiated) + + return firstly { + user() + }.then(on: bgq) { user in + URLSession.shared.dataTask(.promise, with: user.imageUrl) + }.compactMap(on: bgq) { + UIImage(data: $0) + } + } +} +``` + +All PromiseKit handlers take an `on` parameter that lets you designate the dispatch queue +on which to run the handler. The default is always the main queue. + +PromiseKit is *entirely* thread safe. + +> *Tip*: With caution, you can have all `then`, `map`, `compactMap`, etc., run on +a background queue. See `PromiseKit.conf`. Note that we suggest only changing +the queue for the `map` suite of functions, so `done` and `catch` will +continue to run on the main queue, which is *usually* what you want. + +## Failing Chains + +If an error occurs mid-chain, simply throw an error: + +```swift +firstly { + foo() +}.then { baz in + bar(baz) +}.then { result in + guard !result.isBad else { throw MyError.myIssue } + //… + return doOtherThing() +} +``` + +The error will surface at the next `catch` handler. + +Since promises handle thrown errors, you don't have to wrap calls to throwing functions +in a `do` block unless you really want to handle the errors locally: + +```swift +foo().then { baz in + bar(baz) +}.then { result in + try doOtherThing() +}.catch { error in + // if doOtherThing() throws, we end up here +} +``` + +> *Tip*: Swift lets you define an inline `enum Error` inside the function you +are working on. This isn’t *great* coding practice, but it's better than +avoiding throwing an error because you couldn't be bothered to define a good global +`Error` `enum`. + + +## Abstracting Away Asychronicity + +```swift +var fetch = API.fetch() + +override func viewDidAppear() { + fetch.then { items in + //… + } +} + +func buttonPressed() { + fetch.then { items in + //… + } +} + +func refresh() { + // ensure only one fetch operation happens at a time + + if fetch.isResolved { + startSpinner() + fetch = API.fetch().ensure { + stopSpinner() + } + } + return fetch +} +``` + +With promises, you don’t need to worry about *when* your asynchronous operation +finishes. Just act like it already has. + +Above, we see that you can call `then` as many times on a promise as you +like. All the blocks will be executed in the order they were added. + + +## Chaining Sequences + +When you have a series of tasks to perform on an array of data: + +```swift +// fade all visible table cells one by one in a “cascading” effect + +let fade = Guarantee() +for cell in tableView.visibleCells { + fade = fade.then { + UIView.animate(.promise, duration: 0.1) { + cell.alpha = 0 + } + } +} +fade.done { + // finish +} +``` + +> *Note*: You *usually* you want `when()`, since `when` executes all of its +component promises in parallel and so completes much faster. Use the pattern +shown above in situations where tasks *must* be run sequentially; animation +is a good example. + +We also provide `when(concurrently:)`, which lets you schedule more than +one promise at a time if you need to. + +## Timeout + +```swift +let fetches: [Promise] = makeFetches() +let timeout = after(seconds: 4) + +race(when(fulfilled: fetches).asVoid(), timeout).then { + //… +} +``` + +`race` continues as soon as one of the promises it is watching finishes. + +Make sure the promises you pass to `race` are all of the same type. The easiest way +to ensure this is to use `asVoid()`. + +Note that if any component promise rejects, the `race` will reject, too. + + +# Minimum Duration + +Sometimes you need a task to take *at least* a certain amount of time. (For example, +you want to show a progress spinner, but if it shows for less than 0.3 seconds, the UI +appears broken to the user.) + +```swift +let waitAtLeast = after(seconds: 0.3) + +firstly { + foo() +}.then { + waitAtLeast +}.done { + //… +} +``` + +The code above works because we create the delay *before* we do work in `foo()`. By the +time we get to waiting on that promise, either it will have already timed out or we will wait +for whatever remains of the 0.3 seconds before continuing the chain. + + +## Cancellation + +Promises don’t have a `cancel` function, but they do support cancellation through a +special error type that conforms to the `CancellableError` protocol. + +```swift +func foo() -> (Promise, cancel: () -> Void) { + let task = Task(…) + var cancelme = false + + let promise = Promise { seal in + task.completion = { value in + guard !cancelme else { return reject(PMKError.cancelled) } + seal.fulfill(value) + } + task.start() + } + + let cancel = { + cancelme = true + task.cancel() + } + + return (promise, cancel) +} +``` + +Promises don’t have a `cancel` function because you don’t want code outside of +your control to be able to cancel your operations--*unless*, of course, you explicitly +want to enable that behavior. In cases where you do want cancellation, the exact way +that it should work will vary depending on how the underlying task supports cancellation. +PromiseKit provides cancellation primitives but no concrete API. + +Cancelled chains do not call `catch` handlers by default. However you can +intercept cancellation if you like: + +```swift +foo.then { + //… +}.catch(policy: .allErrors) { + // cancelled errors are handled *as well* +} +``` + +**Important**: Canceling a promise chain is *not* the same as canceling the underlying +asynchronous task. Promises are wrappers around asynchronicity, but they have no +control over the underlying tasks. If you need to cancel an underlying task, you +need to cancel the underlying task! + +> The library [CancellablePromiseKit](https://github.com/johannesd/CancellablePromiseKit) extends the concept of Promises to fully cover cancellable tasks. + +## Retry / Polling + +```swift +func attempt(maximumRetryCount: Int = 3, delayBeforeRetry: DispatchTimeInterval = .seconds(2), _ body: @escaping () -> Promise) -> Promise { + var attempts = 0 + func attempt() -> Promise { + attempts += 1 + return body().recover { error -> Promise in + guard attempts < maximumRetryCount else { throw error } + return after(delayBeforeRetry).then(on: nil, attempt) + } + } + return attempt() +} + +attempt(maximumRetryCount: 3) { + flakeyTask(parameters: foo) +}.then { + //… +}.catch { _ in + // we attempted three times but still failed +} +``` + +In most cases, you should probably supplement the code above so that it re-attempts only for +specific error conditions. + + +## Wrapping Delegate Systems + +Be careful with Promises and delegate systems, as they are not always compatible. +Promises complete *once*, whereas most delegate systems may notify their delegate many +times. This is why, for example, there is no PromiseKit extension for a +`UIButton`. + +A good example of an appropriate time to wrap delegation is when you need a +single `CLLocation` lookup: + +```swift +extension CLLocationManager { + static func promise() -> Promise { + return PMKCLLocationManagerProxy().promise + } +} + +class PMKCLLocationManagerProxy: NSObject, CLLocationManagerDelegate { + private let (promise, seal) = Promise<[CLLocation]>.pending() + private var retainCycle: PMKCLLocationManagerProxy? + private let manager = CLLocationManager() + + init() { + super.init() + retainCycle = self + manager.delegate = self // does not retain hence the `retainCycle` property + + promise.ensure { + // ensure we break the retain cycle + self.retainCycle = nil + } + } + + @objc fileprivate func locationManager(_: CLLocationManager, didUpdateLocations locations: [CLLocation]) { + seal.fulfill(locations) + } + + @objc func locationManager(_: CLLocationManager, didFailWithError error: Error) { + seal.reject(error) + } +} + +// use: + +CLLocationManager.promise().then { locations in + //… +}.catch { error in + //… +} +``` + +> Please note: we provide this promise with our CoreLocation extensions at +> https://github.com/PromiseKit/CoreLocation + + +## Recovery + +Sometimes you don’t want an error to cascade. Instead, you want to supply a default result: + +```swift +CLLocationManager.requestLocation().recover { error -> Promise in + guard error == MyError.airplaneMode else { + throw error + } + return .value(CLLocation.savannah) +}.done { location in + //… +} +``` + +Be careful not to ignore all errors, though! Recover only those errors that make sense to recover. + + +## Promises for Modal View Controllers + +```swift +class ViewController: UIViewController { + + private let (promise, seal) = Guarantee<…>.pending() // use Promise if your flow can fail + + func show(in: UIViewController) -> Promise<…> { + in.show(self, sender: in) + return promise + } + + func done() { + dismiss(animated: true) + seal.fulfill(…) + } +} + +// use: + +ViewController().show(in: self).done { + //… +}.catch { error in + //… +} +``` + +This is the best approach we have found, which is a pity as it requires the +presentee to control the presentation and requires the presentee to dismiss itself +explicitly. + +Nothing seems to beat storyboard segues for decoupling an app's controllers. + + +## Saving Previous Results + +Let’s say you have: + + +```swift +login().then { username in + fetch(avatar: username) +}.done { image in + //… +} +``` + +What if you want access to both `username` and `image` in your `done`? + +The most obvious way is to use nesting: + +```swift +login().then { username in + fetch(avatar: username).done { image in + // we have access to both `image` and `username` + } +}.done { + // the chain still continues as you'd expect +} +``` + +However, such nesting reduces the clarity of the chain. Instead, we could use Swift +tuples: + +```swift +login().then { username in + fetch(avatar: username).map { ($0, username) } +}.then { image, username in + //… +} +``` + +The code above simply maps `Promise` into `Promise<(UIImage, String)>`. + + +## Waiting on Multiple Promises, Whatever Their Result + +Use `when(resolved:)`: + +```swift +when(resolved: a, b).done { (results: [Result]) in + // `Result` is an enum of `.fulfilled` or `.rejected` +} + +// ^^ cannot call `catch` as `when(resolved:)` returns a `Guarantee` +``` + +Generally, you don't want this! People ask for it a lot, but usually because +they are trying to ignore errors. What they really need is to use `recover` on one of the +promises. Errors happen, so they should be handled; you usually don't want to ignore them. diff --git a/Carthage/Checkouts/PromiseKit/Documentation/Examples/ImageCache.md b/Carthage/Checkouts/PromiseKit/Documentation/Examples/ImageCache.md new file mode 100644 index 0000000..64603d9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/Examples/ImageCache.md @@ -0,0 +1,131 @@ +# Image Cache with Promises + +Here is an example of a simple image cache that uses promises to simplify the +state machine: + +```swift +import Foundation +import PromiseKit + +/** + * Small (10 images) + * Thread-safe + * Consolidates multiple requests to the same URLs + * Removes stale entries (FIXME well, strictly we may delete while fetching from cache, but this is unlikely and non-fatal) + * Completely _ignores_ server caching headers! + */ + +private let q = DispatchQueue(label: "org.promisekit.cache.image") +private var active: [URL: Promise] = [:] +private var cleanup = Promise() + + +public func fetch(image url: URL) -> Promise { + var promise: Promise? + q.sync { + promise = active[url] + } + if let promise = promise { + return promise + } + + q.sync(flags: .barrier) { + promise = Promise(.start) { + + let dst = try url.cacheDestination() + + guard !FileManager.default.isReadableFile(atPath: dst.path) else { + return Promise(dst) + } + + return Promise { seal in + URLSession.shared.downloadTask(with: url) { tmpurl, _, error in + do { + guard let tmpurl = tmpurl else { throw error ?? E.unexpectedError } + try FileManager.default.moveItem(at: tmpurl, to: dst) + seal.fulfill(dst) + } catch { + seal.reject(error) + } + }.resume() + } + + }.then(on: .global(QoS: .userInitiated)) { + try Data(contentsOf: $0) + } + + active[url] = promise + + if cleanup.isFulfilled { + cleanup = promise!.asVoid().then(on: .global(QoS: .utility), execute: docleanup) + } + } + + return promise! +} + +public func cached(image url: URL) -> Data? { + guard let dst = try? url.cacheDestination() else { + return nil + } + return try? Data(contentsOf: dst) +} + + +public func cache(destination remoteUrl: URL) throws -> URL { + return try remoteUrl.cacheDestination() +} + +private func cache() throws -> URL { + guard let dst = FileManager.default.docs? + .appendingPathComponent("Library") + .appendingPathComponent("Caches") + .appendingPathComponent("cache.img") + else { + throw E.unexpectedError + } + + try FileManager.default.createDirectory(at: dst, withIntermediateDirectories: true, attributes: [:]) + + return dst +} + +private extension URL { + func cacheDestination() throws -> URL { + + var fn = String(hashValue) + let ext = pathExtension + + // many of Apple's functions don’t recognize file type + // unless we preserve the file extension + if !ext.isEmpty { + fn += ".\(ext)" + } + + return try cache().appendingPathComponent(fn) + } +} + +enum E: Error { + case unexpectedError + case noCreationTime +} + +private func docleanup() throws { + var contents = try FileManager.default + .contentsOfDirectory(at: try cache(), includingPropertiesForKeys: [.creationDateKey]) + .map { url -> (Date, URL) in + guard let date = try url.resourceValues(forKeys: [.creationDateKey]).creationDate else { + throw E.noCreationTime + } + return (date, url) + }.sorted(by: { + $0.0 > $1.0 + }) + + while contents.count > 10 { + let rm = contents.popLast()!.1 + try FileManager.default.removeItem(at: rm) + } +} +```` \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Documentation/Examples/URLSession+BadResponseErrors.swift b/Carthage/Checkouts/PromiseKit/Documentation/Examples/URLSession+BadResponseErrors.swift new file mode 100644 index 0000000..efc37ef --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/Examples/URLSession+BadResponseErrors.swift @@ -0,0 +1,20 @@ +Promise(.pending) { seal in + URLSession.shared.dataTask(with: rq, completionHandler: { data, rsp, error in + if let data = data { + seal.fulfill(data) + } else if let error = error { + if case URLError.badServerResponse = error, let rsp = rsp as? HTTPURLResponse { + seal.reject(Error.badResponse(rsp.statusCode)) + } else { + seal.reject(error) + } + } else { + seal.reject(PMKError.invalidCallingConvention) + } + }) +} + +enum Error: Swift.Error { + case badUrl + case badResponse(Int) +} diff --git a/Carthage/Checkouts/PromiseKit/Documentation/FAQ.md b/Carthage/Checkouts/PromiseKit/Documentation/FAQ.md new file mode 100644 index 0000000..40ba02f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/FAQ.md @@ -0,0 +1,375 @@ +# FAQ + +## Why should I use PromiseKit over X-Promises-Foo? + +* PromiseKit has a heavy focus on **developer experience**. You’re a developer; do you care about your experience? Yes? Then pick PromiseKit. +* Do you care about having any bugs you find fixed? Then pick PromiseKit. +* Do you care about having your input heard and reacted to in a fast fashion? Then pick PromiseKit. +* Do you want a library that has been maintained continuously and passionately for 6 years? Then pick PromiseKit. +* Do you want a library that the community has chosen to be their №1 Promises/Futures library? Then pick PromiseKit. +* Do you want to be able to use Promises with Apple’s SDKs rather than having to do all the work of writing the Promise implementations yourself? Then pick PromiseKit. +* Do you want to be able to use Promises with Swift 3.x, Swift 4.x, ObjC, iOS, tvOS, watchOS, macOS, Android & Linux? Then pick PromiseKit. +* PromiseKit verifies its correctness by testing against the entire [Promises/A+ test suite](https://github.com/promises-aplus/promises-tests). + +## How do I create a fulfilled `Void` promise? + +```swift +let foo = Promise() + +// or: + +let bar = Promise.value(()) +``` + +## How do I “early `return`”? + +```swift +func foo() -> Promise { + guard thingy else { + return Promise() + } + + //… +} + +func bar() -> Promise { + guard thingy else { + return .value(instanceOfSomethingNotVoid) + } + + //… +} +``` + +## Do I need to worry about retain cycles? + +Generally, no. Once a promise completes, all handlers are released and so +any references to `self` are also released. + +However, if your chain contains side effects that you would typically +not want to happen after, say, a view controller is popped, then you should still +use `weak self` (and check for `self == nil`) to prevent any such side effects. + +*However*, in our experience most things that developers consider side effects that +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 +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) +has some good discussion on this topic. + +## Do I need to retain my promises? + +No. Every promise handler retains its promise until the handler is executed. Once +all handlers have been executed, the promise is deallocated. So you only need to retain +the promise if you need to refer to its final value after its chain has completed. + +## Where should I put my `catch`? + +`catch` deliberately terminates the chain. You should put it low in your promise +hierarchy at a point as close to the root as possible. Typically, this would be +somewhere such as a view controller, where your `catch` can then display a message +to the user. + +This means you should be writing one catch for many `then`s and returning +promises that do not have internal `catch` handlers of their own. + +This is obviously a guideline; do what is necessary. + +## How do branched chains work? + +Suppose you have a promise: + +``` +let promise = foo() +``` + +And you call `then` twice: + +``` +promise.then { + // branch A +} + +promise.then { + // branch B +} +``` + +You now have a branched chain. When `promise` resolves, both chains receive its +value. However, the two chains are entirely separate and Swift will prompt you +to ensure that both have `catch` handlers. + +You can most likely ignore the `catch` for one of these branches, but be careful: +in these situations, Swift cannot help you ensure that your chains are error-handled. + +``` +promise.then { + // branch A +}.catch { error in + //… +} + +_ = promise.then { + print("foo") + + // ignoring errors here as print cannot error and we handle errors above +} +``` + +It may be safer to recombine the two branches into a single chain again: + +``` +let p1 = promise.then { + // branch A +} + +let p2 = promise.then { + // branch B +} + +when(fulfilled: p1, p2).catch { error in + //… +} +``` + +> It's worth noting that you can add multiple `catch` handlers to a promise, too. +> And indeed, both will be called if the chain is rejected. + +## Is PromiseKit “heavy”? + +No. PromiseKit contains hardly any source code. In fact, it is quite lightweight. Any +“weight” relative to other promise implementations derives from 6 years of bug fixes +and tuning, from the fact that we have *stellar* Objective-C-to-Swift bridging and +from important things such as [Zalgo prevention](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) +that hobby-project implementations don’t consider. + +## Why is debugging hard? + +Because promises always execute via dispatch, the backtrace you see at the point of +an error has less information than is usually required to trace the path of execution. + +One solution is to turn off dispatch during debugging: + +```swift +// Swift +DispatchQueue.default = zalgo + +//ObjC +PMKSetDefaultDispatchQueue(zalgo) +``` + +Don’t leave this on. In normal use, we always dispatch to avoid you accidentally writing +a common bug pattern. See [this blog post](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). + +## Where is `all()`? + +Some promise libraries provide `all` for awaiting multiple results. We call this function +`when`, but it is the same thing. We chose `when` because it's the more common term and +because we think it reads better in code. + +## How can I test APIs that return promises? + +You need to use `XCTestExpectation`. + +We also define `wait()` and `hang()`. Use them if you must, but be careful because they +block the current thread! + +## Is PromiseKit thread-safe? + +Yes, entirely. + +However the code *you* write in your `then`s might not be! + +Just make sure you don’t access state outside the chain from concurrent queues. +By default, PromiseKit handlers run on the `main` thread, which is serial, so +you typically won't have to worry about this. + +## Why are there separate classes for Objective-C and Swift? + +`Promise` is generic and and so cannot be represented by Objective-C. + +## Does PromiseKit conform to Promises/A+? + +Yes. We have tests that prove this. + +## How do PromiseKit and RxSwift/ReactiveSwift differ? + +PromiseKit is a lot simpler. + +The top-level difference between PromiseKit and RxSwift is that RxSwift `Observable`s (roughly +analogous to PromiseKit `Promise`s) do not necessarily return a single result: they may emit +zero, one, or an infinite stream of values. This small conceptual change leads to an API +that's both surprisingly powerful and surprisingly complex. + +RxSwift requires commitment to a paradigm shift in how you program. It proposes that you +restructure your code as a matrix of interacting value pipelines. When applied properly +to a suitable problem, RxSwift can yield great benefits in robustness and simplicity. +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 +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) +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: + +* RxSwift has a separate API for chain-terminating elements ("subscribers") versus interior +elements. In PromiseKit, all elements of a chain use roughly the same code pattern. + +* The RxSwift API to define an interior element of a chain (an "operator") is hair-raisingly complex. +So, RxSwift tries hard to supply every operator you might ever want to use right off the shelf. There are +hundreds. PromiseKit supplies a few utilities to help with specific scenarios, but because it's trivial +to write your own chain elements, there's no need for all this extra code in the library. + +* PromiseKit dispatches the execution of every block. RxSwift dispatches only when told to do so. Moreover, the +current dispatching state is an attribute of the chain, not the specific block, as it is in PromiseKit. +The RxSwift system is more powerful but more complex. PromiseKit is simple, predictable and safe. + +* In PromiseKit, both sides of a branched chain refer back to their shared common ancestors. In RxSwift, +branching normally creates a duplicate parallel chain that reruns the code at the head of the chain...except +when it doesn't. The rules for determining what will actually happen are complex, and given +a chain created by another chunk of code, you can't really tell what the behavior will be. + +* Because RxSwift chains don't necessarily terminate on their own, RxSwift needs you to take on some +explicit garbage collection duties to ensure that pipelines that are no longer needed are properly +deallocated. All promises yield a single value, terminate and then automatically deallocate themselves. + +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? + +Swift demands that functions have one purpose. Thus, we have two error handlers: + +* `catch`: ends the chain and handles errors +* `recover`: attempts to recover from errors in a chain + +You want `recover`. + +## When do promises “start”? + +Often people are confused about when Promises “start”. Is it immediately? Is it +later? Is it when you call then? + +The answer is: promises do not choose when the underlying task they represent +starts. That is up to that task. For example here is the code for a simple +promise that wraps Alamofire: + + +```swift +func foo() -> Promise + return Promise { seal in + Alamofire.request(rq).responseJSON { rsp in + seal.resolve(rsp.value, rsp.error) + } + } +} +``` + +Who chooses when this promise starts? The answer is: Alamofire does, and in this +case, it “starts” immediately when `foo()` is called. + +## What is a good way to use Firebase with PromiseKit + +There is no good way to use Firebase with PromiseKit. See the next question for +a more detailed rationale. + +The best option is to embed your chain in your Firebase handler: + +``` +foo.observe(.value) { snapshot in + firstly { + bar(with: snapshot) + }.then { + baz() + }.then { + baffle() + }.catch { + //… + } +} +``` + + +## I need my `then` to fire multiple times + +Then we’re afraid you cannot use PromiseKit for that event. Promises only +resolve *once*. This is the fundamental nature of promises and it is considered a +feature because it gives you guarantees about the flow of your chains. + + +## How do I change the default queues that handlers run on? + +You can change the values of `PromiseKit.conf.Q`. There are two variables that +change the default queues that the two kinds of handler run on. A typical +pattern is to change all your `then`-type handlers to run on a background queue +and to have all your “finalizers” run on the main queue: + +``` +PromiseKit.conf.Q.map = .global() +PromiseKit.conf.Q.return = .main //NOTE this is the default +``` + +Be very careful about setting either of these queues to `nil`. It has the +effect of running *immediately*, and this is not what you usually want to do in +your application. This is, however, useful when you are running specs and want +your promises to resolve immediately. (This is basically the same idea as "stubbing" +an HTTP request.) + +```swift +// in your test suite setup code +PromiseKit.conf.Q.map = nil +PromiseKit.conf.Q.return = nil +``` + +## How do I use PromiseKit on the server side? + +If your server framework requires that the main queue remain unused (e.g., Kitura), +then you must use PromiseKit 6 and you must tell PromiseKit not to dispatch to the +main queue by default. This is easy enough: + +```swift +PromiseKit.conf.Q = (map: DispatchQueue.global(), return: DispatchQueue.global()) +``` + +> Note, we recommend using your own queue rather than `.global()`, we've seen better performance this way. + +Here’s a more complete example: + +```swift +import Foundation +import HeliumLogger +import Kitura +import LoggerAPI +import PromiseKit + +HeliumLogger.use(.info) + +let pmkQ = DispatchQueue(label: "pmkQ", qos: .default, attributes: .concurrent, autoreleaseFrequency: .workItem) +PromiseKit.conf.Q = (map: pmkQ, return: pmkQ) + +let router = Router() +router.get("/") { _, response, next in + Log.info("Request received") + after(seconds: 1.0).done { + Log.info("Sending response") + response.send("OK") + next() + } +} + +Log.info("Starting server") +Kitura.addHTTPServer(onPort: 8888, with: router) +Kitura.run() +``` + +## My question was not answered + +[Please open a ticket](https://github.com/mxcl/PromiseKit/issues/new). diff --git a/Carthage/Checkouts/PromiseKit/Documentation/GettingStarted.md b/Carthage/Checkouts/PromiseKit/Documentation/GettingStarted.md new file mode 100644 index 0000000..017736c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/GettingStarted.md @@ -0,0 +1,535 @@ +# `then` and `done` + +Here is a typical promise chain: + +```swift +firstly { + login() +}.then { creds in + fetch(avatar: creds.user) +}.done { image in + self.imageView = image +} +``` + +If this code used completion handlers, it would look like this: + +```swift +login { creds, error in + if let creds = creds { + fetch(avatar: creds.user) { image, error in + if let image = image { + self.imageView = image + } + } + } +} +``` + +`then` *is* just another way to structure completion handlers, but it is also quite a +bit more. At this initial stage of our understanding, it mostly helps +readability. The promise chain above is easy to scan and understand: one asynchronous +operation leads into the other, line by line. It's as close to +procedural code as we can easily come given the current state of Swift. + +`done` is the same as `then` but you cannot return a promise. It is +typically the end of the “success” part of the chain. Above, you can see that we +receive the final image in our `done` and use it to set up the UI. + +Let’s compare the signatures of the two login methods: + +```swift +func login() -> Promise + +// Compared with: + +func login(completion: (Creds?, Error?) -> Void) + // ^^ ugh. Optionals. Double optionals. +``` + +The distinction is that with promises, your functions return *promises* instead +of accepting and running callbacks. Each handler in a chain returns a promise. +`Promise` objects define the `then` method, which waits for the completion of the +promise before continuing the chain. Chains resolve procedurally, one promise +at a time. + +A `Promise` represents the future value of an asynchronous task. It has a type +that represents the type of object it wraps. For example, in the example above, +`login` is a function that returns a `Promise` that *will* represent an instance +of `Creds`. + +> *Note*: `done` is new to PromiseKit 5. We previously defined a variant of `then` that +did not require you to return a promise. Unfortunately, this convention often confused +Swift and led to odd and hard-to-debug error messages. It also made using PromiseKit +more painful. The introduction of `done` lets you type out promise chains that +compile without additional qualification to help the compiler figure out type information. + +--- + +You may notice that unlike the completion pattern, the promise chain appears to +ignore errors. This is not the case! In fact, it has the opposite effect: the promise +chain makes error handling more accessible and makes errors harder to ignore. + + +# `catch` + +With promises, errors cascade along the promise chain, ensuring that your apps are +robust and your code is clear: + +```swift +firstly { + login() +}.then { creds in + fetch(avatar: creds.user) +}.done { image in + self.imageView = image +}.catch { + // any errors in the whole chain land here +} +``` + +> Swift emits a warning if you forget to `catch` a chain. But we'll +> talk about that in more detail later. + +Each promise is an object that represents an individual, asychnronous task. +If a task fails, its promise becomes *rejected*. Chains that contain rejected +promises skip all subsequent `then`s. Instead, the next `catch` is executed. +(Strictly speaking, *all* subsequent `catch` handlers are executed.) + +For fun, let’s compare this pattern with its completion handler equivalent: + +```swift +func handle(error: Error) { + //… +} + +login { creds, error in + guard let creds = creds else { return handle(error: error!) } + fetch(avatar: creds.user) { image, error in + guard let image = image else { return handle(error: error!) } + self.imageView.image = image + } +} +``` + +The use of `guard` and a consolidated error handler help, but the promise chain’s +readability speaks for itself. + + +# `ensure` + +We have learned to compose asynchronicity. Next let’s extend our primitives: + +```swift +firstly { + UIApplication.shared.isNetworkActivityIndicatorVisible = true + return login() +}.then { + fetch(avatar: $0.user) +}.done { + self.imageView = $0 +}.ensure { + UIApplication.shared.isNetworkActivityIndicatorVisible = false +}.catch { + //… +} +``` + +No matter the outcome of your chain—-failure or success—-your `ensure` +handler is always called. + +Let’s compare this pattern with its completion handler equivalent: + +```swift +UIApplication.shared.isNetworkActivityIndicatorVisible = true + +func handle(error: Error) { + UIApplication.shared.isNetworkActivityIndicatorVisible = false + //… +} + +login { creds, error in + guard let creds = creds else { return handle(error: error!) } + fetch(avatar: creds.user) { image, error in + guard let image = image else { return handle(error: error!) } + self.imageView.image = image + UIApplication.shared.isNetworkActivityIndicatorVisible = false + } +} +``` + +It would be very easy for someone to amend this code and forget to unset +the activity indicator, leading to a bug. With promises, this type of error is +almost impossible: the Swift compiler resists your supplementing the chain without +using promises. You almost won’t need to review the pull requests. + +> *Note*: PromiseKit has perhaps capriciously switched between the names `always` +and `ensure` for this function several times in the past. Sorry about this. We suck. + +You can also use `finally` as an `ensure` that terminates the promise chain and does not return a value: + +``` +spinner(visible: true) + +firstly { + foo() +}.done { + //… +}.catch { + //… +}.finally { + self.spinner(visible: false) +} +``` + + +# `when` + +With completion handlers, reacting to multiple asynchronous operations is either +slow or hard. Slow means doing it serially: + +```swift +operation1 { result1 in + operation2 { result2 in + finish(result1, result2) + } +} +``` + +The fast (*parallel*) path code makes the code less clear: + +```swift +var result1: …! +var result2: …! +let group = DispatchGroup() +group.enter() +group.enter() +operation1 { + result1 = $0 + group.leave() +} +operation2 { + result2 = $0 + group.leave() +} +group.notify(queue: .main) { + finish(result1, result2) +} +``` + +Promises are easier: + +```swift +firstly { + when(fulfilled: operation1(), operation2()) +}.done { result1, result2 in + //… +} +``` + +`when` takes promises, waits for them to resolve and returns a promise containing the results. + +As with any promise chain, if any of the component promises fail, the chain calls the next `catch`. + + +# PromiseKit Extensions + +When we made PromiseKit, we understood that we wanted to use *only* promises to implement +asynchronous behavior. So wherever possible, we offer extensions to Apple’s APIs that reframe +the API in terms of promises. For example: + +```swift +firstly { + CLLocationManager.promise() +}.then { location in + CLGeocoder.reverseGeocode(location) +}.done { placemarks in + self.placemark.text = "\(placemarks.first)" +} +``` + +To use these extensions, you need to specify subspecs: + +```ruby +pod "PromiseKit" +pod "PromiseKit/CoreLocation" +pod "PromiseKit/MapKit" +``` + +All of these extensions are available at the [PromiseKit organization](https://github.com/PromiseKit). +Go there to see what's available and to read the source code and documentation. Every file and function +has been copiously documented. + +> We also provide extensions for common libraries such as [Alamofire](https://github.com/PromiseKit/Alamofire-). + + +# Making Promises + +The standard extensions will take you a long way, but sometimes you'll still need to start chains +of your own. Maybe you're using a third party API that doesn’t provide promises, or perhaps you wrote +your own asynchronous system. Either way, it's easy to add promises. If you look at the code of the +standard extensions, you'll see that it uses the same approach described below. + +Let’s say we have the following method: + +```swift +func fetch(completion: (String?, Error?) -> Void) +``` + +How do we convert this to a promise? Well, it's easy: + +```swift +func fetch() -> Promise { + return Promise { fetch(completion: $0.resolve) } +} +``` + +You may find the expanded version more readable: + +```swift +func fetch() -> Promise { + return Promise { seal in + fetch { result, error in + seal.resolve(result, error) + } + } +} +``` + +The `seal` object that the `Promise` initializer provides to you defines +many methods for handling garden-variety completion handlers. It even +covers a variety of rarer situations, thus making it easy for you to add +promises to an existing codebase. + +> *Note*: We tried to make it so that you could just do `Promise(fetch)`, but we +were not able to make this simpler pattern work universally without requiring +extra disambiguation for the Swift compiler. Sorry; we tried. + +> *Note*: In PMK 4, this initializer provided two parameters to your closure: +`fulfill` and `reject`. PMK 5 and 6 give you an object that has both `fulfill` and +`reject` methods, but also many variants of the method `resolve`. You can +typically just pass completion handler parameters to `resolve` and let Swift figure +out which variant to apply to your particular case (as shown in the example above). + +> *Note* `Guarantees` (below) have a slightly different initializer (since they +cannot error) so the parameter to the initializer closure is just a closure. Not +a `Resolver` object. Thus do `seal(value)` rather than `seal.fulfill(value)`. This +is because there is no variations in what guarantees can be sealed with, they can +*only* fulfill. + +# `Guarantee` + +Since PromiseKit 5, we have provided `Guarantee` as a supplementary class to +`Promise`. We do this to complement Swift’s strong error handling system. + +Guarantees *never* fail, so they cannot be rejected. A good example is `after`: + +``` +firstly { + after(seconds: 0.1) +}.done { + // there is no way to add a `catch` because after cannot fail. +} +``` + +Swift warns you if you don’t terminate a regular `Promise` chain (i.e., not +a `Guarantee` chain). You're expected to silence this warning by supplying +either a `catch` or a `return`. (In the latter case, you will then have to `catch` +at the point where you receive that promise.) + +Use `Guarantee`s wherever possible so that your code has error handling where +it's required and no error handling where it's not required. + +In general, you should be able to use `Guarantee`s and `Promise`s interchangeably, +We have gone to great lengths to try and ensure this, so please open a ticket +if you find an issue. + +--- + +If you are creating your own guarantees the syntax is simpler than that of promises; + +```swift +func fetch() -> Promise { + return Guarantee { seal in + fetch { result in + seal(result) + } + } +} +``` + +Which could be reduced to: + +```swift +func fetch() -> Promise { + return Guarantee(resolver: fetch) +} +``` + +# `map`, `compactMap`, etc. + +`then` provides you with the result of the previous promise and requires you to return +another promise. + +`map` provides you with the result of the previous promise and requires you to return +an object or value type. + +`compactMap` provides you with the result of the previous promise and requires you +to return an `Optional`. If you return `nil`, the chain fails with +`PMKError.compactMap`. + +> *Rationale*: Before PromiseKit 4, `then` handled all these cases, and it was +painful. We hoped the pain would disappear with new Swift versions. However, +it has become clear that the various pain points are here to stay. In fact, we +as library authors are expected to disambiguate at the naming level of our API. +Therefore, we have split the three main kinds of `then` into `then`, `map` and +`done`. After using these new functions, we realized this is much nicer in practice, +so we added `compactMap` as well (modeled on `Optional.compactMap`). + +`compactMap` facilitates quick composition of promise chains. For example: + +```swift +firstly { + URLSession.shared.dataTask(.promise, with: rq) +}.compactMap { + try JSONSerialization.jsonObject($0.data) as? [String] +}.done { arrayOfStrings in + //… +}.catch { error in + // Foundation.JSONError if JSON was badly formed + // PMKError.compactMap if JSON was of different type +} +``` + +> *Tip*: We also provide most of the functional methods you would expect for sequences, +e.g., `map`, `thenMap`, `compactMapValues`, `firstValue`, etc. + + +# `get` + +We provide `get` as a `done` that returns the value fed to `get`. + +```swift +firstly { + foo() +}.get { foo in + //… +}.done { foo in + // same foo! +} +``` + + +# `tap` + +We provide `tap` for debugging. It's the same as `get` but provides the +`Result` of the `Promise` so you can inspect the value of the chain at this +point without causing any side effects: + +```swift +firstly { + foo() +}.tap { + print($0) +}.done { + //… +}.catch { + //… +} +``` + + +# Supplement + +## `firstly` + +We've used `firstly` several times on this page, but what is it, really? In fact, +it is just [syntactic sugar](https://en.wikipedia.org/wiki/Syntactic_sugar). +You don’t really need it, but it helps to make your chains more readable. Instead of: + +```swift +firstly { + login() +}.then { creds in + //… +} +``` + +You could just do: + +```swift +login().then { creds in + //… +} +``` + +Here is a key understanding: `login()` returns a `Promise`, and all `Promise`s have a `then` function. `firstly` returns a `Promise`, and `then` returns a `Promise`, too! But don’t worry too much about these details. Learn the *patterns* to start with. Then, when you are ready to advance, learn the underlying architecture. + + +## `when` Variants + +`when` is one of PromiseKit’s more useful functions, and so we offer several variants. + +* The default `when`, and the one you should typically use, is `when(fulfilled:)`. This variant +waits on all its component promises, but if any fail, `when` fails too, and thus the chain *rejects*. +It's important to note that all promises in the `when` *continue*. Promises have *no* control over +the tasks they represent. Promises are just wrappers around tasks. + +* `when(resolved:)` waits even if one or more of its component promises fails. The value produced +by this variant of `when` is an array of `Result`. Consequently, this variant requires all its +component promises to have the same generic type. See our advanced patterns guide for work-arounds +for this limitation. + +* The `race` variant lets you *race* several promises. Whichever finishes first is the result. See the +advanced patterns guide for typical usage. + + +## Swift Closure Inference + +Swift automatically infers returns and return types for one-line closures. +The following two forms are the same: + +```swift +foo.then { + bar($0) +} + +// is the same as: + +foo.then { baz -> Promise in + return bar(baz) +} +``` + +Our documentation often omits the `return` for clarity. + +However, this shorthand is both a blessing and a curse. You may find that the Swift compiler +often fails to infer return types properly. See our [Troubleshooting Guide](Troubleshooting.md) if +you require further assistance. + +> By adding `done` to PromiseKit 5, we have managed to avoid many of these common +pain points in using PromiseKit and Swift. + + + +# Further Reading + +The above information is the 90% you will use. We **strongly** suggest reading the +[API Reference]. +There are numerous little +functions that may be useful to you, and the documentation for everything outlined above +is more thorough at the source. + +In Xcode, don’t forget to option-click on PromiseKit functions to access this +documentation while you're coding. + +Here are some recent articles that document PromiseKit 5+: + +* [Using Promises - Agostini.tech](https://agostini.tech/2018/10/08/using-promisekit) + +Careful with general online references, many of them refer to PMK < 5 which has a subtly +different API (sorry about that, but Swift has changed a lot over the years and thus +we had to too). + + +[API Reference]: https://promisekit.org/reference/ diff --git a/Carthage/Checkouts/PromiseKit/Documentation/Installation.md b/Carthage/Checkouts/PromiseKit/Documentation/Installation.md new file mode 100644 index 0000000..6d3b0bf --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/Installation.md @@ -0,0 +1,193 @@ +# Xcode 8.3, 9.x or 10.x / Swift 3 or 4 + +We recommend Carthage over CocoaPods, but both installation methods are supported. + +## CocoaPods + +```ruby +use_frameworks! + +target "Change Me!" do + pod "PromiseKit", "~> 6.0" +end +``` + +If the generated Xcode project gives you a warning that PromiseKit needs to be upgraded to +Swift 4.0 or Swift 4.2, then add the following: + +```ruby +post_install do |installer| + installer.pods_project.targets.each do |target| + if target.name == 'PromiseKit' + target.build_configurations.each do |config| + config.build_settings['SWIFT_VERSION'] = '4.2' + end + end + end +end +``` + +Adjust the value for `SWIFT_VERSION` as needed. + +CocoaPods are aware of this [issue](https://github.com/CocoaPods/CocoaPods/issues/7134). + +## Carthage + +```ruby +github "mxcl/PromiseKit" ~> 6.0 +``` + +## SwiftPM + +```ruby +package.dependencies.append( + .Package(url: "https://github.com/mxcl/PromiseKit", majorVersion: 6) +) +``` + +## Manually + +You can just drop `PromiseKit.xcodeproj` into your project and then add +`PromiseKit.framework` to your app’s embedded frameworks. + + +# PromiseKit vs. Xcode + +PromiseKit contains Swift, so there have been rev-lock issues with Xcode: + +| PromiseKit | Swift | Xcode | CI Status | Release Notes | +| ---------- | ----------------------- | -------- | ------------ | ----------------- | +| 6 | 3.1, 3.2, 3.3, 4.x | 8.3, 9.x, 10.x | ![ci-master] | [2018/02][news-6] | +| 5 | 3.1, 3.2, 3.3, 4.x | 8.3, 9.x | *Deprecated* | *n/a* | +| 4† | 3.0, 3.1, 3.2, 3.3, 4.x | 8.x, 9.x | ![ci-master] | [2016/09][news-4] | +| 3 | 2.x | 7.x, 8.0 | ![ci-swift2] | [2015/10][news-3] | +| 2 | 1.x | 7.x | *Deprecated* | [2015/10][news-3] | +| 1‡ | *N/A* | * | ![ci-legacy] | – | + +† Probably supports Xcode 10 and Swift 4.2, if not, PR welcome. + +‡ PromiseKit 1 is pure Objective-C and thus can be used with any Xcode, it is +also your only choice if you need to support iOS 7 or below. + +--- + +We also maintain a series of branches to aid migration for PromiseKit 2: + +| Xcode | Swift | PromiseKit | Branch | CI Status | +| ----- | ----- | -----------| --------------------------- | --------- | +| 8.0 | 2.3 | 2 | [swift-2.3-minimal-changes] | ![ci-23] | +| 7.3 | 2.2 | 2 | [swift-2.2-minimal-changes] | ![ci-22] | +| 7.2 | 2.2 | 2 | [swift-2.2-minimal-changes] | ![ci-22] | +| 7.1 | 2.1 | 2 | [swift-2.0-minimal-changes] | ![ci-20] | +| 7.0 | 2.0 | 2 | [swift-2.0-minimal-changes] | ![ci-20] | + +We do **not** usually backport fixes to these branches, but pull requests are welcome. + + +## Xcode 8 / Swift 2.3 or Xcode 7 + +```ruby +# CocoaPods +swift_version = "2.3" +pod "PromiseKit", "~> 3.5" + +# Carthage +github "mxcl/PromiseKit" ~> 3.5 +``` + + +[travis]: https://travis-ci.org/mxcl/PromiseKit +[ci-master]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=master +[ci-legacy]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=legacy-1.x +[ci-swift2]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.x +[ci-23]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.3-minimal-changes +[ci-22]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.2-minimal-changes +[ci-20]: https://travis-ci.org/mxcl/PromiseKit.svg?branch=swift-2.0-minimal-changes +[news-2]: http://promisekit.org/news/2015/05/PromiseKit-2.0-Released/ +[news-3]: https://github.com/mxcl/PromiseKit/blob/master/CHANGELOG.markdown#300-oct-1st-2015 +[news-4]: http://promisekit.org/news/2016/09/PromiseKit-4.0-Released/ +[news-6]: http://promisekit.org/news/2018/02/PromiseKit-6.0-Released/ +[swift-2.3-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.3-minimal-changes +[swift-2.2-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.2-minimal-changes +[swift-2.0-minimal-changes]: https://github.com/mxcl/PromiseKit/tree/swift-2.0-minimal-changes + + +# Using Git Submodules for PromiseKit’s Extensions + +> *Note*: This is a more advanced technique. + +If you use CocoaPods and a few PromiseKit extensions, then importing PromiseKit +causes that module to import all the extension frameworks. Thus, if you have an +app and a few app extensions (e.g., iOS app, iOS watch extension, iOS Today +extension) then all your final products that use PromiseKit will have forced +dependencies on all the Apple frameworks that PromiseKit provides extensions +for. + +This isn’t that bad, but every framework that loads entails overhead and +lengthens startup time. + +It’s both better and worse with Carthage. We build individual micro-frameworks +for each PromiseKit extension, so your final products link +against only the Apple frameworks that they actually need. However, Apple has +advised that apps link only against “about 12” frameworks for performance +reasons. So with Carthage, we are worse off on this metric. + +The solution is to instead import only CorePromise: + +```ruby +# CocoaPods +pod "PromiseKit/CorePromise" + +# Carthage +github "mxcl/PromiseKit" +# ^^ for Carthage *only* have this +``` + +And to use the extensions you need via `git submodules`: + +``` +git submodule init +git submodule add https://github.com/PromiseKit/UIKit Submodules/PMKUIKit +``` + +Then in Xcode you can add these sources to your targets on a per-target basis. + +Then when you `pod update`, ensure that you also update your submodules: + + pod update && git submodule update --recursive --remote + + + +# Release History + +## [6.0](https://github.com/mxcl/PromiseKit/releases/tag/6.0.0) Feb 13th, 2018 + +* [PromiseKit 6 announcement post][news-6]. + +## [4.0](https://github.com/mxcl/PromiseKit/releases/tag/4.0.0) + +* [PromiseKit 4 announcement post][news-4]. + +## [3.0](https://github.com/mxcl/PromiseKit/releases/tag/3.0.0) Oct 1st, 2015 + +In Swift 2.0 `catch` and `defer` became reserved keywords mandating we rename +our functions with these names. This forced a major semantic version change on +PromiseKit and thus we took the opportunity to make other minor (source +compatibility breaking) improvements. + +Thus if you cannot afford to adapt to PromiseKit 3 but still want to use +Xcode-7.0/Swift-2.0 we provide a [minimal changes branch] where `catch` and +`defer` are renamed `catch_` and `defer_` and all other changes are the bare +minimum to make PromiseKit 2 compile against Swift 2. + +If you still are using Xcode 6 and Swift 1.2 then use PromiseKit 2. + +[minimal changes branch]: https://github.com/mxcl/PromiseKit/tree/swift-2.0-minimal-changes + +## [2.0](https://github.com/mxcl/PromiseKit/releases/tag/2.0.0) May 14th, 2015 + +[PromiseKit 2 announcement post](http://promisekit.org/news/2015/05/PromiseKit-2.0-Released/). + +## [1.5](https://github.com/mxcl/PromiseKit/releases/tag/1.5.0) + +Swift 1.2 support. Xcode 6.3 required. diff --git a/Carthage/Checkouts/PromiseKit/Documentation/ObjectiveC.md b/Carthage/Checkouts/PromiseKit/Documentation/ObjectiveC.md new file mode 100644 index 0000000..bbc8aa1 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/ObjectiveC.md @@ -0,0 +1,201 @@ +# Objective-C + +PromiseKit has two promise classes: + +* `Promise` (Swift) +* `AnyPromise` (Objective-C) + +Each is designed to be an appropriate promise implementation for the strong points of its language: + +* `Promise` is strict, defined and precise. +* `AnyPromise` is loose and dynamic. + +Unlike most libraries, we have extensive bridging support, you can use PromiseKit +in mixed projects with mixed language targets and mixed language libraries. + + +# Using PromiseKit with Objective-C + +`AnyPromise` is our promise class for Objective-C. It behaves almost identically to `Promise`, our Swift promise class. + +```objc +myPromise.then(^(NSString *bar){ + return anotherPromise; +}).then(^{ + //… +}).catch(^(NSError *error){ + //… +}); +``` + +You make new promises using `promiseWithResolverBlock`: + +```objc +- (AnyPromise *)myPromise { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve){ + resolve(foo); // if foo is an NSError, rejects, else, resolves + }]; +} +``` + +--- + +You reject promises by throwing errors: + +```objc +myPromise.then(^{ + @throw [NSError errorWithDomain:domain code:code userInfo:nil]; +}).catch(^(NSError *error){ + //… +}); +``` +#### :warning: Caution: +ARC in Objective-C, unlike in Objective-C++, is not exception-safe by default. +So, throwing an error will result in keeping a strong reference to the closure +that contains the throw statement. +This pattern will consequently result in memory leaks if you're not careful. + +> *Note:* Only having a strong reference to the closure would result in memory leaks. +> In our case, PromisKit automatically keeps a strong reference to the closure until it's released. + +__Workarounds:__ +1. Return a Promise with value NSError\ +Instead of throwing a normal error, you can return a Promise with value NSError instead. + +```objc +myPromise.then(^{ + return [AnyPromise promiseWithValue:[NSError myCustomError]]; +}).catch(^(NSError *error){ + if ([error isEqual:[NSError myCustomError]]) { + // In case, same error as the one we thrown + return; + } + //… +}); +``` +2. Enable ARC for exceptions in Objective-C (not recomended)\ +You can add this ```-fobjc-arc-exceptions to your``` to your compiler flags to enable ARC for exceptions. +This is not recommended unless you've read the Apple documentation and are comfortable with the caveats. + +For more details on ARC and exceptions: +https://clang.llvm.org/docs/AutomaticReferenceCounting.html#exceptions + + +--- + +One important feature is the syntactic flexability of your handlers: + +```objc +myPromise.then(^{ + // no parameters is fine +}); + +myPromise.then(^(id foo){ + // one parameter is fine +}); + +myPromise.then(^(id a, id b, id c){ + // up to three parameter is fine, no crash! +}); + +myPromise.then(^{ + return @1; // return anything or nothing, it's fine, no crash +}); +``` + +We do runtime inspection of the block you pass to achieve this magic. + +--- + +Another important distinction is that the equivalent function to Swift’s `recover` is combined with `AnyPromise`’s `catch`. This is typical to other “dynamic” promise implementations and thus achieves our goal that `AnyPromise` is loose and dynamic while `Promise` is strict and specific. + +A sometimes unexpected consequence of this fact is that returning nothing from a `catch` *resolves* the returned promise: + +```objc +myPromise.catch(^{ + [UIAlertView …]; +}).then(^{ + // always executes! +}); +``` + +--- + +Another important distinction is that the `value` property returns even if the promise is rejected; in that case, it returns the `NSError` object with which the promise was rejected. + + +# Bridging Between Objective-C & Swift + +Let’s say you have: + +```objc +@interface Foo +- (AnyPromise *)myPromise; +@end +``` + +Ensure that this interface is included in your bridging header. You can now use the +following pattern in your Swift code: + +```swift +let foo = Foo() +foo.myPromise.then { (obj: AnyObject?) -> Int in + // it is not necessary to specify the type of `obj` + // we just do that for demonstrative purposes +} +``` + +--- + +Let’s say you have: + +```swift +@objc class Foo: NSObject { + func stringPromise() -> Promise + func barPromise() -> Promise +} + +@objc class Bar: NSObject { /*…*/ } +``` + +Ensure that your project is generating a `…-Swift.h` header so that Objective-C can see your Swift code. + +If you built this project and opened the `…-Swift.h` header, you would only see this: + +```objc +@interface Foo +@end + +@interface Bar +@end +``` + +That's because Objective-C cannot import Swift objects that are generic. So we need to write some stubs: + +```swift +@objc class Foo: NSObject { + @objc func stringPromise() -> AnyPromise { + return AnyPromise(stringPromise()) + } + @objc func barPromise() -> AnyPromise { + return AnyPromise(barPromise()) + } +} +``` + +If we built this and opened our generated header, we would now see: + +```objc +@interface Foo +- (AnyPromise *)stringPromise; +- (AnyPromise *)barPromise; +@end + +@interface Bar +@end +``` + +Perfect. + +Note that AnyPromise can only bridge objects that conform to `AnyObject` or derive from `NSObject`. This is a limitation of Objective-C. + diff --git a/Carthage/Checkouts/PromiseKit/Documentation/README.md b/Carthage/Checkouts/PromiseKit/Documentation/README.md new file mode 100644 index 0000000..157bd8b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/README.md @@ -0,0 +1,13 @@ +# Contents + +* [README](/README.md) +* Handbook + * [Getting Started](GettingStarted.md) + * [Promises: Common Patterns](CommonPatterns.md) + * [Frequently Asked Questions](FAQ.md) +* Manual + * [Installation Guide](Installation.md) + * [Objective-C Guide](ObjectiveC.md) + * [Troubleshooting](Troubleshooting.md) + * [Appendix](Appendix.md) +* [API Reference](https://promisekit.org/reference/) diff --git a/Carthage/Checkouts/PromiseKit/Documentation/Troubleshooting.md b/Carthage/Checkouts/PromiseKit/Documentation/Troubleshooting.md new file mode 100644 index 0000000..c46b6b0 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Documentation/Troubleshooting.md @@ -0,0 +1,260 @@ +# Troubleshooting + +## Compilation errors + +99% of compilation issues involving PromiseKit can be addressed or diagnosed by one of the fixes below. + +### Check your handler + +```swift +return firstly { + URLSession.shared.dataTask(.promise, with: url) +}.compactMap { + JSONSerialization.jsonObject(with: $0.data) as? [String: Any] +}.then { dict in + User(dict: dict) +} +``` + +Swift (unhelpfully) says: + +> Cannot convert value of type '([String : Any]) -> User' to expected argument type '([String : Any]) -> _' + +What’s the real problem? `then` *must* return a `Promise`, and you're trying to return something else. What you really want is `map`: + +```swift +return firstly { + URLSession.shared.dataTask(.promise, with: url) +}.compactMap { + JSONSerialization.jsonObject(with: $0.data) as? [String: Any] +}.map { dict in + User(dict: dict) +} +``` + +### Specify closure parameters **and** return type + +For example: + +```swift +return firstly { + foo() +}.then { user in + //… + return bar() +} +``` + +This code may compile if you specify the type of `user`: + + +```swift +return firstly { + foo() +}.then { (user: User) in + //… + return bar() +} +``` + +If it still doesn't compile, perhaps you need to specify the return type, too: + +```swift +return firstly { + foo() +}.then { (user: User) -> Promise in + //… + return bar() +} +``` + +We have made great effort to reduce the need for explicit typing in PromiseKit 6, +but as with all Swift functions that return a generic type (e.g., `Array.map`), +you may need to explicitly tell Swift what a closure returns if the closure's body is +longer than one line. + +> *Tip*: Sometimes you can force a one-liner by using semicolons. + + +### Acknowledge all incoming closure parameters + +Swift does not permit you to silently ignore a closure's parameters. For example, this code: + +```swift +func _() -> Promise { + return firstly { + proc.launch(.promise) // proc: Foundation.Process + }.then { + when(fulfilled: p1, p2) // both p1 & p2 are `Promise` + } +} +``` + +Fails to compile with the error: + + Cannot invoke 'then' with an argument list of type '(() -> _) + +What's the problem? Well, `Process.launch(.promise)` returns +`Promise<(String, String)>`, and we are ignoring this value in our `then` closure. +If we’d referenced `$0` or named the parameter, Swift would have been satisfied. + +Assuming that we really do want to ignore the argument, the fix is to explicitly +acknowledge its existence by assigning it the name "_". That's Swift-ese for "I +know there's a value here, but I'm ignoring it." + + +```swift +func _() -> Promise { + return firstly { + proc.launch(.promise) + }.then { _ in + when(fulfilled: p1, p2) + } +} +``` + +In this situation, you won't always receive an error message that's as clear as the +one shown above. Sometimes, a missing closure parameter sends Swift scurrying off +into type inference limbo. When it finally concludes that there's no way for it to make +all the inferred types work together, it may end up assigning blame to some other +closure entirely and giving you an error message that makes no sense at all. + +When faced with this kind of enigmatic complaint, a good rule of thumb is to +double-check your argument and return types carefully. If everything looks OK, +temporarily add explicit type information as shown above, just to rule +out mis-inference as a possible cause. + +### Try moving code to a temporary inline function + +Try taking the code out of a closure and putting it in a standalone function. Now Swift +will give you the *real* error message. For example: + +```swift +func doStuff() { + firstly { + foo() + }.then { + let bar = bar() + let baz = baz() + when(fulfilled: bar, baz) + } +} +``` + +Becomes: + +```swift +func doStuff() { + func fluff() -> Promise<…> { + let bar = bar() + let baz = baz() + when(fulfilled: bar, baz) + } + + firstly { + foo() + }.then { + fluff() + } +} +``` + +An *inline* function like this is all you need. Here, the problem is that you +forgot to mark the last line of the closure with an explicit `return`. It's required +here because the closure is longer than one line. + + +## You copied code off the Internet that doesn’t work + +Swift has changed a lot over the years and so PromiseKit has had to change to keep +up. The code you copied is probably for an older PromiseKit. *Read the definitions of the +functions.* It's easy to do this in Xcode by option-clicking or command-clicking function names. +All PromiseKit functions are documented and provide examples. + +## "Context type for closure argument expects 1 argument, which cannot be implicitly ignored" + +You have a `then`; you want a `done`. + +## "Missing argument for parameter #1 in call" + +This is part of Swift 4’s “tuplegate”. + +You must specify your `Void` parameter: + +```swift +seal.fulfill(()) +``` + +Yes: we hope they revert this change in Swift 5 too. + +## Other issues + +### `Pending Promise Deallocated!` + +If you see this warning, you have a path in your `Promise` initializer that allows +the promise to escape without being sealed: + +```swift +Promise { seal in + task { value, error in + if let value = value as? String { + seal.fulfill(value) + } else if let error = error { + seal.reject(error) + } + } +} +``` + +There are two missing paths here, and if either occurs, the promise will soon be +deallocated without resolving. This will manifest itself as a bug in your app, +probably the awful infinite spinner. + +So let’s be thorough: + +```swift +Promise { seal in + task { value, error in + if let value = value as? String { + fulfill(value) + } else if let error = error { + reject(error) + } else if value != nil { + reject(MyError.valueNotString) + } else { + // should never happen, but we have an `PMKError` for task being called with `nil`, `nil` + reject(PMKError.invalidCallingConvention) + } + } +} +``` + +If this seems tedious, it shouldn’t. You would have to be this thorough without promises, too. +The difference is that without promises, you wouldn’t get a warning in the console notifying +you of your mistake! + +### Slow compilation / compiler cannot solve in reasonable time + +Add return types to your closures. + +### My promise never resolves + +Check to be sure that your asynchronous task even *starts*. You’d be surprised how +often this is the cause. + +For example, if you are using `URLSession` without our extension (but +don’t do that; *use* our extension! we know all the pitfalls), did you forget +to call `resume` on the task? If so, the task never actually starts, and so of +course it never finishes, either. + +### `Result of call to 'done(on:_:)' is unused`, `Result of call to 'then(on:_:)' is unused` + +PromiseKit deliberately avoids the `@discardableResult` annotation because the +unused result warning is a hint that you have not handled the error in your +chain. So do one of these: + +1. Add a `catch` +2. `return` the promise (thus punting the error handling to the caller) +3. Use `cauterize()` to silence the warning. + +Obviously, do 1 or 2 in preference to 3. diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/.gitignore new file mode 100644 index 0000000..30f5004 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/.travis.yml new file mode 100644 index 0000000..73728f8 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/.travis.yml @@ -0,0 +1,25 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.4, env: 'SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode10, env: 'SWFT=3.4 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.4, env: 'SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode10, env: 'SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform iOS --verbose +install: + - xcodebuild -scheme PMKAVFoundation -target PMKAVFoundation -quiet -destination "$DST" build SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKAVFoundation -target PMKAVTests -quiet -destination "$DST" build; + fi +script: + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKAVFoundation -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7422b27 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.pbxproj @@ -0,0 +1,453 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63C7FFF71D5C020D003BAE60 /* PMKAVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKAVFoundation.framework */; }; + 63DD7EF81D7E7411000F279D /* TestAVFoundation.m in Sources */ = {isa = PBXBuildFile; fileRef = 63DD7EF61D7E7411000F279D /* TestAVFoundation.m */; }; + 63DD7EF91D7E7411000F279D /* TestAVFoundation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63DD7EF71D7E7411000F279D /* TestAVFoundation.swift */; }; + 63DD7EFD1D7E7419000F279D /* AVAudioSession+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 63DD7EFA1D7E7419000F279D /* AVAudioSession+AnyPromise.h */; }; + 63DD7EFE1D7E7419000F279D /* AVAudioSession+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63DD7EFB1D7E7419000F279D /* AVAudioSession+AnyPromise.m */; }; + 63DD7EFF1D7E7419000F279D /* AVAudioSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63DD7EFC1D7E7419000F279D /* AVAudioSession+Promise.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKFoundation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63167B891D5C23B4007A96B0 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63BF28101D5C257100F62C66 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKAVFoundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKAVFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKAVTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKAVTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63DD7EF61D7E7411000F279D /* TestAVFoundation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestAVFoundation.m; path = Tests/TestAVFoundation.m; sourceTree = SOURCE_ROOT; }; + 63DD7EF71D7E7411000F279D /* TestAVFoundation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestAVFoundation.swift; path = Tests/TestAVFoundation.swift; sourceTree = SOURCE_ROOT; }; + 63DD7EFA1D7E7419000F279D /* AVAudioSession+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AVAudioSession+AnyPromise.h"; path = "Sources/AVAudioSession+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 63DD7EFB1D7E7419000F279D /* AVAudioSession+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "AVAudioSession+AnyPromise.m"; path = "Sources/AVAudioSession+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63DD7EFC1D7E7419000F279D /* AVAudioSession+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "AVAudioSession+Promise.swift"; path = "Sources/AVAudioSession+Promise.swift"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKAVFoundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63167B891D5C23B4007A96B0 /* Cartfile */, + 63BF28101D5C257100F62C66 /* Carthage.xcconfig */, + 63C700091D5C0253003BAE60 /* Info.plist */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKAVFoundation.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKAVTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63DD7EFA1D7E7419000F279D /* AVAudioSession+AnyPromise.h */, + 63DD7EFB1D7E7419000F279D /* AVAudioSession+AnyPromise.m */, + 63DD7EFC1D7E7419000F279D /* AVAudioSession+Promise.swift */, + ); + path = Sources; + sourceTree = ""; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63DD7EF61D7E7411000F279D /* TestAVFoundation.m */, + 63DD7EF71D7E7411000F279D /* TestAVFoundation.swift */, + ); + path = Tests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 63DD7EFD1D7E7419000F279D /* AVAudioSession+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKAVFoundation */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAVFoundation" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKAVFoundation; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKAVFoundation.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKAVTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKAVTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 638F9B161D5EEEDC00717B37 /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKAVTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKAVTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAVFoundation" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKAVFoundation */, + 63C7FFF11D5C020D003BAE60 /* PMKAVTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 638F9B161D5EEEDC00717B37 /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63DD7EFF1D7E7419000F279D /* AVAudioSession+Promise.swift in Sources */, + 63DD7EFE1D7E7419000F279D /* AVAudioSession+AnyPromise.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63DD7EF81D7E7411000F279D /* TestAVFoundation.m in Sources */, + 63DD7EF91D7E7411000F279D /* TestAVFoundation.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKAVFoundation */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63BF28101D5C257100F62C66 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63BF28101D5C257100F62C66 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Accounts; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Accounts; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAVFoundation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAVFoundation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKAVTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ecdffae --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/xcshareddata/xcschemes/PMKAVFoundation.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/xcshareddata/xcschemes/PMKAVFoundation.xcscheme new file mode 100644 index 0000000..42cebb2 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/PMKAVFoundation.xcodeproj/xcshareddata/xcschemes/PMKAVFoundation.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/README.markdown new file mode 100644 index 0000000..35c2f00 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit AVFoundation Extensions ![Build Status] + +This project adds promises to Apple’s AVFoundation framework. + +## CococaPods + +```ruby +pod "PromiseKit/AVFoundation" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/AVFoundation" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKAVFoundation +``` + +```objc +// objc +@import PromiseKit; +@import PMKAVFoundation; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/AVFoundation.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+AnyPromise.h new file mode 100644 index 0000000..54a9536 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+AnyPromise.h @@ -0,0 +1,30 @@ +// +// AVFoundation+AnyPromise.h +// +// Created by Matthew Loseke on 6/21/14. +// + +#import +#import + +/** + To import the `AVAudioSession` category: + + use_frameworks! + pod "PromiseKit/AVFoundation" + + And then in your sources: + + #import +*/ +@interface AVAudioSession (PromiseKit) + +/** + Wraps `-requestRecordPermission:`, thens the `BOOL granted` parameter + passed to the wrapped completion block. This promise cannot fail. + + @see requestRecordPermission: +*/ +- (AnyPromise *)requestRecordPermission; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+AnyPromise.m new file mode 100644 index 0000000..3de824c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+AnyPromise.m @@ -0,0 +1,21 @@ +// +// AVAudioSession+PromiseKit.m +// +// Created by Matthew Loseke on 6/21/14. +// + +#import "AVAudioSession+AnyPromise.h" +#import + + +@implementation AVAudioSession (PromiseKit) + +- (AnyPromise *)requestRecordPermission { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { + resolve(@(granted)); + }]; + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+Promise.swift new file mode 100644 index 0000000..742176b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Sources/AVAudioSession+Promise.swift @@ -0,0 +1,21 @@ +import AVFoundation +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `AVAudioSession` category: + + use_frameworks! + pod "PromiseKit/AVFoundation" + + And then in your sources: + + import PromiseKit +*/ +extension AVAudioSession { + public func requestRecordPermission() -> Guarantee { + return Guarantee(resolver: requestRecordPermission) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Tests/TestAVFoundation.m b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Tests/TestAVFoundation.m new file mode 100644 index 0000000..19eae79 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Tests/TestAVFoundation.m @@ -0,0 +1,17 @@ +#import "AVAudioSession+AnyPromise.h" +@import AVFoundation; +@import XCTest; + +@implementation Test_AVAudioSession_ObjC: XCTestCase + +- (void)test { + id ex = [self expectationWithDescription:@""]; + + [[AVAudioSession new] requestRecordPermission].then(^{ + [ex fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Tests/TestAVFoundation.swift b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Tests/TestAVFoundation.swift new file mode 100644 index 0000000..0d777b3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AVFoundation/Tests/TestAVFoundation.swift @@ -0,0 +1,24 @@ +import PMKAVFoundation +import AVFoundation +import PromiseKit +import XCTest + +class Test_AVAudioSession_Swift: XCTestCase { + func test() { + let ex = expectation(description: "") + + AVAudioSession().requestRecordPermission().done { _ in + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + + func testNotAmbiguous() { + let ex = expectation(description: "") + AVAudioSession().requestRecordPermission { _ in + ex.fulfill() + } + waitForExpectations(timeout: 1) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/.travis.yml new file mode 100644 index 0000000..c79cb1a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/.travis.yml @@ -0,0 +1,38 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'SWFT=3.1 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode8.3, env: 'SWFT=3.1 PLAT=iOS DST="OS=10.3.1,name=iPhone SE"'} + + - {osx_image: xcode9.2, env: 'SWFT=3.2 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode9.2, env: 'SWFT=3.2 PLAT=iOS DST="OS=11.2,name=iPhone SE"'} + + - {osx_image: xcode9.4, env: 'SWFT=3.3 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode9.4, env: 'SWFT=3.3 PLAT=iOS DST="OS=11.4,name=iPhone 5s"'} + + - {osx_image: xcode10, env: 'SWFT=3.4 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode10, env: 'SWFT=3.4 PLAT=iOS DST="OS=12.0,name=iPhone SE"'} + + - {osx_image: xcode9.2, env: 'SWFT=4.0 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode9.2, env: 'SWFT=4.0 PLAT=iOS DST="OS=11.2,name=iPhone SE"'} + + - {osx_image: xcode9.4, env: 'SWFT=4.1 PLAT=macOS DST="arch=x86_64" TEST=1'} + - {osx_image: xcode9.4, env: 'SWFT=4.1 PLAT=iOS DST="OS=11.4,name=iPhone 5s" TEST=1'} + + - {osx_image: xcode10, env: 'SWFT=4.2 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode10, env: 'SWFT=4.2 PLAT=iOS DST="OS=12.0,name=iPhone SE"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKAccounts -target PMKAccounts -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKAccounts -target PMKACTests -quiet -destination "$DST" build; + fi +script: + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKAccounts -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4910c7f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.pbxproj @@ -0,0 +1,447 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63167B841D5C2332007A96B0 /* ACAccountStore+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 63167B811D5C2332007A96B0 /* ACAccountStore+AnyPromise.h */; }; + 63167B851D5C2332007A96B0 /* ACAccountStore+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63167B821D5C2332007A96B0 /* ACAccountStore+AnyPromise.m */; }; + 63167B861D5C2332007A96B0 /* ACAccountStore+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63167B831D5C2332007A96B0 /* ACAccountStore+Promise.swift */; }; + 63167B881D5C233C007A96B0 /* TestAccounts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63167B871D5C233C007A96B0 /* TestAccounts.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKAccounts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKAccounts.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKFoundation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63167B811D5C2332007A96B0 /* ACAccountStore+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "ACAccountStore+AnyPromise.h"; path = "Sources/ACAccountStore+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 63167B821D5C2332007A96B0 /* ACAccountStore+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "ACAccountStore+AnyPromise.m"; path = "Sources/ACAccountStore+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63167B831D5C2332007A96B0 /* ACAccountStore+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "ACAccountStore+Promise.swift"; path = "Sources/ACAccountStore+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63167B871D5C233C007A96B0 /* TestAccounts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestAccounts.swift; path = Tests/TestAccounts.swift; sourceTree = SOURCE_ROOT; }; + 63167B891D5C23B4007A96B0 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63BF28101D5C257100F62C66 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKAccounts.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKAccounts.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKACTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKACTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKAccounts.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63167B891D5C23B4007A96B0 /* Cartfile */, + 63BF28101D5C257100F62C66 /* Carthage.xcconfig */, + 63C700091D5C0253003BAE60 /* Info.plist */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKAccounts.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKACTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63167B811D5C2332007A96B0 /* ACAccountStore+AnyPromise.h */, + 63167B821D5C2332007A96B0 /* ACAccountStore+AnyPromise.m */, + 63167B831D5C2332007A96B0 /* ACAccountStore+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63167B871D5C233C007A96B0 /* TestAccounts.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 63167B841D5C2332007A96B0 /* ACAccountStore+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKAccounts */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAccounts" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKAccounts; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKAccounts.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKACTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKACTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 638F9B161D5EEEDC00717B37 /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKACTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKACTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 1000; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 1000; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAccounts" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKAccounts */, + 63C7FFF11D5C020D003BAE60 /* PMKACTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 638F9B161D5EEEDC00717B37 /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63167B851D5C2332007A96B0 /* ACAccountStore+AnyPromise.m in Sources */, + 63167B861D5C2332007A96B0 /* ACAccountStore+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63167B881D5C233C007A96B0 /* TestAccounts.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKAccounts */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63BF28101D5C257100F62C66 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63BF28101D5C257100F62C66 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Accounts; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Accounts; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAccounts" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAccounts" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKACTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/xcshareddata/xcschemes/PMKAccounts.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/xcshareddata/xcschemes/PMKAccounts.xcscheme new file mode 100644 index 0000000..0a532d8 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/PMKAccounts.xcodeproj/xcshareddata/xcschemes/PMKAccounts.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/README.markdown new file mode 100644 index 0000000..af9bcde --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit Accounts Extensions ![Build Status] + +This project adds promises to Apple’s Accounts framework. + +## CococaPods + +```ruby +pod "PromiseKit/Accounts" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/Accounts" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKAccounts +``` + +```objc +// objc +@import PromiseKit; +@import PMKAccounts; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/Accounts.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+AnyPromise.h new file mode 100644 index 0000000..b7353ae --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+AnyPromise.h @@ -0,0 +1,66 @@ +// +// Created by merowing on 09/05/2014. +// +// +// + +#import +#import + +/** + To import the `ACAccountStore` category: + + use_frameworks! + pod "PromiseKit/Accounts" + + And then in your sources: + + @import PromiseKit; +*/ +@interface ACAccountStore (PromiseKit) + +/** + Obtains permission to access protected user properties. + + @param type The account type. + + @param options Can be nil. + + @return A promise that resolves when the requested permissions have been + successfully obtained. The promise thens all accounts of the specified + type. + + @see requestAccessToAccountsWithType:options:completion: +*/ +- (AnyPromise *)requestAccessToAccountsWithType:(ACAccountType *)type options:(NSDictionary *)options NS_REFINED_FOR_SWIFT; + +/** + Renews account credentials when the credentials are no longer valid. + + @param account The account to renew credentials. + + @return A promise that thens the `ACAccountCredentialRenewResult`. +*/ +- (AnyPromise *)renewCredentialsForAccount:(ACAccount *)account NS_REFINED_FOR_SWIFT; + +/** + Saves an account to the Accounts database. + + @param account The account to save. + + @return A promise that resolves when the account has been successfully + saved. +*/ +- (AnyPromise *)saveAccount:(ACAccount *)account NS_REFINED_FOR_SWIFT; + +/** + Removes an account from the account store. + + @param account The account to remove. + + @return A promise that resolves when the account has been successfully + removed. +*/ +- (AnyPromise *)removeAccount:(ACAccount *)account NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+AnyPromise.m new file mode 100644 index 0000000..30f987a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+AnyPromise.m @@ -0,0 +1,48 @@ +#import "ACAccountStore+AnyPromise.h" +#import + + +@implementation ACAccountStore (PromiseKit) + +- (AnyPromise *)requestAccessToAccountsWithType:(ACAccountType *)type options:(NSDictionary *)options { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self requestAccessToAccountsWithType:type options:options completion:^(BOOL granted, NSError *error) { + if (granted) { + resolve([self accountsWithAccountType:type]); + } else if (error) { + resolve(error); + } else { + error = [NSError errorWithDomain:PMKErrorDomain code:PMKAccessDeniedError userInfo:@{ + NSLocalizedDescriptionKey: @"Access to the requested social service has been denied. Please enable access in your device settings." + }]; + resolve(error); + } + }]; + }]; +} + +- (AnyPromise *)renewCredentialsForAccount:(ACAccount *)account { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self renewCredentialsForAccount:account completion:^(ACAccountCredentialRenewResult renewResult, NSError *error) { + resolve(error ?: @(renewResult)); + }]; + }]; +} + +- (AnyPromise *)saveAccount:(ACAccount *)account { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self saveAccount:account withCompletionHandler:^(BOOL success, NSError *error) { + resolve(error); + }]; + }]; +} + +- (AnyPromise *)removeAccount:(ACAccount *)account { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self removeAccount:account withCompletionHandler:^(BOOL success, NSError *error) { + resolve(error); + }]; + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+Promise.swift new file mode 100644 index 0000000..1789f84 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Sources/ACAccountStore+Promise.swift @@ -0,0 +1,59 @@ +import Accounts +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `ACAccountStore` category: + + use_frameworks! + pod "PromiseKit/ACAccountStore" + + And then in your sources: + + import PromiseKit +*/ +extension ACAccountStore { + /// Renews account credentials when the credentials are no longer valid. + public func renewCredentials(for account: ACAccount) -> Promise { + return Promise { renewCredentials(for: account, completion: $0.resolve) } + } + + /// Obtains permission to access protected user properties. + public func requestAccessToAccounts(with type: ACAccountType, options: [AnyHashable: Any]? = nil) -> Promise { + return Promise { seal in + requestAccessToAccounts(with: type, options: options, completion: { granted, error in + if granted { + seal.fulfill(()) + } else if let error = error { + seal.reject(error) + } else { + seal.reject(PMKError.accessDenied) + } + }) + } + } + + /// Saves an account to the Accounts database. + public func saveAccount(_ account: ACAccount) -> Promise { + return Promise { saveAccount(account, withCompletionHandler: $0.resolve) }.asVoid() + } + + /// Removes an account from the account store. + public func removeAccount(_ account: ACAccount) -> Promise { + return Promise { removeAccount(account, withCompletionHandler: $0.resolve) }.asVoid() + } + + /// PromiseKit ACAccountStore errors + public enum PMKError: Error, CustomStringConvertible { + /// The request for accounts access was denied. + case accessDenied + + public var description: String { + switch self { + case .accessDenied: + return "Access to the requested social service has been denied. Please enable access in your device settings." + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Tests/TestAccounts.swift b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Tests/TestAccounts.swift new file mode 100644 index 0000000..5a6591e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Accounts/Tests/TestAccounts.swift @@ -0,0 +1,80 @@ +import PMKAccounts +import PromiseKit +import Accounts +import XCTest + +class Test_ACAccountStore_Swift: XCTestCase { + var dummy: ACAccount { return ACAccount() } + + func test_renewCredentialsForAccount() { + let ex = expectation(description: "") + + class MockAccountStore: ACAccountStore { + override func renewCredentials(for account: ACAccount!, completion: ACAccountStoreCredentialRenewalHandler!) { + completion(.renewed, nil) + } + } + + MockAccountStore().renewCredentials(for: dummy).done { result in + XCTAssertEqual(result, ACAccountCredentialRenewResult.renewed) + ex.fulfill() + }.catch { + XCTFail("\($0)") + } + + waitForExpectations(timeout: 1) + } + + func test_requestAccessToAccountsWithType() { + class MockAccountStore: ACAccountStore { + override func requestAccessToAccounts(with accountType: ACAccountType!, options: [AnyHashable : Any]! = [:], completion: ACAccountStoreRequestAccessCompletionHandler!) { + completion(true, nil) + } + } + + let ex = expectation(description: "") + let store = MockAccountStore() + let type = store.accountType(withAccountTypeIdentifier: ACAccountTypeIdentifierFacebook)! + store.requestAccessToAccounts(with: type).done { _ in + ex.fulfill() + }.catch { + XCTFail("\($0)") + } + + waitForExpectations(timeout: 1) + } + + func test_saveAccount() { + class MockAccountStore: ACAccountStore { + override func saveAccount(_ account: ACAccount!, withCompletionHandler completionHandler: ACAccountStoreSaveCompletionHandler!) { + completionHandler(true, nil) + } + } + + let ex = expectation(description: "") + MockAccountStore().saveAccount(dummy).done { _ in + ex.fulfill() + }.catch { + XCTFail("\($0)") + } + + waitForExpectations(timeout: 1) + } + + func test_removeAccount() { + class MockAccountStore: ACAccountStore { + override func removeAccount(_ account: ACAccount!, withCompletionHandler completionHandler: ACAccountStoreSaveCompletionHandler!) { + completionHandler(true, nil) + } + } + + let ex = expectation(description: "") + MockAccountStore().removeAccount(dummy).done { _ in + ex.fulfill() + }.catch { + XCTFail("\($0)") + } + + waitForExpectations(timeout: 1) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/.gitignore new file mode 100644 index 0000000..30f5004 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/.travis.yml new file mode 100644 index 0000000..11eecbc --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/.travis.yml @@ -0,0 +1,25 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.4, env: 'SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode10, env: 'SWFT=3.4 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.4, env: 'SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode10, env: 'SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform iOS --verbose +install: + - xcodebuild -scheme PMKAddressBook -target PMKAddressBook -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKAddressBook -target PMKABTests -quiet -destination "$DST" build; + fi +script: + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKAddressBook -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Cartfile new file mode 100644 index 0000000..bf92021 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.pbxproj new file mode 100644 index 0000000..654c352 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.pbxproj @@ -0,0 +1,439 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63938C031D5C27AE00F4C165 /* ABAddressBookRequestAccess+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63938C021D5C27AE00F4C165 /* ABAddressBookRequestAccess+Promise.swift */; }; + 63938C091D5C27F600F4C165 /* TestAddressBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63938C081D5C27F600F4C165 /* TestAddressBook.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKAddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKAddressBook.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKFoundation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63167B891D5C23B4007A96B0 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63938C021D5C27AE00F4C165 /* ABAddressBookRequestAccess+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "ABAddressBookRequestAccess+Promise.swift"; path = "Sources/ABAddressBookRequestAccess+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63938C081D5C27F600F4C165 /* TestAddressBook.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestAddressBook.swift; path = Tests/TestAddressBook.swift; sourceTree = SOURCE_ROOT; }; + 63BF28101D5C257100F62C66 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKAddressBook.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKAddressBook.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKABTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKABTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKAddressBook.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63167B891D5C23B4007A96B0 /* Cartfile */, + 63BF28101D5C257100F62C66 /* Carthage.xcconfig */, + 63C700091D5C0253003BAE60 /* Info.plist */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKAddressBook.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKABTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63938C021D5C27AE00F4C165 /* ABAddressBookRequestAccess+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63938C081D5C27F600F4C165 /* TestAddressBook.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKAddressBook */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAddressBook" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKAddressBook; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKAddressBook.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKABTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKABTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 63EF83AD1D5FA940008748A6 /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKABTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKABTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAddressBook" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKAddressBook */, + 63C7FFF11D5C020D003BAE60 /* PMKABTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 63EF83AD1D5FA940008748A6 /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63938C031D5C27AE00F4C165 /* ABAddressBookRequestAccess+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63938C091D5C27F600F4C165 /* TestAddressBook.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKAddressBook */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63BF28101D5C257100F62C66 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63BF28101D5C257100F62C66 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.AddressBook; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.AddressBook; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAddressBook" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAddressBook" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKABTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/xcshareddata/xcschemes/PMKAddressBook.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/xcshareddata/xcschemes/PMKAddressBook.xcscheme new file mode 100644 index 0000000..eaee6b6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/PMKAddressBook.xcodeproj/xcshareddata/xcschemes/PMKAddressBook.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/README.markdown new file mode 100644 index 0000000..3be2f77 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit AddressBook Extensions ![Build Status] + +This project adds promises to Apple’s AddressBook framework. + +## CococaPods + +```ruby +pod "PromiseKit/AddressBook" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/AddressBook" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKAddressBook +``` + +```objc +// objc +@import PromiseKit; +@import PMKAddressBook; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/AddressBook.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Sources/ABAddressBookRequestAccess+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Sources/ABAddressBookRequestAccess+Promise.swift new file mode 100644 index 0000000..9cc43f3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Sources/ABAddressBookRequestAccess+Promise.swift @@ -0,0 +1,102 @@ +import Foundation.NSError +import CoreFoundation +import AddressBook +#if !PMKCocoaPods +import PromiseKit +#endif + +public enum AddressBookError: Error { + case notDetermined + case restricted + case denied + + public var localizedDescription: String { + switch self { + case .notDetermined: + return "Access to the address book could not be determined." + case .restricted: + return "A head of family must grant address book access." + case .denied: + return "Address book access has been denied." + } + } +} + +/** + Requests access to the address book. + + To import `ABAddressBookRequestAccess`: + + use_frameworks! + pod "PromiseKit/AddressBook" + + And then in your sources: + + import PromiseKit + + @return A promise that fulfills with the ABAuthorizationStatus. +*/ +public func ABAddressBookRequestAccess() -> Promise { + return ABAddressBookRequestAccess().map(on: nil) { (_, _) -> ABAuthorizationStatus in + return ABAddressBookGetAuthorizationStatus() + } +} + +/** + Requests access to the address book. + + To import `ABAddressBookRequestAccess`: + + pod "PromiseKit/AddressBook" + + And then in your sources: + + import PromiseKit + + @return A promise that fulfills with the ABAddressBook instance if access was granted. +*/ +public func ABAddressBookRequestAccess() -> Promise { + return ABAddressBookRequestAccess().then(on: nil) { granted, book -> Promise in + guard granted else { + switch ABAddressBookGetAuthorizationStatus() { + case .notDetermined: + throw AddressBookError.notDetermined + case .restricted: + throw AddressBookError.restricted + case .denied: + throw AddressBookError.denied + case .authorized: + fatalError("This should not happen") + } + } + + return .value(book) + } +} + +extension NSError { + fileprivate convenience init(CFError error: CoreFoundation.CFError) { + let domain = CFErrorGetDomain(error) as String + let code = CFErrorGetCode(error) + let info = CFErrorCopyUserInfo(error) as? [String: Any] ?? [:] + self.init(domain: domain, code: code, userInfo: info) + } +} + +private func ABAddressBookRequestAccess() -> Promise<(Bool, ABAddressBook)> { + var error: Unmanaged? = nil + guard let ubook = ABAddressBookCreateWithOptions(nil, &error) else { + return Promise(error: NSError(CFError: error!.takeRetainedValue())) + } + + let book: ABAddressBook = ubook.takeRetainedValue() + return Promise { seal in + ABAddressBookRequestAccessWithCompletion(book) { granted, error in + if let error = error { + seal.reject(NSError(CFError: error)) + } else { + seal.fulfill((granted, book)) + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Tests/TestAddressBook.swift b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Tests/TestAddressBook.swift new file mode 100644 index 0000000..76dd423 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AddressBook/Tests/TestAddressBook.swift @@ -0,0 +1,15 @@ +import PMKAddressBook +import AddressBook +import PromiseKit +import XCTest + +class AddressBookTests: XCTestCase { + func test() { + let ex = expectation(description: "") + ABAddressBookRequestAccess().done { (auth: ABAuthorizationStatus) in + XCTAssertEqual(auth, ABAuthorizationStatus.authorized) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/.gitignore new file mode 100644 index 0000000..30f5004 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/.travis.yml new file mode 100644 index 0000000..bbd8b7a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/.travis.yml @@ -0,0 +1,52 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'PLAT=macOS SWFT=3.1 DST="arch=x86_64"'} + - {osx_image: xcode8.3, env: 'PLAT=iOS SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + - {osx_image: xcode8.3, env: 'PLAT=tvOS SWFT=3.1 DST="OS=10.2,name=Apple TV 1080p"'} + - {osx_image: xcode8.3, env: 'PLAT=watchOS SWFT=3.1 DST="OS=3.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.3, env: 'PLAT=macOS SWFT=3.2 DST="arch=x86_64"'} + - {osx_image: xcode9.3, env: 'PLAT=iOS SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.3, env: 'PLAT=tvOS SWFT=3.2 DST="OS=11.2,name=Apple TV"'} + - {osx_image: xcode9.3, env: 'PLAT=watchOS SWFT=3.2 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.4, env: 'PLAT=macOS SWFT=3.3 DST="arch=x86_64"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=3.3 DST="OS=11.4,name=Apple TV"'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=3.3 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode10, env: 'PLAT=macOS SWFT=3.4 DST="arch=x86_64"'} + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=3.4 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode10, env: 'PLAT=tvOS SWFT=3.4 DST="OS=11.4,name=Apple TV"'} + - {osx_image: xcode10, env: 'PLAT=watchOS SWFT=3.4 DST="OS=5.0,name=Apple Watch Series 3 - 42mm"'} + + - {osx_image: xcode9.2, env: 'PLAT=macOS SWFT=4.0 DST="arch=x86_64"'} + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=tvOS SWFT=4.0 DST="OS=11.2,name=Apple TV"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=4.0 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.4, env: 'PLAT=macOS SWFT=4.1 DST="arch=x86_64" TEST=1'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=4.1 DST="OS=11.4,name=Apple TV" TEST=1'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=4.1 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode10, env: 'PLAT=macOS SWFT=4.2 DST="arch=x86_64"'} + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=4.2 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode10, env: 'PLAT=tvOS SWFT=4.2 DST="OS=11.4,name=Apple TV"'} + - {osx_image: xcode10, env: 'PLAT=watchOS SWFT=4.2 DST="OS=5.0,name=Apple Watch Series 3 - 42mm"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKAlamofire -target PMKAlamofire -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [ "$TEST" == "1" ]; then + xcodebuild -scheme PMKAlamofire -target PMKAFTests -quiet -destination "$DST" build; + fi +script: + - if [ "$TEST" == "1" ]; then + xcodebuild -scheme PMKAlamofire -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile new file mode 100644 index 0000000..a5567cd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile @@ -0,0 +1,2 @@ +github "mxcl/PromiseKit" ~> 6.0 +github "Alamofire/Alamofire" ~> 4.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile.private b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile.private new file mode 100644 index 0000000..13f8280 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile.private @@ -0,0 +1 @@ +github "AliSoftware/OHHTTPStubs" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile.resolved new file mode 100644 index 0000000..b8ec46f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Cartfile.resolved @@ -0,0 +1,3 @@ +github "Alamofire/Alamofire" "4.7.2" +github "AliSoftware/OHHTTPStubs" "6.1.0" +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.pbxproj new file mode 100644 index 0000000..36b929d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.pbxproj @@ -0,0 +1,451 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63C700081D5C021F003BAE60 /* TestAlamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C700021D5C021F003BAE60 /* TestAlamofire.swift */; }; + 63C7FFE91D5C00F2003BAE60 /* Alamofire+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFDB1D5C00F2003BAE60 /* Alamofire+Promise.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKAlamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKAlamofire.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKFoundation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63C700021D5C021F003BAE60 /* TestAlamofire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestAlamofire.swift; path = Tests/TestAlamofire.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKAlamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKAlamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFDB1D5C00F2003BAE60 /* Alamofire+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Alamofire+Promise.swift"; path = "Sources/Alamofire+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63C7FFF21D5C020D003BAE60 /* PMKAFTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKAFTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8131D5C0C4E00503216 /* Cartfile.private */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile.private; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKAlamofire.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8131D5C0C4E00503216 /* Cartfile.private */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKAlamofire.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKAFTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63C7FFDB1D5C00F2003BAE60 /* Alamofire+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63C700021D5C021F003BAE60 /* TestAlamofire.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKAlamofire */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAlamofire" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKAlamofire; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKAlamofire.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKAFTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKAFTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKAFTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKAFTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAlamofire" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKAlamofire */, + 63C7FFF11D5C020D003BAE60 /* PMKAFTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + OHHTTPStubs, + Alamofire, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFE91D5C00F2003BAE60 /* Alamofire+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C700081D5C021F003BAE60 /* TestAlamofire.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKAlamofire */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.0.6; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.0.6; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAlamofire" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAlamofire" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKAFTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3e1e5c8 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/xcshareddata/xcschemes/PMKAlamofire.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/xcshareddata/xcschemes/PMKAlamofire.xcscheme new file mode 100644 index 0000000..bb5bf63 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/PMKAlamofire.xcodeproj/xcshareddata/xcschemes/PMKAlamofire.xcscheme @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Package.swift b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Package.swift new file mode 100644 index 0000000..984e8c1 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Package.swift @@ -0,0 +1,10 @@ +import PackageDescription + +let package = Package( + name: "PMKAlamofire", + dependencies: [ + .Package(url: "https://github.com/mxcl/PromiseKit.git", majorVersion: 4), + .Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4) + ], + exclude: ["Tests"] +) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/README.markdown new file mode 100644 index 0000000..4d0b420 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/README.markdown @@ -0,0 +1,93 @@ +# PromiseKit Alamofire Extensions ![Build Status] + +This project adds promises to [Alamofire](https://github.com/Alamofire/Alamofire). + +This project supports Swift 3.1, 3.2, 4.0 and 4.1. + +## Usage + +```swift +Alamofire.request("https://httpbin.org/get", method: .GET) + .responseJSON().then { json, rsp in + // + }.catch{ error in + //… + } +``` + +Of course, the whole point in promises is composability, so: + +```swift +func login() -> Promise { + let q = DispatchQueue.global() + UIApplication.shared.isNetworkActivityIndicatorVisible = true + + return firstly { in + Alamofire.request(url, method: .get).responseData() + }.map(on: q) { data, rsp in + convertToUser(data) + }.ensure { + UIApplication.shared.isNetworkActivityIndicatorVisible = false + } +} + +firstly { + login() +}.done { user in + //… +}.catch { error in + UIAlertController(/*…*/).show() +} +``` + +## CococaPods + +```ruby +# Podfile +pod 'PromiseKit/Alamofire', '~> 6.0' +``` + +```swift +// `.swift` files +import PromiseKit +import Alamofire +``` + +```objc +// `.m files` +@import PromiseKit; +@import Alamofire; +``` + +## Carthage + +```ruby +github "PromiseKit/Alamofire-" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// `.swift` files +import PromiseKit +import PMKAlamofire +``` + +```objc +// `.m files` +@import PromiseKit; +@import PMKAlamofire; +``` + +## SwiftPM + +```swift +let package = Package( + dependencies: [ + .Target(url: "https://github.com/PromiseKit/Alamofire", majorVersion: 3) + ] +) +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/Alamofire.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Sources/Alamofire+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Sources/Alamofire+Promise.swift new file mode 100644 index 0000000..f5f7b59 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Sources/Alamofire+Promise.swift @@ -0,0 +1,189 @@ +@_exported import Alamofire +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `Alamofire` category: + + use_frameworks! + pod "PromiseKit/Alamofire" + + And then in your sources: + + import PromiseKit + */ +extension Alamofire.DataRequest { + /// Adds a handler to be called once the request has finished. + public func response(_: PMKNamespacer, queue: DispatchQueue? = nil) -> Promise<(URLRequest, HTTPURLResponse, Data)> { + return Promise { seal in + response(queue: queue) { rsp in + if let error = rsp.error { + seal.reject(error) + } else if let a = rsp.request, let b = rsp.response, let c = rsp.data { + seal.fulfill((a, b, c)) + } else { + seal.reject(PMKError.invalidCallingConvention) + } + } + } + } + + /// Adds a handler to be called once the request has finished. + public func responseData(queue: DispatchQueue? = nil) -> Promise<(data: Data, response: PMKAlamofireDataResponse)> { + return Promise { seal in + responseData(queue: queue) { response in + switch response.result { + case .success(let value): + seal.fulfill((value, PMKAlamofireDataResponse(response))) + case .failure(let error): + seal.reject(error) + } + } + } + } + + /// Adds a handler to be called once the request has finished. + public func responseString(queue: DispatchQueue? = nil) -> Promise<(string: String, response: PMKAlamofireDataResponse)> { + return Promise { seal in + responseString(queue: queue) { response in + switch response.result { + case .success(let value): + seal.fulfill((value, PMKAlamofireDataResponse(response))) + case .failure(let error): + seal.reject(error) + } + } + } + } + + /// Adds a handler to be called once the request has finished. + public func responseJSON(queue: DispatchQueue? = nil, options: JSONSerialization.ReadingOptions = .allowFragments) -> Promise<(json: Any, response: PMKAlamofireDataResponse)> { + return Promise { seal in + responseJSON(queue: queue, options: options) { response in + switch response.result { + case .success(let value): + seal.fulfill((value, PMKAlamofireDataResponse(response))) + case .failure(let error): + seal.reject(error) + } + } + } + } + + /// Adds a handler to be called once the request has finished. + public func responsePropertyList(queue: DispatchQueue? = nil, options: PropertyListSerialization.ReadOptions = PropertyListSerialization.ReadOptions()) -> Promise<(plist: Any, response: PMKAlamofireDataResponse)> { + return Promise { seal in + responsePropertyList(queue: queue, options: options) { response in + switch response.result { + case .success(let value): + seal.fulfill((value, PMKAlamofireDataResponse(response))) + case .failure(let error): + seal.reject(error) + } + } + } + } + +#if swift(>=3.2) + /** + Returns a Promise for a Decodable + Adds a handler to be called once the request has finished. + + - Parameter queue: DispatchQueue, by default nil + - Parameter decoder: JSONDecoder, by default JSONDecoder() + */ + public func responseDecodable(queue: DispatchQueue? = nil, decoder: JSONDecoder = JSONDecoder()) -> Promise { + return Promise { seal in + responseData(queue: queue) { response in + switch response.result { + case .success(let value): + do { + seal.fulfill(try decoder.decode(T.self, from: value)) + } catch { + seal.reject(error) + } + case .failure(let error): + seal.reject(error) + } + } + } + } + + /** + Returns a Promise for a Decodable + Adds a handler to be called once the request has finished. + + - Parameter queue: DispatchQueue, by default nil + - Parameter decoder: JSONDecoder, by default JSONDecoder() + */ + public func responseDecodable(_ type: T.Type, queue: DispatchQueue? = nil, decoder: JSONDecoder = JSONDecoder()) -> Promise { + return Promise { seal in + responseData(queue: queue) { response in + switch response.result { + case .success(let value): + do { + seal.fulfill(try decoder.decode(type, from: value)) + } catch { + seal.reject(error) + } + case .failure(let error): + seal.reject(error) + } + } + } + } +#endif +} + +extension Alamofire.DownloadRequest { + public func response(_: PMKNamespacer, queue: DispatchQueue? = nil) -> Promise { + return Promise { seal in + response(queue: queue) { response in + if let error = response.error { + seal.reject(error) + } else { + seal.fulfill(response) + } + } + } + } + + /// Adds a handler to be called once the request has finished. + public func responseData(queue: DispatchQueue? = nil) -> Promise> { + return Promise { seal in + responseData(queue: queue) { response in + switch response.result { + case .success: + seal.fulfill(response) + case .failure(let error): + seal.reject(error) + } + } + } + } +} + + +/// Alamofire.DataResponse, but without the `result`, since the Promise represents the `Result` +public struct PMKAlamofireDataResponse { + public init(_ rawrsp: Alamofire.DataResponse) { + request = rawrsp.request + response = rawrsp.response + data = rawrsp.data + timeline = rawrsp.timeline + } + + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Tests/TestAlamofire.swift b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Tests/TestAlamofire.swift new file mode 100644 index 0000000..043ee8a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Alamofire/Tests/TestAlamofire.swift @@ -0,0 +1,74 @@ +import PMKAlamofire +import OHHTTPStubs +import PromiseKit +import XCTest + +class AlamofireTests: XCTestCase { + func test() { + let json: NSDictionary = ["key1": "value1", "key2": ["value2A", "value2B"]] + + OHHTTPStubs.stubRequests(passingTest: { $0.url!.host == "example.com" }) { _ in + return OHHTTPStubsResponse(jsonObject: json, statusCode: 200, headers: nil) + } + + let ex = expectation(description: "") + + let rq = Alamofire.request("http://example.com", method: .get).responseJSON().done { rsp in + XCTAssertEqual(json, rsp.json as? NSDictionary) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + override func tearDown() { + OHHTTPStubs.removeAllStubs() + } + +#if swift(>=3.2) + private struct Fixture: Decodable { + let key1: String + let key2: [String] + } + + func testDecodable1() { + + func getFixture() -> Promise { + return Alamofire.request("http://example.com", method: .get).responseDecodable(queue: nil) + } + + let json: NSDictionary = ["key1": "value1", "key2": ["value2A", "value2B"]] + + OHHTTPStubs.stubRequests(passingTest: { $0.url!.host == "example.com" }) { _ in + return OHHTTPStubsResponse(jsonObject: json, statusCode: 200, headers: nil) + } + + let ex = expectation(description: "") + + getFixture().done { fixture in + XCTAssert(fixture.key1 == "value1", "Value1 found") + ex.fulfill() + } + waitForExpectations(timeout: 1) + + } + + func testDecodable2() { + let json: NSDictionary = ["key1": "value1", "key2": ["value2A", "value2B"]] + + OHHTTPStubs.stubRequests(passingTest: { $0.url!.host == "example.com" }) { _ in + return OHHTTPStubsResponse(jsonObject: json, statusCode: 200, headers: nil) + } + + let ex = expectation(description: "") + + firstly { + Alamofire.request("http://example.com", method: .get).responseDecodable(Fixture.self) + }.done { fixture in + XCTAssert(fixture.key1 == "value1", "Value1 found") + ex.fulfill() + } + waitForExpectations(timeout: 1) + + } +#endif +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/.travis.yml new file mode 100644 index 0000000..da6a2ee --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/.travis.yml @@ -0,0 +1,25 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.4, env: 'SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode10, env: 'SWFT=3.4 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.4, env: 'SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode10, env: 'SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform iOS --verbose +install: + - xcodebuild -scheme PMKAssetsLibrary -target PMKAssetsLibrary -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKAssetsLibrary -target PMKALTests -quiet -destination "$DST" build; + fi +script: + - if [ "$TEST" == "1" ]; then + xcodebuild -scheme PMKAssetsLibrary -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Cartfile.resolved new file mode 100644 index 0000000..8d4fefc --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.4" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Info.plist new file mode 100644 index 0000000..34dfbc3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e60c153 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.pbxproj @@ -0,0 +1,599 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6362F8521D5DA15A0021D2DD /* app.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6362F8501D5DA15A0021D2DD /* app.swift */; }; + 6362F8531D5DA15A0021D2DD /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6362F8511D5DA15A0021D2DD /* Default-568h@2x.png */; }; + 6362F8541D5DA16A0021D2DD /* TestUIImagePickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637E2C8E1D5C2E720043E370 /* TestUIImagePickerController.swift */; }; + 6362F8561D5DA1750021D2DD /* ALAssetsLibrary+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6362F8551D5DA1750021D2DD /* ALAssetsLibrary+Promise.swift */; }; + 63C9C45E1D5D341600101ECE /* PMKAssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKAssetsLibrary.framework */; }; + 63C9C45F1D5D341600101ECE /* PMKAssetsLibrary.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKAssetsLibrary.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C9C4591D5D33A900101ECE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C9C4441D5D334700101ECE; + remoteInfo = PMKTestsHost; + }; + 63C9C4601D5D341600101ECE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKAssetsLibrary; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 63C9C4621D5D341600101ECE /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 63C9C45F1D5D341600101ECE /* PMKAssetsLibrary.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 630B2E131D5D0AF500DC10E9 /* PMKALTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKALTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6362F8501D5DA15A0021D2DD /* app.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = app.swift; path = Tests/app.swift; sourceTree = ""; }; + 6362F8511D5DA15A0021D2DD /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Tests/Default-568h@2x.png"; sourceTree = ""; }; + 6362F8551D5DA1750021D2DD /* ALAssetsLibrary+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "ALAssetsLibrary+Promise.swift"; path = "Sources/ALAssetsLibrary+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 637E2C8E1D5C2E720043E370 /* TestUIImagePickerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestUIImagePickerController.swift; path = Tests/TestUIImagePickerController.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKAssetsLibrary.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKAssetsLibrary.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C9C4451D5D334700101ECE /* PMKALTestsHost.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PMKALTestsHost.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 630B2E0D1D5D0AF500DC10E9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C9C4421D5D334700101ECE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C9C45E1D5D341600101ECE /* PMKAssetsLibrary.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 630B2DF31D5D0ABF00DC10E9 /* TestsHost */ = { + isa = PBXGroup; + children = ( + 6362F8501D5DA15A0021D2DD /* app.swift */, + 6362F8511D5DA15A0021D2DD /* Default-568h@2x.png */, + ); + name = TestsHost; + sourceTree = ""; + }; + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 630B2DF31D5D0ABF00DC10E9 /* TestsHost */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKAssetsLibrary.framework */, + 630B2E131D5D0AF500DC10E9 /* PMKALTests.xctest */, + 63C9C4451D5D334700101ECE /* PMKALTestsHost.app */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 6362F8551D5DA1750021D2DD /* ALAssetsLibrary+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 637E2C8E1D5C2E720043E370 /* TestUIImagePickerController.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 630B2DFF1D5D0AF500DC10E9 /* PMKALTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 630B2E101D5D0AF500DC10E9 /* Build configuration list for PBXNativeTarget "PMKALTests" */; + buildPhases = ( + 630B2E041D5D0AF500DC10E9 /* Sources */, + 630B2E0D1D5D0AF500DC10E9 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C9C45A1D5D33A900101ECE /* PBXTargetDependency */, + ); + name = PMKALTests; + productName = PMKALTests; + productReference = 630B2E131D5D0AF500DC10E9 /* PMKALTests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; + 63C7FFA61D5BEE09003BAE60 /* PMKAssetsLibrary */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAssetsLibrary" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKAssetsLibrary; + productName = PMKAssetsLibrary; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKAssetsLibrary.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C9C4441D5D334700101ECE /* PMKALTestsHost */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C9C4541D5D334800101ECE /* Build configuration list for PBXNativeTarget "PMKALTestsHost" */; + buildPhases = ( + 63C9C4411D5D334700101ECE /* Sources */, + 63C9C4421D5D334700101ECE /* Frameworks */, + 63C9C4431D5D334700101ECE /* Resources */, + 63C9C45D1D5D33E700101ECE /* Embed Carthage Frameworks */, + 63C9C4621D5D341600101ECE /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C9C4611D5D341600101ECE /* PBXTargetDependency */, + ); + name = PMKALTestsHost; + productName = PMKTestsHost; + productReference = 63C9C4451D5D334700101ECE /* PMKALTestsHost.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 630B2DFF1D5D0AF500DC10E9 = { + LastSwiftMigration = 0900; + TestTargetID = 63C9C4441D5D334700101ECE; + }; + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C9C4441D5D334700101ECE = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAssetsLibrary" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKAssetsLibrary */, + 63C9C4441D5D334700101ECE /* PMKALTestsHost */, + 630B2DFF1D5D0AF500DC10E9 /* PMKALTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 63C9C4431D5D334700101ECE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6362F8531D5DA15A0021D2DD /* Default-568h@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 63C9C45D1D5D33E700101ECE /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 630B2E041D5D0AF500DC10E9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6362F8541D5DA16A0021D2DD /* TestUIImagePickerController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6362F8561D5DA1750021D2DD /* ALAssetsLibrary+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C9C4411D5D334700101ECE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6362F8521D5DA15A0021D2DD /* app.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C9C45A1D5D33A900101ECE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C9C4441D5D334700101ECE /* PMKALTestsHost */; + targetProxy = 63C9C4591D5D33A900101ECE /* PBXContainerItemProxy */; + }; + 63C9C4611D5D341600101ECE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKAssetsLibrary */; + targetProxy = 63C9C4601D5D341600101ECE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 630B2E111D5D0AF500DC10E9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_PACKAGE_TYPE = BNDL; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.ui.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + TEST_TARGET_NAME = PMKALTestsHost; + }; + name = Debug; + }; + 630B2E121D5D0AF500DC10E9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_PACKAGE_TYPE = BNDL; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.ui.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + TEST_TARGET_NAME = PMKALTestsHost; + }; + name = Release; + }; + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + BUNDLE_PACKAGE_TYPE = FMWK; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.UIKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + BUNDLE_PACKAGE_TYPE = FMWK; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.UIKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C9C4551D5D334800101ECE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_PACKAGE_TYPE = APPL; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Tests/Entitlements.plist; + COPY_PHASE_STRIP = NO; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.host.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C9C4561D5D334800101ECE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_PACKAGE_TYPE = APPL; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Tests/Entitlements.plist; + COPY_PHASE_STRIP = NO; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.host.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 630B2E101D5D0AF500DC10E9 /* Build configuration list for PBXNativeTarget "PMKALTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 630B2E111D5D0AF500DC10E9 /* Debug */, + 630B2E121D5D0AF500DC10E9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAssetsLibrary" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKAssetsLibrary" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C9C4541D5D334800101ECE /* Build configuration list for PBXNativeTarget "PMKALTestsHost" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C9C4551D5D334800101ECE /* Debug */, + 63C9C4561D5D334800101ECE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/xcshareddata/xcschemes/PMKAssetsLibrary.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/xcshareddata/xcschemes/PMKAssetsLibrary.xcscheme new file mode 100644 index 0000000..9539598 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/PMKAssetsLibrary.xcodeproj/xcshareddata/xcschemes/PMKAssetsLibrary.xcscheme @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/README.markdown new file mode 100644 index 0000000..1c2f7d2 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit AssetsLibrary Extensions ![Build Status] + +This project adds promises to Apple’s AssetsLibrary framework. + +## CococaPods + +```ruby +pod "PromiseKit/AssetsLibrary" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/AssetsLibrary" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKAssetsLibrary +``` + +```objc +// objc +@import PromiseKit; +@import PMKAssetsLibrary; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/AssetsLibrary.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Sources/ALAssetsLibrary+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Sources/ALAssetsLibrary+Promise.swift new file mode 100644 index 0000000..27cf85d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Sources/ALAssetsLibrary+Promise.swift @@ -0,0 +1,100 @@ +import UIKit.UIViewController +import Foundation.NSData +import AssetsLibrary +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import this `UIViewController` extension: + + use_frameworks! + pod "PromiseKit/AssetsLibrary" + + And then in your sources: + + import PromiseKit +*/ +extension UIViewController { + /** + - Returns: A promise that presents the provided UIImagePickerController and fulfills with the user selected media’s `NSData`. + */ + public func promise(_ vc: UIImagePickerController, animated: Bool = false, completion: (() -> Void)? = nil) -> Promise { + let proxy = UIImagePickerControllerProxy() + vc.delegate = proxy + + present(vc, animated: animated, completion: completion) + + return proxy.promise.then(on: nil) { info -> Promise in + #if swift(>=4.2) + let url = info[.referenceURL] as! URL + #else + let url = info[UIImagePickerControllerReferenceURL] as! URL + #endif + + return Promise { seal in + ALAssetsLibrary().asset(for: url, resultBlock: { asset in + let N = Int(asset!.defaultRepresentation().size()) + let bytes = UnsafeMutablePointer.allocate(capacity: N) + var error: NSError? + asset!.defaultRepresentation().getBytes(bytes, fromOffset: 0, length: N, error: &error) + + if let error = error { + seal.reject(error) + } else { + seal.fulfill(NSData(bytesNoCopy: bytes, length: N)) + } + }, failureBlock: { seal.reject($0!) } ) + } + }.ensure { + self.dismiss(animated: animated, completion: nil) + } + } +} + +@objc private class UIImagePickerControllerProxy: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate { +#if swift(>=4.2) + let (promise, seal) = Promise<[UIImagePickerController.InfoKey: Any]>.pending() +#else + let (promise, seal) = Promise<[String: Any]>.pending() +#endif + var retainCycle: AnyObject? + + required override init() { + super.init() + retainCycle = self + } + +#if swift(>=4.2) + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { + seal.fulfill(info) + retainCycle = nil + } +#else + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { + seal.fulfill(info) + retainCycle = nil + } +#endif + + func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { + seal.reject(UIImagePickerController.PMKError.cancelled) + retainCycle = nil + } +} + + +extension UIImagePickerController { + /// Errors representing PromiseKit UIImagePickerController failures + public enum PMKError: CancellableError { + /// The user cancelled the UIImagePickerController. + case cancelled + /// - Returns: true + public var isCancelled: Bool { + switch self { + case .cancelled: + return true + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Default-568h@2x.png b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Default-568h@2x.png new file mode 100644 index 0000000..42d3f42 Binary files /dev/null and b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Default-568h@2x.png differ diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Entitlements.plist b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Entitlements.plist new file mode 100644 index 0000000..76a15bb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Entitlements.plist @@ -0,0 +1,12 @@ + + + + + com.apple.private.tcc.allow + + kTCCServiceAddressBook + kTCCServiceCalendar + kTCCServicePhotos + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/TestUIImagePickerController.swift b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/TestUIImagePickerController.swift new file mode 100644 index 0000000..f93bb95 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/TestUIImagePickerController.swift @@ -0,0 +1,31 @@ +import XCTest + +class UIImagePickerControllerTests: XCTestCase { + func test_fulfills_with_data() { + let app = XCUIApplication() + let tablesQuery = app.tables + tablesQuery.staticTexts["1"].tap() + tablesQuery.children(matching: .cell).element(boundBy: 1).tap() + app.collectionViews.children(matching: .cell).element(boundBy: 0).tap() + + XCTAssertTrue(value) + } + + var toggle: XCUIElement { + // calling this ensures that any other ViewController has dismissed + // as a side-effect since otherwise the switch won't be found + return XCUIApplication().tables.switches.element + } + + var value: Bool { + return (toggle.value as! String) == "1" + } + + override func setUp() { + super.setUp() + continueAfterFailure = false + XCUIApplication().launch() + XCTAssertFalse(value) + } + +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/app.swift b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/app.swift new file mode 100644 index 0000000..65efc86 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/app.swift @@ -0,0 +1,39 @@ +import PMKAssetsLibrary +import AssetsLibrary +import PromiseKit +import UIKit + +@UIApplicationMain +class App: UITableViewController, UIApplicationDelegate { + + var window: UIWindow? = UIWindow(frame: UIScreen.main.bounds) + let testSuceededSwitch = UISwitch() + + func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + window!.rootViewController = self + window!.backgroundColor = UIColor.purple + window!.makeKeyAndVisible() + UIView.setAnimationsEnabled(false) + return true + } + + override func viewDidLoad() { + view.addSubview(testSuceededSwitch) + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 1 + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = UITableViewCell() + cell.textLabel?.text = "1" + return cell + } + + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + _ = promise(UIImagePickerController()).done { (data: NSData) in + self.testSuceededSwitch.isOn = true + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/.travis.yml new file mode 100644 index 0000000..946828a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/.travis.yml @@ -0,0 +1,22 @@ +os: osx +language: objective-c +osx_image: xcode9.4 +env: + - PLAT=macOS DST="arch=x86_64" + - PLAT=iOS DST="OS=11.4,name=iPhone 5s" + - PLAT=tvOS DST="OS=11.4,name=Apple TV" + - PLAT=watchOS DST="OS=4.3,name=Apple Watch - 38mm" +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKBolts -target PMKBolts -quiet -destination "$DST" build + - if [ $PLAT != "watchOS" ]; then + xcodebuild -scheme PMKBolts -target PMKBoltsTests -quiet -destination "$DST" build; + fi +script: + - if [ $PLAT != "watchOS" ]; then + xcodebuild -scheme PMKBolts -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Cartfile new file mode 100644 index 0000000..cf08ba9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Cartfile @@ -0,0 +1,2 @@ +github "mxcl/PromiseKit" ~> 6.0 +github "BoltsFramework/Bolts-ObjC" ~> 1.9 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Cartfile.resolved new file mode 100644 index 0000000..cc39392 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Cartfile.resolved @@ -0,0 +1,2 @@ +github "BoltsFramework/Bolts-ObjC" "1.9.0" +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e0717c3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.pbxproj @@ -0,0 +1,429 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63C7FFF71D5C020D003BAE60 /* PMKBolts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKBolts.framework */; }; + 63FE02391D5D5CA800522465 /* BFTask+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63FE02381D5D5CA800522465 /* BFTask+Promise.swift */; }; + 63FE023B1D5D5CB300522465 /* TestBolts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63FE023A1D5D5CB300522465 /* TestBolts.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKBolts; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKBolts.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKBolts.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKBoltsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKBoltsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63FE02381D5D5CA800522465 /* BFTask+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "BFTask+Promise.swift"; path = "Sources/BFTask+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63FE023A1D5D5CB300522465 /* TestBolts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestBolts.swift; path = Tests/TestBolts.swift; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKBolts.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKBolts.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKBoltsTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63FE02381D5D5CA800522465 /* BFTask+Promise.swift */, + ); + path = Sources; + sourceTree = ""; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63FE023A1D5D5CB300522465 /* TestBolts.swift */, + ); + path = Tests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKBolts */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKBolts" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKBolts; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKBolts.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKBoltsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKBoltsTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKBoltsTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKBoltsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0920; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0920; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKBolts" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKBolts */, + 63C7FFF11D5C020D003BAE60 /* PMKBoltsTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + Bolts, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63FE02391D5D5CA800522465 /* BFTask+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63FE023B1D5D5CB300522465 /* TestBolts.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKBolts */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Bolts; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Bolts; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKBolts" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKBolts" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKBoltsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/xcshareddata/xcschemes/PMKBolts.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/xcshareddata/xcschemes/PMKBolts.xcscheme new file mode 100644 index 0000000..7805b6f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/PMKBolts.xcodeproj/xcshareddata/xcschemes/PMKBolts.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/README.markdown new file mode 100644 index 0000000..5d59ab5 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/README.markdown @@ -0,0 +1,47 @@ +# PromiseKit Bolts Extensions ![Build Status] + +This project adds promises to Facebook’s [Bolts] framework. + +Bolts underlies the entire Facbook SDK. + +## Usage + +```swift +someBoltsTask().then { anyObject in + //… +} +``` + +## CocoaPods + +```ruby +pod "PromiseKit/Bolts" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/Bolts" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKBolts +``` + +```objc +// objc +@import PromiseKit; +@import PMKBolts; +``` + + +[Bolts]: https://github.com/BoltsFramework + + +[Build Status]: https://travis-ci.org/PromiseKit/Bolts.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Sources/BFTask+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Sources/BFTask+Promise.swift new file mode 100644 index 0000000..de78655 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Sources/BFTask+Promise.swift @@ -0,0 +1,27 @@ +#if !PMKCocoaPods +import PromiseKit +#endif +import Bolts + +extension Promise { + /** + The provided closure is executed when this promise is resolved. + */ + public func then(on q: DispatchQueue? = conf.Q.map, body: @escaping (T) -> BFTask) -> Promise { + return then(on: q) { tee -> Promise in + let task = body(tee) + return Promise { seal in + task.continueWith(block: { task in + if task.isCompleted { + seal.fulfill(task.result) + } else if let error = task.error { + seal.reject(error) + } else { + seal.reject(PMKError.invalidCallingConvention) + } + return nil + }) + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Tests/TestBolts.swift b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Tests/TestBolts.swift new file mode 100644 index 0000000..6985661 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Bolts/Tests/TestBolts.swift @@ -0,0 +1,23 @@ +import PromiseKit +import PMKBolts +import XCTest +import Bolts + +class TestBolts: XCTestCase { + func test() { + let ex = expectation(description: "") + + let value = { NSString(string: "1") } + + firstly { () -> Promise in + return Promise() + }.then { _ -> BFTask in + return BFTask(result: value()) + }.done { obj in + XCTAssertEqual(obj, value()) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/.travis.yml new file mode 100644 index 0000000..d88cf94 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/.travis.yml @@ -0,0 +1,84 @@ +branches: + only: + - master +stages: + - lint + - carthage + - test +jobs: + include: + - &pod + stage: lint + osx_image: xcode8.3 + env: SWIFT=3.1 + name: pod lib lint --swift-version=3.1 + os: osx + language: objective-c + before_install: + gem install cocoapods --prerelease --version 1.6.0.beta.1 + install: + carthage bootstrap --no-build PromiseKit + script: | + cd Carthage/Checkouts/PromiseKit + mv .github/PromiseKit.podspec . + rm -rf Extensions/CloudKit/Sources + cp -R ../../../Sources Extensions/CloudKit + pod lib lint --subspec=PromiseKit/CloudKit --fail-fast --swift-version=$SWIFT + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=3.2 + name: pod lib lint --swift-version=3.2 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=3.3 + name: pod lib lint --swift-version=3.3 + - <<: *pod + osx_image: xcode10 + env: SWIFT=3.4 + name: pod lib lint --swift-version=3.4 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=4.0 + name: pod lib lint --swift-version=4.0 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=4.1 + name: pod lib lint --swift-version=4.1 + - <<: *pod + osx_image: xcode10 + env: SWIFT=4.2 + name: pod lib lint --swift-version=4.2 + + - stage: carthage + osx_image: xcode10 + name: Carthage / watchOS + os: osx + language: objective-c + script: + carthage bootstrap --platform watchOS + cache: + directories: + - Carthage + + - &test + stage: test + osx_image: xcode10 + name: macOS Tests + env: DST='arch=x86_64' PLAT=macOS + os: osx + language: objective-c + cache: + directories: + - Carthage + before_install: + carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT + install: + xcodebuild -scheme PMKCloudKit -target PMKCloudKit -quiet -destination "$DST" SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: + xcodebuild -scheme PMKCloudKit -quiet -destination "$DST" test + - <<: *test + env: DST='OS=12.0,name=iPhone SE' PLAT=iOS + name: iOS Tests + - <<: *test + env: DST='OS=12.0,name=Apple TV' PLAT=tvOS + name: tvOS Tests diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Cartfile.resolved new file mode 100644 index 0000000..d903612 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.5.0" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6aca5dd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.pbxproj @@ -0,0 +1,479 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63C7FFF71D5C020D003BAE60 /* PMKCloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKCloudKit.framework */; }; + 63F6071E1D5D48B200A11DEA /* CKContainer+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 63F607171D5D48B200A11DEA /* CKContainer+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63F6071F1D5D48B200A11DEA /* CKContainer+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63F607181D5D48B200A11DEA /* CKContainer+AnyPromise.m */; }; + 63F607201D5D48B200A11DEA /* CKContainer+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63F607191D5D48B200A11DEA /* CKContainer+Promise.swift */; }; + 63F607211D5D48B200A11DEA /* CKDatabase+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 63F6071A1D5D48B200A11DEA /* CKDatabase+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63F607221D5D48B200A11DEA /* CKDatabase+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63F6071B1D5D48B200A11DEA /* CKDatabase+AnyPromise.m */; }; + 63F607231D5D48B200A11DEA /* CKDatabase+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63F6071C1D5D48B200A11DEA /* CKDatabase+Promise.swift */; }; + 63F607241D5D48B200A11DEA /* PMKCloudKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 63F6071D1D5D48B200A11DEA /* PMKCloudKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63F607281D5D48D600A11DEA /* TestCloudKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63F607271D5D48D600A11DEA /* TestCloudKit.swift */; }; + 63F6072C1D5D4A0200A11DEA /* infrastructure.m in Sources */ = {isa = PBXBuildFile; fileRef = 63F6072B1D5D4A0200A11DEA /* infrastructure.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKCloudKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKCloudKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKCloudKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKCKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKCKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63F607171D5D48B200A11DEA /* CKContainer+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CKContainer+AnyPromise.h"; path = "Sources/CKContainer+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 63F607181D5D48B200A11DEA /* CKContainer+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CKContainer+AnyPromise.m"; path = "Sources/CKContainer+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63F607191D5D48B200A11DEA /* CKContainer+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CKContainer+Promise.swift"; path = "Sources/CKContainer+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63F6071A1D5D48B200A11DEA /* CKDatabase+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CKDatabase+AnyPromise.h"; path = "Sources/CKDatabase+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 63F6071B1D5D48B200A11DEA /* CKDatabase+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CKDatabase+AnyPromise.m"; path = "Sources/CKDatabase+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63F6071C1D5D48B200A11DEA /* CKDatabase+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CKDatabase+Promise.swift"; path = "Sources/CKDatabase+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63F6071D1D5D48B200A11DEA /* PMKCloudKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKCloudKit.h; path = Sources/PMKCloudKit.h; sourceTree = SOURCE_ROOT; }; + 63F607271D5D48D600A11DEA /* TestCloudKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestCloudKit.swift; path = Tests/TestCloudKit.swift; sourceTree = SOURCE_ROOT; }; + 63F6072A1D5D49BD00A11DEA /* infrastructure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = infrastructure.h; path = Tests/infrastructure.h; sourceTree = SOURCE_ROOT; }; + 63F6072B1D5D4A0200A11DEA /* infrastructure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = infrastructure.m; path = Tests/infrastructure.m; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKCloudKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKCloudKit.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKCKTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63F607171D5D48B200A11DEA /* CKContainer+AnyPromise.h */, + 63F607181D5D48B200A11DEA /* CKContainer+AnyPromise.m */, + 63F607191D5D48B200A11DEA /* CKContainer+Promise.swift */, + 63F6071A1D5D48B200A11DEA /* CKDatabase+AnyPromise.h */, + 63F6071B1D5D48B200A11DEA /* CKDatabase+AnyPromise.m */, + 63F6071C1D5D48B200A11DEA /* CKDatabase+Promise.swift */, + 63F6071D1D5D48B200A11DEA /* PMKCloudKit.h */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63F6072A1D5D49BD00A11DEA /* infrastructure.h */, + 63F6072B1D5D4A0200A11DEA /* infrastructure.m */, + 63F607271D5D48D600A11DEA /* TestCloudKit.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 63F607241D5D48B200A11DEA /* PMKCloudKit.h in Headers */, + 63F6071E1D5D48B200A11DEA /* CKContainer+AnyPromise.h in Headers */, + 63F607211D5D48B200A11DEA /* CKDatabase+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKCloudKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKCloudKit" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKCloudKit; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKCloudKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKCKTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKCKTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKCKTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKCKTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKCloudKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKCloudKit */, + 63C7FFF11D5C020D003BAE60 /* PMKCKTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63F607231D5D48B200A11DEA /* CKDatabase+Promise.swift in Sources */, + 63F6071F1D5D48B200A11DEA /* CKContainer+AnyPromise.m in Sources */, + 63F607201D5D48B200A11DEA /* CKContainer+Promise.swift in Sources */, + 63F607221D5D48B200A11DEA /* CKDatabase+AnyPromise.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63F6072C1D5D4A0200A11DEA /* infrastructure.m in Sources */, + 63F607281D5D48D600A11DEA /* TestCloudKit.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKCloudKit */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.CloudKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 10.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.CloudKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 10.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = Tests/infrastructure.h; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = Tests/infrastructure.h; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKCloudKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKCloudKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKCKTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/xcshareddata/xcschemes/PMKCloudKit.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/xcshareddata/xcschemes/PMKCloudKit.xcscheme new file mode 100644 index 0000000..7747fdd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/PMKCloudKit.xcodeproj/xcshareddata/xcschemes/PMKCloudKit.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Package.swift b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Package.swift new file mode 100644 index 0000000..3db1930 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Package.swift @@ -0,0 +1,16 @@ +import PackageDescription + +let pkg = Package(name: "PMKCloudKit") + +pkg.dependencies = [ + .Package(url: "https://github.com/mxcl/PromiseKit.git", majorVersion: 6) +] + +pkg.exclude = [ + "Sources/CKContainer+AnyPromise.h", + "Sources/CKDatabase+AnyPromise.h", + "Sources/PMKCloudKit.h", + "Sources/CKContainer+AnyPromise.m", + "Sources/CKDatabase+AnyPromise.m", + "Tests" +] diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/README.markdown new file mode 100644 index 0000000..136dc89 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit CloudKit Extensions ![Build Status] + +This project adds promises to Apple’s CloudKit framework. + +## CococaPods + +```ruby +pod "PromiseKit/CloudKit" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/CloudKit" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKFoundation +``` + +```objc +// objc +@import PromiseKit; +@import PMKCloudKit; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/CloudKit.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+AnyPromise.h new file mode 100644 index 0000000..87e9b3d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+AnyPromise.h @@ -0,0 +1,79 @@ +#import +#import + +/** + To import the `CKContainer` category: + + use_frameworks! + pod "PromiseKit/CloudKit" + + And then in your sources: + + @import PromiseKit; +*/ +@interface CKContainer (PromiseKit) + +/** + Reports whether the current user’s iCloud account can be accessed. + + @return A promise that thens the `CKAccountStatus` of this container. +*/ +- (AnyPromise *)accountStatus NS_REFINED_FOR_SWIFT; + +/** + Requests the specified permission from the user asynchronously. + + @param applicationPermission The requested permission. + + @return A promise that thens the `CKApplicationPermissionStatus` for the + requested permission. +*/ +- (AnyPromise *)requestApplicationPermission:(CKApplicationPermissions)applicationPermission NS_REFINED_FOR_SWIFT; + +/** + Checks the status of the specified permission asynchronously. + + @param applicationPermission The permission whose status you want to + check. + + @return A promise that thens the `CKApplicationPermissionStatus` for + the requested permission. +*/ +- (AnyPromise *)statusForApplicationPermission:(CKApplicationPermissions)applicationPermission NS_REFINED_FOR_SWIFT; + +#if !(TARGET_OS_TV && (TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR)) +/** + + Retrieves information about all discoverable users that are known to the + current user. + + @return A promise that thens the array of `CKDiscoveredUserInfo` objects. +*/ +#if TARGET_OS_WATCH +- (AnyPromise *)discoverAllIdentities NS_REFINED_FOR_SWIFT; +#else +- (AnyPromise *)discoverAllContactUserInfos NS_REFINED_FOR_SWIFT; +#endif +#endif + +/** + Retrieves information about a single user based on that user’s email + address or record ID. + + @param emailStringOrRecordID Either the email string or the `CKRecordID` + for the user record. + + @return A promise that thens the `CKDiscoveredUserInfo` for the + requested user record. +*/ +- (AnyPromise *)discoverUserInfo:(id)emailStringOrRecordID NS_REFINED_FOR_SWIFT; + +/** + Returns the user record associated with the current user. + + @return A promise that thens the `CKRecord` for the current user or `nil` + if there is no current user. +*/ +- (AnyPromise *)fetchUserRecordID NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+AnyPromise.m new file mode 100644 index 0000000..85aee80 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+AnyPromise.m @@ -0,0 +1,71 @@ +#import +#import "CKContainer+AnyPromise.h" + +@implementation CKContainer (PromiseKit) + +- (AnyPromise *)accountStatus { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self accountStatusWithCompletionHandler:^(CKAccountStatus accountStatus, NSError *error) { + resolve(error ?: @(accountStatus)); + }]; + }]; +} + +- (AnyPromise *)requestApplicationPermission:(CKApplicationPermissions)permissions { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self requestApplicationPermission:permissions completionHandler:^(CKApplicationPermissionStatus status, NSError *error) { + resolve(error ?: @(status)); + }]; + }]; +} + +- (AnyPromise *)statusForApplicationPermission:(CKApplicationPermissions)applicationPermission { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self statusForApplicationPermission:applicationPermission completionHandler:^(CKApplicationPermissionStatus status, NSError *error) { + resolve(error ?: @(status)); + }]; + }]; +} + +#if !(TARGET_OS_TV && (TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR)) +#if TARGET_OS_WATCH +- (AnyPromise *)discoverAllIdentities { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self discoverAllIdentitiesWithCompletionHandler:^(NSArray *userInfos, NSError *error) { + resolve(error ?: userInfos); + }]; + }]; +} +#else +- (AnyPromise *)discoverAllContactUserInfos { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self discoverAllIdentitiesWithCompletionHandler:^(NSArray *userInfos, NSError *error) { + resolve(error ?: userInfos); + }]; + }]; +} +#endif +#endif + +- (AnyPromise *)discoverUserInfo:(id)input { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + void (^adapter)(id, id) = ^(id value, id error){ + resolve(error ?: error); + }; + if ([input isKindOfClass:[CKRecordID class]]) { + [self discoverUserIdentityWithUserRecordID:input completionHandler:adapter]; + } else { + [self discoverUserIdentityWithEmailAddress:input completionHandler:adapter]; + } + }]; +} + +- (AnyPromise *)fetchUserRecordID { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self fetchUserRecordIDWithCompletionHandler:^(CKRecordID *recordID, NSError *error) { + resolve(error ?: recordID); + }]; + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+Promise.swift new file mode 100644 index 0000000..42ecd98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKContainer+Promise.swift @@ -0,0 +1,79 @@ +import CloudKit +#if !PMKCocoaPods +import PromiseKit +#endif + +#if swift(>=4.2) +#else +public extension CKRecord { + typealias ID = CKRecordID +} +public typealias CKContainer_Application_Permissions = CKApplicationPermissions +public typealias CKContainer_Application_PermissionStatus = CKApplicationPermissionStatus +#endif + +/** + To import the `CKContainer` category: + + use_frameworks! + pod "PromiseKit/CloudKit" + + And then in your sources: + + @import PromiseKit; +*/ +extension CKContainer { + /// Reports whether the current user’s iCloud account can be accessed. + public func accountStatus() -> Promise { + return Promise { accountStatus(completionHandler: $0.resolve) } + } + + /// Requests the specified permission from the user asynchronously. + public func requestApplicationPermission(_ applicationPermissions: CKContainer_Application_Permissions) -> Promise { + return Promise { requestApplicationPermission(applicationPermissions, completionHandler: $0.resolve) } + } + + /// Checks the status of the specified permission asynchronously. + public func status(forApplicationPermission applicationPermissions: CKContainer_Application_Permissions) -> Promise { + return Promise { status(forApplicationPermission: applicationPermissions, completionHandler: $0.resolve) } + } + +#if !os(tvOS) + /// Retrieves information about all discoverable users that are known to the current user. + @available(*, deprecated) + public func discoverAllContactUserInfos() -> Promise<[CKUserIdentity]> { + return Promise { discoverAllIdentities(completionHandler: $0.resolve) } + } + + public func discoverAllIdentities() -> Promise<[CKUserIdentity]> { + return Promise { discoverAllIdentities(completionHandler: $0.resolve) } + } +#endif + + /// Retrieves information about a single user based on that user’s email address. + @available(*, deprecated) + public func discoverUserInfo(withEmailAddress email: String) -> Promise { + return Promise { discoverUserIdentity(withEmailAddress: email, completionHandler: $0.resolve) } + } + + /// Retrieves information about a single user based on that user’s email address. + public func discoverUserIdentity(withEmailAddress email: String) -> Promise { + return Promise { discoverUserIdentity(withEmailAddress: email, completionHandler: $0.resolve) } + } + + /// Retrieves information about a single user based on the ID of the corresponding user record. + @available(*, deprecated) + public func discoverUserInfo(withUserRecordID recordID: CKRecord.ID) -> Promise { + return Promise { discoverUserIdentity(withUserRecordID: recordID, completionHandler: $0.resolve) } + } + + /// Retrieves information about a single user based on the ID of the corresponding user record. + public func discoverUserIdentity(withUserRecordID recordID: CKRecord.ID) -> Promise { + return Promise { discoverUserIdentity(withUserRecordID: recordID, completionHandler: $0.resolve) } + } + + /// Returns the user record ID associated with the current user. + public func fetchUserRecordID() -> Promise { + return Promise { fetchUserRecordID(completionHandler: $0.resolve) } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+AnyPromise.h new file mode 100644 index 0000000..c0f8959 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+AnyPromise.h @@ -0,0 +1,46 @@ +#import +#import + +/** + To import the `CKDatabase` category: + + use_frameworks! + pod "PromiseKit/CloudKit" + + And then in your sources: + + @import PromiseKit; +*/ +@interface CKDatabase (PromiseKit) + +/// Fetches one record asynchronously from the current database. +- (AnyPromise *)fetchRecordWithID:(CKRecordID *)recordID NS_REFINED_FOR_SWIFT; +/// Saves one record zone asynchronously to the current database. +- (AnyPromise *)saveRecord:(CKRecord *)record NS_REFINED_FOR_SWIFT; +/// Delete one subscription object asynchronously from the current database. +- (AnyPromise *)deleteRecordWithID:(CKRecordID *)recordID NS_REFINED_FOR_SWIFT; + +/// Searches the specified zone asynchronously for records that match the query parameters. +- (AnyPromise *)performQuery:(CKQuery *)query inZoneWithID:(CKRecordZoneID *)zoneID NS_REFINED_FOR_SWIFT; + +/// Fetches all record zones asynchronously from the current database. +- (AnyPromise *)fetchAllRecordZones NS_REFINED_FOR_SWIFT; +/// Fetches one record asynchronously from the current database. +- (AnyPromise *)fetchRecordZoneWithID:(CKRecordZoneID *)zoneID NS_REFINED_FOR_SWIFT; +/// Saves one record zone asynchronously to the current database. +- (AnyPromise *)saveRecordZone:(CKRecordZone *)zone NS_REFINED_FOR_SWIFT; +/// Delete one subscription object asynchronously from the current database. +- (AnyPromise *)deleteRecordZoneWithID:(CKRecordZoneID *)zoneID NS_REFINED_FOR_SWIFT; + +#if !(TARGET_OS_WATCH && (TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR)) +/// Fetches one record asynchronously from the current database. +- (AnyPromise *)fetchSubscriptionWithID:(NSString *)subscriptionID NS_REFINED_FOR_SWIFT; +/// Fetches all subscription objects asynchronously from the current database. +- (AnyPromise *)fetchAllSubscriptions NS_REFINED_FOR_SWIFT; +/// Saves one subscription object asynchronously to the current database. +- (AnyPromise *)saveSubscription:(CKSubscription *)subscription NS_REFINED_FOR_SWIFT; +/// Delete one subscription object asynchronously from the current database. +- (AnyPromise *)deleteSubscriptionWithID:(NSString *)subscriptionID NS_REFINED_FOR_SWIFT; +#endif + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+AnyPromise.m new file mode 100644 index 0000000..6f766dd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+AnyPromise.m @@ -0,0 +1,41 @@ +#import "CKDatabase+AnyPromise.h" + +@implementation CKDatabase (PromiseKit) + +#define mkmethod1(method) \ +- (AnyPromise *)method { \ + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { \ + [self method ## WithCompletionHandler:^(id a, id b){ \ + resolve(b ?: a); \ + }]; \ + }]; \ +} + +#define mkmethod2(method) \ +- (AnyPromise *)method { \ + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { \ + [self method completionHandler:^(id a, id b){ \ + resolve(b ?: a); \ + }]; \ + }]; \ +} + +mkmethod2(fetchRecordWithID:(CKRecordID *)recordID); +mkmethod2(saveRecord:(CKRecord *)record); +mkmethod2(deleteRecordWithID:(CKRecordID *)recordID); + +mkmethod2(performQuery:(CKQuery *)query inZoneWithID:(CKRecordZoneID *)zoneID); + +mkmethod1(fetchAllRecordZones); +mkmethod2(fetchRecordZoneWithID:(CKRecordZoneID *)zoneID); +mkmethod2(saveRecordZone:(CKRecordZone *)zone); +mkmethod2(deleteRecordZoneWithID:(CKRecordZoneID *)zoneID); + +#if !(TARGET_OS_WATCH && (TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR)) +mkmethod2(fetchSubscriptionWithID:(NSString *)subscriptionID); +mkmethod1(fetchAllSubscriptions); +mkmethod2(saveSubscription:(CKSubscription *)subscription); +mkmethod2(deleteSubscriptionWithID:(NSString *)subscriptionID); +#endif + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+Promise.swift new file mode 100644 index 0000000..9d3ec9c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/CKDatabase+Promise.swift @@ -0,0 +1,91 @@ +import CloudKit.CKDatabase +#if !PMKCocoaPods +import PromiseKit +#endif + +#if swift(>=4.2) +#else +public extension CKRecordZone { + typealias ID = CKRecordZoneID +} +#endif + +/** + To import the `CKDatabase` category: + + use_frameworks! + pod "PromiseKit/CloudKit" + + And then in your sources: + + @import PromiseKit; +*/ +extension CKDatabase { + /// Fetches one record asynchronously from the current database. + public func fetch(withRecordID recordID: CKRecord.ID) -> Promise { + return Promise { fetch(withRecordID: recordID, completionHandler: $0.resolve) } + } + + /// Fetches one record zone asynchronously from the current database. + public func fetch(withRecordZoneID recordZoneID: CKRecordZone.ID) -> Promise { + return Promise { fetch(withRecordZoneID: recordZoneID, completionHandler: $0.resolve) } + } + /// Fetches all record zones asynchronously from the current database. + public func fetchAllRecordZones() -> Promise<[CKRecordZone]> { + return Promise { fetchAllRecordZones(completionHandler: $0.resolve) } + } + + /// Saves one record zone asynchronously to the current database. + public func save(_ record: CKRecord) -> Promise { + return Promise { save(record, completionHandler: $0.resolve) } + } + + /// Saves one record zone asynchronously to the current database. + public func save(_ recordZone: CKRecordZone) -> Promise { + return Promise { save(recordZone, completionHandler: $0.resolve) } + } + + /// Delete one subscription object asynchronously from the current database. + public func delete(withRecordID recordID: CKRecord.ID) -> Promise { + return Promise { delete(withRecordID: recordID, completionHandler: $0.resolve) } + } + + /// Delete one subscription object asynchronously from the current database. + public func delete(withRecordZoneID zoneID: CKRecordZone.ID) -> Promise { + return Promise { delete(withRecordZoneID: zoneID, completionHandler: $0.resolve) } + } + + /// Searches the specified zone asynchronously for records that match the query parameters. + public func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID? = nil) -> Promise<[CKRecord]> { + return Promise { perform(query, inZoneWith: zoneID, completionHandler: $0.resolve) } + } + + /// Fetches the record for the current user. + public func fetchUserRecord(_ container: CKContainer = CKContainer.default()) -> Promise { + return container.fetchUserRecordID().then(on: nil) { uid in + return self.fetch(withRecordID: uid) + } + } + +#if !os(watchOS) + /// Fetches one record zone asynchronously from the current database. + public func fetch(withSubscriptionID subscriptionID: String) -> Promise { + return Promise { fetch(withSubscriptionID: subscriptionID, completionHandler: $0.resolve) } + } + + /// Fetches all subscription objects asynchronously from the current database. + public func fetchAllSubscriptions() -> Promise<[CKSubscription]> { + return Promise { fetchAllSubscriptions(completionHandler: $0.resolve) } + } + + /// Saves one subscription object asynchronously to the current database. + public func save(_ subscription: CKSubscription) -> Promise { + return Promise { save(subscription, completionHandler: $0.resolve) } + } + + /// Delete one subscription object asynchronously from the current database. + public func delete(withSubscriptionID subscriptionID: String) -> Promise { + return Promise { delete(withSubscriptionID: subscriptionID, completionHandler: $0.resolve) } + } +#endif +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/PMKCloudKit.h b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/PMKCloudKit.h new file mode 100644 index 0000000..3a83180 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Sources/PMKCloudKit.h @@ -0,0 +1,2 @@ +#import "CKContainer+AnyPromise.h" +#import "CKDatabase+AnyPromise.h" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/TestCloudKit.swift b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/TestCloudKit.swift new file mode 100644 index 0000000..ca96fd2 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/TestCloudKit.swift @@ -0,0 +1,146 @@ +import PMKCloudKit +import XCTest + +//TODO possibly we should interpret eg. request permission result of Denied as error +// PMK should only resolve with values that allow a typical chain to proceed + +class Test_CKContainer_Swift: XCTestCase { + + func test_accountStatus() { + class MockContainer: CKContainer { + init(_: Bool = false) + {} + + override func accountStatus(completionHandler: @escaping (CKAccountStatus, Error?) -> Void) { + completionHandler(.couldNotDetermine, nil) + } + } + + let ex = expectation(description: "") + MockContainer().accountStatus().done { status in + XCTAssertEqual(status, CKAccountStatus.couldNotDetermine) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func test_requestApplicationPermission() { + class MockContainer: CKContainer { + init(_: Bool = false) + {} + + override func requestApplicationPermission(_ applicationPermission: CKApplicationPermissions, completionHandler: @escaping CKApplicationPermissionBlock) { + completionHandler(.granted, nil) + } + } + + let ex = expectation(description: "") + let pp = CKApplicationPermissions.userDiscoverability + MockContainer().requestApplicationPermission(pp).done { perms in + XCTAssertEqual(perms, CKApplicationPermissionStatus.granted) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func test_statusForApplicationPermission() { + class MockContainer: CKContainer { + init(_: Bool = false) + {} + + override func status(forApplicationPermission applicationPermission: CKApplicationPermissions, completionHandler: @escaping CKApplicationPermissionBlock) { + completionHandler(.granted, nil) + } + } + + let ex = expectation(description: "") + let pp = CKApplicationPermissions.userDiscoverability + MockContainer().status(forApplicationPermission: pp).done { + XCTAssertEqual($0, CKApplicationPermissionStatus.granted) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + +#if !os(tvOS) + func test_discoverAllContactUserInfos() { + class MockContainer: CKContainer { + init(_: Bool = false) + {} + + override func discoverAllIdentities(completionHandler: @escaping ([CKUserIdentity]?, Error?) -> Void) { + completionHandler([PMKDiscoveredUserInfo()], nil) + } + } + + let ex = expectation(description: "") + MockContainer().discoverAllIdentities().done { + XCTAssertEqual($0, [PMKDiscoveredUserInfo()]) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } +#endif + + func test_discoverUserInfoWithEmailAddress() { + class MockContainer: CKContainer { + init(_: Bool = false) + {} + + override func discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) { + completionHandler(PMKDiscoveredUserInfo(), nil) + } + } + + let ex = expectation(description: "") + MockContainer().discoverUserIdentity(withEmailAddress: "mxcl@me.com").done { + XCTAssertEqual($0, PMKDiscoveredUserInfo()) + ex.fulfill() + } + waitForExpectations(timeout: 1, handler: nil) + } + + func test_discoverUserInfoWithRecordID() { + class MockContainer: CKContainer { + init(_: Bool = false) + {} + + override func discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping (CKUserIdentity?, Error?) -> Void) { + completionHandler(PMKDiscoveredUserInfo(), nil) + } + } + + let ex = expectation(description: "") + MockContainer().discoverUserIdentity(withUserRecordID: dummy()).done { + XCTAssertEqual($0, PMKDiscoveredUserInfo()) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func test_fetchUserRecordID() { + class MockContainer: CKContainer { + init(_: Bool = false) + {} + + override func fetchUserRecordID(completionHandler: @escaping (CKRecordID?, Error?) -> Void) { + completionHandler(dummy(), nil) + } + } + + let ex = expectation(description: "") + MockContainer().fetchUserRecordID().done { + XCTAssertEqual($0, dummy()) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } +} + + + +/////////////////////////////////////////////////////////////// resources + +private func dummy() -> CKRecordID { + return CKRecordID(recordName: "foo") +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/infrastructure.h b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/infrastructure.h new file mode 100644 index 0000000..811cd49 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/infrastructure.h @@ -0,0 +1,2 @@ +@class CKUserIdentity; +extern CKUserIdentity *PMKDiscoveredUserInfo(); diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/infrastructure.m b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/infrastructure.m new file mode 100644 index 0000000..c940c19 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CloudKit/Tests/infrastructure.m @@ -0,0 +1,5 @@ +@import CloudKit; + +CKUserIdentity *PMKDiscoveredUserInfo() { + return [CKUserIdentity alloc]; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/.travis.yml new file mode 100644 index 0000000..9014cda --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/.travis.yml @@ -0,0 +1,14 @@ +language: objective-c +osx_image: xcode9.4 +env: + - DESTINATION="arch=x86_64" PLATFORM=Mac + - DESTINATION="OS=11.4,name=iPhone 5s" PLATFORM=iOS +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLATFORM --verbose +install: + - xcodebuild -scheme PMKCoreBluetooth -destination "$DESTINATION" build +script: + - xcodebuild -scheme PMKCoreBluetooth -destination "$DESTINATION" test diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.pbxproj new file mode 100644 index 0000000..84b3d63 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.pbxproj @@ -0,0 +1,447 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63C7FFF71D5C020D003BAE60 /* PMKCoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKCoreBluetooth.framework */; }; + 63D3789F1D5D5AEC005B0A44 /* CBCentralManager+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D3789E1D5D5AEC005B0A44 /* CBCentralManager+Promise.swift */; }; + 63D40DFB1D61290800E91E6E /* CBTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D40DFA1D61290800E91E6E /* CBTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKCoreBluetooth; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKCoreBluetooth.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKCoreBluetooth.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKCBTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKCBTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63D3789E1D5D5AEC005B0A44 /* CBCentralManager+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CBCentralManager+Promise.swift"; path = "Sources/CBCentralManager+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63D40DFA1D61290800E91E6E /* CBTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CBTests.swift; path = Tests/CBTests.swift; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKCoreBluetooth.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKCoreBluetooth.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKCBTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63D3789E1D5D5AEC005B0A44 /* CBCentralManager+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63D40DFA1D61290800E91E6E /* CBTests.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKCoreBluetooth */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKCoreBluetooth" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKCoreBluetooth; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKCoreBluetooth.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKCBTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKCBTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKCBTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKCBTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKCoreBluetooth" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKCoreBluetooth */, + 63C7FFF11D5C020D003BAE60 /* PMKCBTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63D3789F1D5D5AEC005B0A44 /* CBCentralManager+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63D40DFB1D61290800E91E6E /* CBTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKCoreBluetooth */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.CoreBluetooth; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.CoreBluetooth; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKCoreBluetooth" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKCoreBluetooth" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKCBTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/xcshareddata/xcschemes/PMKCoreBluetooth.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/xcshareddata/xcschemes/PMKCoreBluetooth.xcscheme new file mode 100644 index 0000000..20ad62b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/PMKCoreBluetooth.xcodeproj/xcshareddata/xcschemes/PMKCoreBluetooth.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/README.markdown new file mode 100644 index 0000000..54e84d6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/README.markdown @@ -0,0 +1,38 @@ +# DEPRECATED + +THe promises provided here are not-sensible. You should use a full delegate pattern for CoreBluetooth, one shot listening for connectivity is not wise since the accessory may disconnect at any time. + +# PromiseKit CoreBluetooth Extensions ![Build Status] + +This project adds promises to Apple’s CoreBluetooth framework. + +## CocoaPods + +```ruby +pod "PromiseKit/CoreBluetooth" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/CoreBluetooth" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKCoreBluetooth +``` + +```objc +// objc +@import PromiseKit; +@import PMKCoreBluetooth; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/CoreBluetooth.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Sources/CBCentralManager+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Sources/CBCentralManager+Promise.swift new file mode 100644 index 0000000..01e9ddc --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Sources/CBCentralManager+Promise.swift @@ -0,0 +1,29 @@ +import CoreBluetooth +#if !PMKCocoaPods +import PromiseKit +#endif + + +private class CentralManager: CBCentralManager, CBCentralManagerDelegate { + var retainCycle: CentralManager? + let (promise, fulfill) = Guarantee.pending() + + @objc func centralManagerDidUpdateState(_ manager: CBCentralManager) { + if manager.state != .unknown { + fulfill(manager) + } + } +} + +extension CBCentralManager { + /// A promise that fulfills when the state of CoreBluetooth changes + public class func state(options: [String: Any]? = [CBCentralManagerOptionShowPowerAlertKey: false]) -> Guarantee { + let manager = CentralManager(delegate: nil, queue: nil, options: options) + manager.delegate = manager + manager.retainCycle = manager + manager.promise.done { _ in + manager.retainCycle = nil + } + return manager.promise + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Tests/CBTests.swift b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Tests/CBTests.swift new file mode 100644 index 0000000..1563156 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreBluetooth/Tests/CBTests.swift @@ -0,0 +1,10 @@ +import PMKCoreBluetooth +import CoreBluetooth +import XCTest + +class PMKCBTestCase: XCTestCase { + func test() { + // just test linking etc. + CBCentralManager.state() + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/.travis.yml new file mode 100644 index 0000000..f596aee --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/.travis.yml @@ -0,0 +1,84 @@ +branches: + only: + - master +stages: + - lint + - carthage + - test +jobs: + include: + - &pod + stage: lint + osx_image: xcode8.3 + env: SWIFT=3.1 + name: pod lib lint --swift-version=3.1 + os: osx + language: objective-c + before_install: + gem install cocoapods --prerelease --version 1.6.0.beta.1 + install: + carthage bootstrap --no-build PromiseKit + script: | + cd Carthage/Checkouts/PromiseKit + mv .github/PromiseKit.podspec . + rm -rf Extensions/CoreLocation/Sources + cp -R ../../../Sources Extensions/CoreLocation + pod lib lint --subspec=PromiseKit/CoreLocation --fail-fast --swift-version=$SWIFT + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=3.2 + name: pod lib lint --swift-version=3.2 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=3.3 + name: pod lib lint --swift-version=3.3 + - <<: *pod + osx_image: xcode10 + env: SWIFT=3.4 + name: pod lib lint --swift-version=3.4 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=4.0 + name: pod lib lint --swift-version=4.0 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=4.1 + name: pod lib lint --swift-version=4.1 + - <<: *pod + osx_image: xcode10 + env: SWIFT=4.2 + name: pod lib lint --swift-version=4.2 + + - stage: carthage + osx_image: xcode10 + name: Carthage / watchOS + os: osx + language: objective-c + script: + carthage bootstrap --platform watchOS + cache: + directories: + - Carthage + + - &test + stage: test + osx_image: xcode10 + name: macOS Tests + env: DST='arch=x86_64' PLAT=macOS + os: osx + language: objective-c + cache: + directories: + - Carthage + before_install: + carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT + install: + xcodebuild -scheme PMKCoreLocation -target PMKCoreLocation -quiet -destination "$DST" SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: + xcodebuild -scheme PMKCoreLocation -quiet -destination "$DST" test + - <<: *test + env: DST='OS=12.0,name=iPhone SE' PLAT=iOS + name: iOS Tests + - <<: *test + env: DST='OS=12.0,name=Apple TV' PLAT=tvOS + name: tvOS Tests diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Cartfile.resolved new file mode 100644 index 0000000..d903612 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.5.0" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1f8f467 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.pbxproj @@ -0,0 +1,473 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63199F0C1D5FF25C007E8A0E /* CLGeocoder+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 63199F061D5FF25C007E8A0E /* CLGeocoder+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63199F0D1D5FF25C007E8A0E /* CLGeocoder+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63199F071D5FF25C007E8A0E /* CLGeocoder+AnyPromise.m */; }; + 63199F0E1D5FF25C007E8A0E /* CLGeocoder+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63199F081D5FF25C007E8A0E /* CLGeocoder+Promise.swift */; }; + 63199F0F1D5FF25C007E8A0E /* CLLocationManager+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 63199F091D5FF25C007E8A0E /* CLLocationManager+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63199F101D5FF25C007E8A0E /* CLLocationManager+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63199F0A1D5FF25C007E8A0E /* CLLocationManager+AnyPromise.m */; }; + 63199F111D5FF25C007E8A0E /* CLLocationManager+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63199F0B1D5FF25C007E8A0E /* CLLocationManager+Promise.swift */; }; + 63199F161D5FF7B9007E8A0E /* CLGeocoderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63199F141D5FF7B9007E8A0E /* CLGeocoderTests.swift */; }; + 63199F171D5FF7B9007E8A0E /* CLLocationManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63199F151D5FF7B9007E8A0E /* CLLocationManagerTests.swift */; }; + 6358AB7A1D5D4B6700B9B157 /* PMKCoreLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 6358AB791D5D4B6700B9B157 /* PMKCoreLocation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63C7FFF71D5C020D003BAE60 /* PMKCoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKCoreLocation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKCoreLocation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63199F061D5FF25C007E8A0E /* CLGeocoder+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CLGeocoder+AnyPromise.h"; path = "Sources/CLGeocoder+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 63199F071D5FF25C007E8A0E /* CLGeocoder+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CLGeocoder+AnyPromise.m"; path = "Sources/CLGeocoder+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63199F081D5FF25C007E8A0E /* CLGeocoder+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CLGeocoder+Promise.swift"; path = "Sources/CLGeocoder+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63199F091D5FF25C007E8A0E /* CLLocationManager+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CLLocationManager+AnyPromise.h"; path = "Sources/CLLocationManager+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 63199F0A1D5FF25C007E8A0E /* CLLocationManager+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CLLocationManager+AnyPromise.m"; path = "Sources/CLLocationManager+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63199F0B1D5FF25C007E8A0E /* CLLocationManager+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CLLocationManager+Promise.swift"; path = "Sources/CLLocationManager+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63199F141D5FF7B9007E8A0E /* CLGeocoderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CLGeocoderTests.swift; path = Tests/CLGeocoderTests.swift; sourceTree = SOURCE_ROOT; }; + 63199F151D5FF7B9007E8A0E /* CLLocationManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CLLocationManagerTests.swift; path = Tests/CLLocationManagerTests.swift; sourceTree = SOURCE_ROOT; }; + 6358AB791D5D4B6700B9B157 /* PMKCoreLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKCoreLocation.h; path = Sources/PMKCoreLocation.h; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKCoreLocation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKCoreLocation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKCLTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKCLTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKCoreLocation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKCoreLocation.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKCLTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 6358AB791D5D4B6700B9B157 /* PMKCoreLocation.h */, + 63199F061D5FF25C007E8A0E /* CLGeocoder+AnyPromise.h */, + 63199F071D5FF25C007E8A0E /* CLGeocoder+AnyPromise.m */, + 63199F081D5FF25C007E8A0E /* CLGeocoder+Promise.swift */, + 63199F091D5FF25C007E8A0E /* CLLocationManager+AnyPromise.h */, + 63199F0A1D5FF25C007E8A0E /* CLLocationManager+AnyPromise.m */, + 63199F0B1D5FF25C007E8A0E /* CLLocationManager+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63199F141D5FF7B9007E8A0E /* CLGeocoderTests.swift */, + 63199F151D5FF7B9007E8A0E /* CLLocationManagerTests.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 63199F0F1D5FF25C007E8A0E /* CLLocationManager+AnyPromise.h in Headers */, + 63199F0C1D5FF25C007E8A0E /* CLGeocoder+AnyPromise.h in Headers */, + 6358AB7A1D5D4B6700B9B157 /* PMKCoreLocation.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKCoreLocation */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKCoreLocation" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKCoreLocation; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKCoreLocation.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKCLTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKCLTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKCLTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKCLTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKCoreLocation" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKCoreLocation */, + 63C7FFF11D5C020D003BAE60 /* PMKCLTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63199F0E1D5FF25C007E8A0E /* CLGeocoder+Promise.swift in Sources */, + 63199F101D5FF25C007E8A0E /* CLLocationManager+AnyPromise.m in Sources */, + 63199F0D1D5FF25C007E8A0E /* CLGeocoder+AnyPromise.m in Sources */, + 63199F111D5FF25C007E8A0E /* CLLocationManager+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63199F161D5FF7B9007E8A0E /* CLGeocoderTests.swift in Sources */, + 63199F171D5FF7B9007E8A0E /* CLLocationManagerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKCoreLocation */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.CoreLocation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.CoreLocation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKCoreLocation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKCoreLocation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKCLTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/xcshareddata/xcschemes/PMKCoreLocation.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/xcshareddata/xcschemes/PMKCoreLocation.xcscheme new file mode 100644 index 0000000..13e642b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/PMKCoreLocation.xcodeproj/xcshareddata/xcschemes/PMKCoreLocation.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/README.markdown new file mode 100644 index 0000000..7268a7d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit CoreLocation Extensions ![Build Status] + +This project adds promises to Apple’s MapKit framework. + +## CocoaPods + +```ruby +pod "PromiseKit/CoreLocation", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/CoreLocation" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKCoreLocation +``` + +```objc +// objc +@import PromiseKit; +@import PMKCoreLocation; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/CoreLocation.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+AnyPromise.h new file mode 100644 index 0000000..c2db32b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+AnyPromise.h @@ -0,0 +1,40 @@ +#import +#import + +/** + To import the `CLGecoder` category: + + use_frameworks! + pod "PromiseKit/CoreLocation" + + And then in your sources: + + @import PromiseKit; +*/ +@interface CLGeocoder (PromiseKit) + +/** + Submits a reverse-geocoding request for the specified location. + + @param location The location object containing the coordinate data to look up. + + @return A promise that thens two parameters: + + 1. The first placemark that resides at the specified location. + 2. The array of *all* placemarks that reside at the specified location. +*/ +- (AnyPromise *)reverseGeocode:(CLLocation *)location NS_REFINED_FOR_SWIFT; + +/** + Submits a forward-geocoding request using the specified address dictionary or address string. + + @param addressDictionaryOrAddressString The address dictionary or address string to look up. + + @return A promise that thens two parameters: + + 1. The first placemark that resides at the specified address. + 2. The array of *all* placemarks that reside at the specified address. +*/ +- (AnyPromise *)geocode:(id)addressDictionaryOrAddressString NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+AnyPromise.m new file mode 100644 index 0000000..5b19f7a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+AnyPromise.m @@ -0,0 +1,47 @@ +#import "CLGeocoder+AnyPromise.h" +#import +#import +#import + + +@implementation CLGeocoder (PromiseKit) + +- (AnyPromise *)reverseGeocode:(CLLocation *)location { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) { + resolve(error ?: PMKManifold(placemarks.firstObject, placemarks)); + }]; + }]; +} + +- (AnyPromise *)geocode:(id)address { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + id handler = ^(NSArray *placemarks, NSError *error) { + resolve(error ?: PMKManifold(placemarks.firstObject, placemarks)); + }; + if ([address isKindOfClass:[NSDictionary class]]) { + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + [self geocodeAddressDictionary:address completionHandler:handler]; + #pragma clang diagnostic pop + } else { + [self geocodeAddressString:address completionHandler:handler]; + } + }]; +} + +@end + + + +@implementation CLGeocoder (PMKDeprecated) + ++ (AnyPromise *)reverseGeocode:(CLLocation *)location { + return [[CLGeocoder new] reverseGeocode:location]; +} + ++ (AnyPromise *)geocode:(id)input { + return [[CLGeocoder new] geocode:input]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+Promise.swift new file mode 100644 index 0000000..e80bcee --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLGeocoder+Promise.swift @@ -0,0 +1,73 @@ +import CoreLocation.CLGeocoder +#if !PMKCocoaPods +import PromiseKit +#endif +#if os(iOS) || os(watchOS) || os(OSX) +import class Contacts.CNPostalAddress +#endif + +/** + To import the `CLGeocoder` category: + + use_frameworks! + pod "PromiseKit/CoreLocation" + + And then in your sources: + + import PromiseKit +*/ +extension CLGeocoder { + /// Submits a reverse-geocoding request for the specified location. + public func reverseGeocode(location: CLLocation) -> Promise<[CLPlacemark]> { + return Promise { seal in + reverseGeocodeLocation(location, completionHandler: seal.resolve) + } + } + + /// Submits a forward-geocoding request using the specified address dictionary. + @available(iOS, deprecated: 11.0) + public func geocode(_ addressDictionary: [String: String]) -> Promise<[CLPlacemark]> { + return Promise { seal in + geocodeAddressDictionary(addressDictionary, completionHandler: seal.resolve) + } + } + + /// Submits a forward-geocoding request using the specified address string. + public func geocode(_ addressString: String) -> Promise<[CLPlacemark]> { + return Promise { seal in + geocodeAddressString(addressString, completionHandler: seal.resolve) + } + } + + /// Submits a forward-geocoding request using the specified address string within the specified region. + public func geocode(_ addressString: String, region: CLRegion?) -> Promise<[CLPlacemark]> { + return Promise { seal in + geocodeAddressString(addressString, in: region, completionHandler: seal.resolve) + } + } + +#if !os(tvOS) && swift(>=3.2) + /// Submits a forward-geocoding request using the specified postal address. + @available(iOS 11.0, OSX 10.13, watchOS 4.0, *) + public func geocodePostalAddress(_ postalAddress: CNPostalAddress) -> Promise<[CLPlacemark]> { + return Promise { seal in + geocodePostalAddress(postalAddress, completionHandler: seal.resolve) + } + } + + /// Submits a forward-geocoding requesting using the specified locale and postal address + @available(iOS 11.0, OSX 10.13, watchOS 4.0, *) + public func geocodePostalAddress(_ postalAddress: CNPostalAddress, preferredLocale locale: Locale?) -> Promise<[CLPlacemark]> { + return Promise { seal in + geocodePostalAddress(postalAddress, preferredLocale: locale, completionHandler: seal.resolve) + } + } +#endif +} + +// TODO still not possible in Swift 3.2 +//extension CLError: CancellableError { +// public var isCancelled: Bool { +// return self == .geocodeCanceled +// } +//} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+AnyPromise.h new file mode 100644 index 0000000..3064967 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+AnyPromise.h @@ -0,0 +1,46 @@ +#import +#import + +/** + To import the `CLLocationManager` category: + + use_frameworks! + pod "PromiseKit/CoreLocation" + + And then in your sources: + + @import PromiseKit; +*/ +@interface CLLocationManager (PromiseKit) + +/** + Determines the device’s location waiting until the positional accuracy + of the measured locations is better than 500 meters. + + If your app has not yet asked the user for locational determination + permissions, PromiseKit calls `+requestWhenInUseAuthorization`, if + you need always permissions, you must call this yourself before + any use of this method, or the promise will be rejected. + + @return A promise that thens two parameters: + + 1. The most recent `CLLocation`. + 2. An array of all recent `CLLocations`. +*/ ++ (AnyPromise *)promise NS_REFINED_FOR_SWIFT; + + +/** + Determines the device’s location using the provided block to determine + when locations become acceptably accurate. + + With this variant you can wait for good accuracy or acceptable accuracy + (at your own discretion) if the `CLLocationManager` is taking too + long. For example, the user is not outside so you will never get 10 meter + accuracy, but it would be nice to wait a little just in case. + + - see +promise +*/ ++ (AnyPromise *)until:(BOOL(^)(CLLocation *))isLocationGoodBlock NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+AnyPromise.m new file mode 100644 index 0000000..8266a60 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+AnyPromise.m @@ -0,0 +1,72 @@ +#import +#import "CLLocationManager+AnyPromise.h" +#import + +#if !(TARGET_OS_TV && (TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR)) + +@interface PMKLocationManager : CLLocationManager { +@public + PMKResolver resolve; + id retainCycle; + BOOL (^block)(CLLocation *); +} +@end + +@implementation PMKLocationManager + +#define PMKLocationManagerCleanup() \ + [manager stopUpdatingLocation]; \ + retainCycle = self.delegate = nil; + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { + NSMutableArray *okd = [NSMutableArray new]; + for (id location in locations) + if (block(location)) + [okd addObject:location]; + + if (okd.count) { + resolve(PMKManifold(okd.lastObject, okd)); + PMKLocationManagerCleanup(); + } +} + +- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { + // Apple docs say to ignore this error + if (error.code != kCLErrorLocationUnknown) { + resolve(error); + PMKLocationManagerCleanup(); + } +} + +- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { + [manager startUpdatingLocation]; +} + +@end + + + +@implementation CLLocationManager (PromiseKit) + ++ (AnyPromise *)promise { + return [self until:^BOOL(CLLocation *location){ + return location.horizontalAccuracy <= 500 && location.verticalAccuracy <= 500; + }]; +} + ++ (AnyPromise *)until:(BOOL(^)(CLLocation *))block { + PMKLocationManager *manager = [PMKLocationManager new]; + manager.delegate = manager; + manager->block = block; + manager->retainCycle = manager; +#if TARGET_OS_IPHONE + if ([manager respondsToSelector:@selector(requestWhenInUseAuthorization)]) + [manager requestWhenInUseAuthorization]; +#endif + [manager startUpdatingLocation]; + return [[AnyPromise alloc] initWithResolver:&manager->resolve]; +} + +@end + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+Promise.swift new file mode 100644 index 0000000..83b4d5b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/CLLocationManager+Promise.swift @@ -0,0 +1,307 @@ +import CoreLocation.CLLocationManager +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `CLLocationManager` category: + + use_frameworks! + pod "PromiseKit/CoreLocation" + + And then in your sources: + + import PromiseKit +*/ +extension CLLocationManager { + + /// The type of location permission we are asking for + public enum RequestAuthorizationType { + /// Determine the authorization from the application’s plist + case automatic + /// Request always-authorization + case always + /// Request when-in-use-authorization + case whenInUse + } + + public enum PMKError: Error { + case notAuthorized + } + + /** + Request the current location. + - Note: to obtain a single location use `Promise.lastValue` + - Parameters: + - authorizationType: requestAuthorizationType: We read your Info plist and try to + determine the authorization type we should request automatically. If you + want to force one or the other, change this parameter from its default + value. + - block: A block by which to perform any filtering of the locations that are + returned. In order to only retrieve accurate locations, only return true if the + locations horizontal accuracy < 50 + - Returns: A new promise that fulfills with the most recent CLLocation that satisfies + the provided block if it exists. If the block does not exist, simply return the + last location. + */ + public class func requestLocation(authorizationType: RequestAuthorizationType = .automatic, satisfying block: ((CLLocation) -> Bool)? = nil) -> Promise<[CLLocation]> { + + func std() -> Promise<[CLLocation]> { + return LocationManager(satisfying: block).promise + } + + func auth() -> Promise { + #if os(macOS) + return Promise() + #else + func auth(type: PMKCLAuthorizationType) -> Promise { + return AuthorizationCatcher(type: type).promise.done(on: nil) { + switch $0 { + case .restricted, .denied: + throw PMKError.notAuthorized + default: + break + } + } + } + + switch authorizationType { + case .automatic: + switch Bundle.main.permissionType { + case .always, .both: + return auth(type: .always) + case .whenInUse: + return auth(type: .whenInUse) + } + case .whenInUse: + return auth(type: .whenInUse) + case .always: + return auth(type: .always) + } + #endif + } + + switch CLLocationManager.authorizationStatus() { + case .authorizedAlways, .authorizedWhenInUse: + return std() + case .notDetermined: + return auth().then(std) + case .denied, .restricted: + return Promise(error: PMKError.notAuthorized) + } + } + + @available(*, deprecated: 5.0, renamed: "requestLocation") + public class func promise(_ requestAuthorizationType: RequestAuthorizationType = .automatic, satisfying block: ((CLLocation) -> Bool)? = nil) -> Promise<[CLLocation]> { + return requestLocation(authorizationType: requestAuthorizationType, satisfying: block) + } +} + +private class LocationManager: CLLocationManager, CLLocationManagerDelegate { + let (promise, seal) = Promise<[CLLocation]>.pending() + let satisfyingBlock: ((CLLocation) -> Bool)? + + @objc fileprivate func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { + if let block = satisfyingBlock { + let satisfiedLocations = locations.filter(block) + if !satisfiedLocations.isEmpty { + seal.fulfill(satisfiedLocations) + } else { + #if os(tvOS) + requestLocation() + #endif + } + } else { + seal.fulfill(locations) + } + } + + init(satisfying block: ((CLLocation) -> Bool)? = nil) { + satisfyingBlock = block + super.init() + delegate = self + #if !os(tvOS) + startUpdatingLocation() + #else + requestLocation() + #endif + _ = self.promise.ensure { + self.stopUpdatingLocation() + } + } + + @objc func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { + let (domain, code) = { ($0.domain, $0.code) }(error as NSError) + if code == CLError.locationUnknown.rawValue && domain == kCLErrorDomain { + // Apple docs say you should just ignore this error + } else { + seal.reject(error) + } + } +} + + +#if !os(macOS) + +extension CLLocationManager { + /** + Request CoreLocation authorization from the user + - Note: By default we try to determine the authorization type you want by inspecting your Info.plist + - Note: This method will not perform upgrades from “when-in-use” to “always” unless you specify `.always` for the value of `type`. + */ + @available(iOS 8, tvOS 9, watchOS 2, *) + public class func requestAuthorization(type requestedAuthorizationType: RequestAuthorizationType = .automatic) -> Guarantee { + + let currentStatus = CLLocationManager.authorizationStatus() + + func std(type: PMKCLAuthorizationType) -> Guarantee { + if currentStatus == .notDetermined { + return AuthorizationCatcher(type: type).promise + } else { + return .value(currentStatus) + } + } + + switch requestedAuthorizationType { + case .always: + func iOS11Check() -> Guarantee { + switch currentStatus { + case .notDetermined, .authorizedWhenInUse: + return AuthorizationCatcher(type: .always).promise + default: + return .value(currentStatus) + } + } + #if PMKiOS11 + // ^^ define PMKiOS11 if you deploy against the iOS 11 SDK + // otherwise the warning you get below cannot be removed + return iOS11Check() + #else + if #available(iOS 11, *) { + return iOS11Check() + } else { + return std(type: .always) + } + #endif + + case .whenInUse: + return std(type: .whenInUse) + + case .automatic: + if currentStatus == .notDetermined { + switch Bundle.main.permissionType { + case .both, .whenInUse: + return AuthorizationCatcher(type: .whenInUse).promise + case .always: + return AuthorizationCatcher(type: .always).promise + } + } else { + return .value(currentStatus) + } + } + } +} + +@available(iOS 8, *) +private class AuthorizationCatcher: CLLocationManager, CLLocationManagerDelegate { + let (promise, fulfill) = Guarantee.pending() + var retainCycle: AuthorizationCatcher? + let initialAuthorizationState = CLLocationManager.authorizationStatus() + + init(type: PMKCLAuthorizationType) { + super.init() + + func ask(type: PMKCLAuthorizationType) { + delegate = self + retainCycle = self + + switch type { + case .always: + #if os(tvOS) + fallthrough + #else + requestAlwaysAuthorization() + #endif + case .whenInUse: + requestWhenInUseAuthorization() + } + + promise.done { _ in + self.retainCycle = nil + } + } + + func iOS11Check() { + switch (initialAuthorizationState, type) { + case (.notDetermined, .always), (.authorizedWhenInUse, .always), (.notDetermined, .whenInUse): + ask(type: type) + default: + fulfill(initialAuthorizationState) + } + } + + #if PMKiOS11 + // ^^ define PMKiOS11 if you deploy against the iOS 11 SDK + // otherwise the warning you get below cannot be removed + iOS11Check() + #else + if #available(iOS 11, *) { + iOS11Check() + } else { + if initialAuthorizationState == .notDetermined { + ask(type: type) + } else { + fulfill(initialAuthorizationState) + } + } + #endif + } + + @objc fileprivate func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { + // `didChange` is a lie; it fires this immediately with the current status. + if status != initialAuthorizationState { + fulfill(status) + } + } +} + +#endif + +private extension Bundle { + enum PermissionType { + case both + case always + case whenInUse + } + + var permissionType: PermissionType { + func hasInfoPlistKey(_ key: String) -> Bool { + let value = object(forInfoDictionaryKey: key) as? String ?? "" + return !value.isEmpty + } + + if hasInfoPlistKey("NSLocationAlwaysAndWhenInUseUsageDescription") { + return .both + } + if hasInfoPlistKey("NSLocationAlwaysUsageDescription") { + return .always + } + if hasInfoPlistKey("NSLocationWhenInUseUsageDescription") { + return .whenInUse + } + + if #available(iOS 11, *) { + NSLog("PromiseKit: warning: `NSLocationAlwaysAndWhenInUseUsageDescription` key not set") + } else { + NSLog("PromiseKit: warning: `NSLocationWhenInUseUsageDescription` key not set") + } + + // won't work, but we warned the user above at least + return .whenInUse + } +} + +private enum PMKCLAuthorizationType { + case always + case whenInUse +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/PMKCoreLocation.h b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/PMKCoreLocation.h new file mode 100644 index 0000000..a4ab5c9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Sources/PMKCoreLocation.h @@ -0,0 +1,2 @@ +#import "CLLocationManager+AnyPromise.h" +#import "CLGeocoder+AnyPromise.h" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/CLGeocoderTests.swift b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/CLGeocoderTests.swift new file mode 100644 index 0000000..479a1fd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/CLGeocoderTests.swift @@ -0,0 +1,102 @@ +import PMKCoreLocation +import CoreLocation +import PromiseKit +import XCTest +#if os(iOS) || os(watchOS) || os(OSX) + import class Contacts.CNPostalAddress +#endif + +class CLGeocoderTests: XCTestCase { + func test_reverseGeocodeLocation() { + class MockGeocoder: CLGeocoder { + override func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler) { + after(.seconds(0)).done { + completionHandler([dummyPlacemark], nil) + } + } + } + + let ex = expectation(description: "") + MockGeocoder().reverseGeocode(location: CLLocation()).done { x in + XCTAssertEqual(x, [dummyPlacemark]) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func test_geocodeAddressDictionary() { + class MockGeocoder: CLGeocoder { + override func geocodeAddressDictionary(_ addressDictionary: [AnyHashable : Any], completionHandler: @escaping CLGeocodeCompletionHandler) { + after(.seconds(0)).done { + completionHandler([dummyPlacemark], nil) + } + } + } + + let ex = expectation(description: "") + MockGeocoder().geocode([:]).done { x in + XCTAssertEqual(x, [dummyPlacemark]) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func test_geocodeAddressString() { + class MockGeocoder: CLGeocoder { + override func geocodeAddressString(_ addressString: String, completionHandler: @escaping CLGeocodeCompletionHandler) { + after(.seconds(0)).done { + completionHandler([dummyPlacemark], nil) + } + } + } + + let ex = expectation(description: "") + MockGeocoder().geocode("").done { x in + XCTAssertEqual(x, [dummyPlacemark]) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + +#if !os(tvOS) && swift(>=3.2) + func test_geocodePostalAddress() { + guard #available(iOS 11.0, OSX 10.13, watchOS 4.0, *) else { return } + + class MockGeocoder: CLGeocoder { + override func geocodePostalAddress(_ postalAddress: CNPostalAddress, completionHandler: @escaping CLGeocodeCompletionHandler) { + after(.seconds(0)).done { + completionHandler([dummyPlacemark], nil) + } + } + } + + let ex = expectation(description: "") + MockGeocoder().geocodePostalAddress(CNPostalAddress()).done { x in + XCTAssertEqual(x, [dummyPlacemark]) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func test_geocodePostalAddressLocale() { + guard #available(iOS 11.0, OSX 10.13, watchOS 4.0, *) else { return } + + class MockGeocoder: CLGeocoder { + override func geocodePostalAddress(_ postalAddress: CNPostalAddress, preferredLocale locale: Locale?, completionHandler: @escaping CLGeocodeCompletionHandler) { + after(.seconds(0)).done { + completionHandler([dummyPlacemark], nil) + } + } + } + + let ex = expectation(description: "") + MockGeocoder().geocodePostalAddress(CNPostalAddress(), preferredLocale: nil).done { x in + XCTAssertEqual(x, [dummyPlacemark]) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } +#endif +} + +private let dummyPlacemark = CLPlacemark() diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/CLLocationManagerTests.swift b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/CLLocationManagerTests.swift new file mode 100644 index 0000000..914af86 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/CLLocationManagerTests.swift @@ -0,0 +1,95 @@ +import PMKCoreLocation +import CoreLocation +import PromiseKit +import XCTest + +#if !os(tvOS) + +class Test_CLLocationManager_Swift: XCTestCase { + func test_fulfills_with_multiple_locations() { + swizzle(CLLocationManager.self, #selector(CLLocationManager.startUpdatingLocation)) { + swizzle(CLLocationManager.self, #selector(CLLocationManager.authorizationStatus), isClassMethod: true) { + let ex = expectation(description: "") + + CLLocationManager.requestLocation().done { x in + XCTAssertEqual(x, dummy) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + } + } + + func test_fufillsWithSatisfyingBlock() { + swizzle(CLLocationManager.self, #selector(CLLocationManager.startUpdatingLocation)) { + swizzle(CLLocationManager.self, #selector(CLLocationManager.authorizationStatus), isClassMethod: true) { + let ex = expectation(description: "") + let block: ((CLLocation) -> Bool) = { location in + return location.coordinate.latitude == dummy.last?.coordinate.latitude + } + CLLocationManager.requestLocation(satisfying: block).done({ locations in + locations.forEach { XCTAssert(block($0) == true, "Block should be successful for returned values") } + ex.fulfill() + }) + waitForExpectations(timeout: 1) + } + } + } + +#if os(iOS) + func test_requestAuthorization() { + let ex = expectation(description: "") + + CLLocationManager.requestAuthorization().done { + XCTAssertEqual($0, CLAuthorizationStatus.restricted) + ex.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } +#endif +} + + +/////////////////////////////////////////////////////////////// resources +private let dummy = [CLLocation(latitude: 0, longitude: 0), CLLocation(latitude: 10, longitude: 20)] + +extension CLLocationManager { + @objc func pmk_startUpdatingLocation() { + after(.milliseconds(100)).done { + self.delegate!.locationManager?(self, didUpdateLocations: dummy) + } + } + + @objc static func pmk_authorizationStatus() -> CLAuthorizationStatus { + #if os(macOS) + return .authorized + #else + return .authorizedWhenInUse + #endif + } +} + + +/////////////////////////////////////////////////////////////// utilities +import ObjectiveC + +func swizzle(_ foo: AnyClass, _ from: Selector, isClassMethod: Bool = false, body: () -> Void) { + let originalMethod: Method + let swizzledMethod: Method + + if isClassMethod { + originalMethod = class_getClassMethod(foo, from)! + swizzledMethod = class_getClassMethod(foo, Selector("pmk_\(from)"))! + } else { + originalMethod = class_getInstanceMethod(foo, from)! + swizzledMethod = class_getInstanceMethod(foo, Selector("pmk_\(from)"))! + } + + method_exchangeImplementations(originalMethod, swizzledMethod) + body() + method_exchangeImplementations(swizzledMethod, originalMethod) +} + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/Entitlements.plist b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/Entitlements.plist new file mode 100644 index 0000000..76a15bb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/CoreLocation/Tests/Entitlements.plist @@ -0,0 +1,12 @@ + + + + + com.apple.private.tcc.allow + + kTCCServiceAddressBook + kTCCServiceCalendar + kTCCServicePhotos + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/.travis.yml new file mode 100644 index 0000000..db4a3eb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/.travis.yml @@ -0,0 +1,32 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'SWFT=3.1 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode8.3, env: 'SWFT=3.1 PLAT=iOS DST="OS=10.3.1,name=iPhone SE"'} + + - {osx_image: xcode9.2, env: 'SWFT=3.2 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode9.2, env: 'SWFT=3.2 PLAT=iOS DST="OS=11.2,name=iPhone SE"'} + + - {osx_image: xcode9.4, env: 'SWFT=3.3 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode9.4, env: 'SWFT=3.3 PLAT=iOS DST="OS=11.4,name=iPhone 5s"'} + + - {osx_image: xcode9.2, env: 'SWFT=4.0 PLAT=macOS DST="arch=x86_64"'} + - {osx_image: xcode9.2, env: 'SWFT=4.0 PLAT=iOS DST="OS=11.2,name=iPhone SE"'} + + - {osx_image: xcode9.4, env: 'SWFT=4.1 PLAT=macOS DST="arch=x86_64" TEST=1'} + - {osx_image: xcode9.4, env: 'SWFT=4.1 PLAT=iOS DST="OS=11.4,name=iPhone 5s" TEST=1'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKEventKit -target PMKEventKit -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [[ $TEST == 1 ]]; then + xcodebuild -scheme PMKEventKit -target PMKEKTests -quiet -destination "$DST" build; + fi +script: + - if [[ $TEST == 1 ]]; then + xcodebuild -scheme PMKEventKit -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..01d0253 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.pbxproj @@ -0,0 +1,447 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63C7FFF71D5C020D003BAE60 /* PMKEventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKEventKit.framework */; }; + 63E5176D1D5D58B600742F86 /* EKEventStore+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63E5176C1D5D58B600742F86 /* EKEventStore+Promise.swift */; }; + 63E5176F1D5D58C000742F86 /* TestEventKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63E5176E1D5D58C000742F86 /* TestEventKit.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKEventKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKEventKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKEventKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKEKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKEKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63E5176C1D5D58B600742F86 /* EKEventStore+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "EKEventStore+Promise.swift"; path = "Sources/EKEventStore+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63E5176E1D5D58C000742F86 /* TestEventKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestEventKit.swift; path = Tests/TestEventKit.swift; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKEventKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKEventKit.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKEKTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63E5176C1D5D58B600742F86 /* EKEventStore+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63E5176E1D5D58C000742F86 /* TestEventKit.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKEventKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKEventKit" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKEventKit; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKEventKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKEKTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKEKTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKEKTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKEKTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0920; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0920; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKEventKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKEventKit */, + 63C7FFF11D5C020D003BAE60 /* PMKEKTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63E5176D1D5D58B600742F86 /* EKEventStore+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63E5176F1D5D58C000742F86 /* TestEventKit.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKEventKit */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.EventKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.EventKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKEventKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKEventKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKEKTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/xcshareddata/xcschemes/PMKEventKit.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/xcshareddata/xcschemes/PMKEventKit.xcscheme new file mode 100644 index 0000000..bfc7eec --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/PMKEventKit.xcodeproj/xcshareddata/xcschemes/PMKEventKit.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/README.markdown new file mode 100644 index 0000000..a46fb2b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/README.markdown @@ -0,0 +1,38 @@ +# STALLED + +This project is no longer maintained because its promises and API are not up to standard. You can use it, but we will not maintain it unless the API is improved (feel free to PR!). + +# PromiseKit EventKit Extensions ![Build Status] + +This project adds promises to Apple’s EventKit framework. + +## CocoaPods + +```ruby +pod "PromiseKit/EventKit" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/EventKit" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKEventKit +``` + +```objc +// objc +@import PromiseKit; +@import PMKEventKit; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/EventKit.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Sources/EKEventStore+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Sources/EKEventStore+Promise.swift new file mode 100644 index 0000000..ba6eb3d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Sources/EKEventStore+Promise.swift @@ -0,0 +1,68 @@ +// +// EKEventStore+Promise.swift +// PromiseKit +// +// Created by Lammert Westerhoff on 16/02/16. +// Copyright © 2016 Max Howell. All rights reserved. +// + +import EventKit +#if !PMKCocoaPods +import PromiseKit +#endif + +/// Errors representing PromiseKit EventKit failures +public enum EventKitError: Error, CustomStringConvertible { + /// Access to the EKEventStore is restricted + case restricted + /// Access to the EKEventStore is denied + case denied + + /// A textual description of the EKEventStore error + public var description: String { + switch self { + case .restricted: + return "A head of family must grant calendar access." + case .denied: + return "Calendar access has been denied." + } + } +} + +/** + Requests access to the event store. + + To import `EKEventStore`: + + pod "PromiseKit/EventKit" + + And then in your sources: + + import PromiseKit + + - Returns: A promise that fulfills with the EKEventStore. + */ +public func EKEventStoreRequestAccess() -> Promise { + return Promise { seal in + let eventStore = EKEventStore() + + switch EKEventStore.authorizationStatus(for: .event) { + case .authorized: + seal.fulfill(eventStore) + case .denied: + seal.reject(EventKitError.denied) + case .restricted: + seal.reject(EventKitError.restricted) + case .notDetermined: + eventStore.requestAccess(to: .event) { granted, error in + if granted { + seal.fulfill(eventStore) + } else if let error = error { + seal.reject(error) + } else { + seal.reject(EventKitError.denied) + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Tests/Entitlements.plist b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Tests/Entitlements.plist new file mode 100644 index 0000000..76a15bb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Tests/Entitlements.plist @@ -0,0 +1,12 @@ + + + + + com.apple.private.tcc.allow + + kTCCServiceAddressBook + kTCCServiceCalendar + kTCCServicePhotos + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Tests/TestEventKit.swift b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Tests/TestEventKit.swift new file mode 100644 index 0000000..6a5b0d6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/EventKit/Tests/TestEventKit.swift @@ -0,0 +1,19 @@ +import PMKEventKit +import PromiseKit +import EventKit +import XCTest + +class Test_EventKit_Swift: XCTestCase { + func test() { + #if os(OSX) + //FIXME can't make this succeed on Travis :( + // needs Entitlements, but then I can't get it to sign + // so, we'll just test linkage + EKEventStoreRequestAccess() + #else + let ex = expectation(description: "") + EKEventStoreRequestAccess().ensure(ex.fulfill) + waitForExpectations(timeout: 30) + #endif + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.codecov.yml b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.codecov.yml new file mode 100644 index 0000000..278f3f6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.codecov.yml @@ -0,0 +1,26 @@ +ignore: + - "Tests" + +codecov: + notify: + require_ci_to_pass: yes + +coverage: + precision: 1 + round: up + range: "70...100" + + status: + project: yes + patch: yes + changes: no + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: off diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.gitignore new file mode 100644 index 0000000..30f5004 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.travis.yml new file mode 100644 index 0000000..5c66c8d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/.travis.yml @@ -0,0 +1,125 @@ +branches: + only: + - master +stages: + - lint + - compile + - test +jobs: + include: + - &pod + stage: lint + osx_image: xcode8.3 + env: SWIFT=3.1 + name: pod lib lint --swift-version=3.1 + os: osx + language: objective-c + before_install: + gem install cocoapods --prerelease --version 1.6.0.beta.1 + install: + carthage bootstrap --no-build PromiseKit + script: | + cd Carthage/Checkouts/PromiseKit + mv .github/PromiseKit.podspec . + rm -rf Extensions/Foundation/Sources + cp -R ../../../Sources Extensions/Foundation + pod lib lint --subspec=PromiseKit/Foundation --fail-fast --swift-version=$SWIFT + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=3.2 + name: pod lib lint --swift-version=3.2 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=3.3 + name: pod lib lint --swift-version=3.3 + - <<: *pod + osx_image: xcode10 + env: SWIFT=3.4 + name: pod lib lint --swift-version=3.4 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=4.0 + name: pod lib lint --swift-version=4.0 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=4.1 + name: pod lib lint --swift-version=4.1 + - <<: *pod + osx_image: xcode10 + env: SWIFT=4.2 + name: pod lib lint --swift-version=4.2 + + - &linux + stage: compile + env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.0 + # ^^ we have some source-conditionals for this version + name: Linux / Swift 3.2.0 + os: linux + dist: trusty + sudo: required + language: generic + before_install: + eval "$(curl -sL https://swiftenv.fuller.li/install.sh)" + script: + swift build -Xswiftc -swift-version -Xswiftc $SWIFT_BUILD_VERSION + - <<: *linux + env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.0.3 + name: Linux / Swift 3.2.3 + - <<: *linux + env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.1.2 + name: Linux / Swift 3.3 + - <<: *linux + env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.2 + name: Linux / Swift 3.4 + - <<: *linux + env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.0 + name: Linux / Swift 4.0.0 + # ^^ we have some source-conditionals for this version + - <<: *linux + env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.0.3 + name: Linux / Swift 4.0.3 + - <<: *linux + 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 + name: Linux / Swift 4.2 + + - &swiftpm + stage: compile + name: Xcode 8.3 / SwiftPM + os: osx + osx_image: xcode8.3 + language: objective-c + script: swift build + - <<: *swiftpm + name: Xcode 9.4 / SwiftPM + osx_image: xcode9.4 + - <<: *swiftpm + name: Xcode 10.0 / SwiftPM + osx_image: xcode10 + + - &test + stage: test + osx_image: xcode10 + name: macOS Tests + env: DST='arch=x86_64' PLAT=macOS + os: osx + language: objective-c + cache: + directories: + - Carthage + before_install: + carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT + install: + xcodebuild -scheme PMKFoundation -target PMKFoundation -quiet -destination "$DST" SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: + xcodebuild -scheme PMKFoundation -quiet -destination "$DST" test + after_success: + bash <(curl -s https://codecov.io/bash); + - <<: *test + env: DST='OS=12.0,name=iPhone SE' PLAT=iOS + name: iOS Tests + - <<: *test + env: DST='OS=12.0,name=Apple TV' PLAT=tvOS + name: tvOS Tests diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile new file mode 100644 index 0000000..381bc31 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.3 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile.private b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile.private new file mode 100644 index 0000000..13f8280 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile.private @@ -0,0 +1 @@ +github "AliSoftware/OHHTTPStubs" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile.resolved new file mode 100644 index 0000000..f55bd34 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Cartfile.resolved @@ -0,0 +1,2 @@ +github "AliSoftware/OHHTTPStubs" "6.1.0" +github "mxcl/PromiseKit" "6.5.0" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/LICENSE b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/LICENSE new file mode 100644 index 0000000..da14072 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/LICENSE @@ -0,0 +1,20 @@ +Copyright 2018-present, Max Howell; mxcl@me.com + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.pbxproj new file mode 100644 index 0000000..de63cc2 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.pbxproj @@ -0,0 +1,506 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6364F66F1D68B8DF008D7B94 /* NSNotificationCenter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6364F66C1D68B8DF008D7B94 /* NSNotificationCenter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6364F6701D68B8DF008D7B94 /* NSTask+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6364F66D1D68B8DF008D7B94 /* NSTask+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6364F6711D68B8DF008D7B94 /* NSURLSession+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6364F66E1D68B8DF008D7B94 /* NSURLSession+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63C700031D5C021F003BAE60 /* TestNSNotificationCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFFD1D5C021F003BAE60 /* TestNSNotificationCenter.swift */; }; + 63C700041D5C021F003BAE60 /* TestNSObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFFE1D5C021F003BAE60 /* TestNSObject.swift */; }; + 63C700051D5C021F003BAE60 /* TestNSTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFFF1D5C021F003BAE60 /* TestNSTask.swift */; }; + 63C700081D5C021F003BAE60 /* TestNSURLSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C700021D5C021F003BAE60 /* TestNSURLSession.swift */; }; + 63C7FFDC1D5C00F2003BAE60 /* afterlife.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFCE1D5C00F2003BAE60 /* afterlife.swift */; }; + 63C7FFDE1D5C00F2003BAE60 /* NSNotificationCenter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFD01D5C00F2003BAE60 /* NSNotificationCenter+AnyPromise.m */; }; + 63C7FFDF1D5C00F2003BAE60 /* NSNotificationCenter+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFD11D5C00F2003BAE60 /* NSNotificationCenter+Promise.swift */; }; + 63C7FFE01D5C00F2003BAE60 /* NSObject+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFD21D5C00F2003BAE60 /* NSObject+Promise.swift */; }; + 63C7FFE21D5C00F2003BAE60 /* NSTask+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFD41D5C00F2003BAE60 /* NSTask+AnyPromise.m */; }; + 63C7FFE31D5C00F2003BAE60 /* Process+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFD51D5C00F2003BAE60 /* Process+Promise.swift */; }; + 63C7FFE81D5C00F2003BAE60 /* NSURLSession+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFDA1D5C00F2003BAE60 /* NSURLSession+AnyPromise.m */; }; + 63C7FFE91D5C00F2003BAE60 /* NSURLSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C7FFDB1D5C00F2003BAE60 /* NSURLSession+Promise.swift */; }; + 63C7FFED1D5C00FD003BAE60 /* PMKFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 63C7FFEB1D5C00FD003BAE60 /* PMKFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63C7FFF71D5C020D003BAE60 /* PMKFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKFoundation.framework */; }; + 63CAF1061D682F9600D3835B /* TestNSURLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 63CAF1051D682F9600D3835B /* TestNSURLSession.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKFoundation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6364F66C1D68B8DF008D7B94 /* NSNotificationCenter+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSNotificationCenter+AnyPromise.h"; path = "Sources/NSNotificationCenter+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 6364F66D1D68B8DF008D7B94 /* NSTask+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSTask+AnyPromise.h"; path = "Sources/NSTask+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 6364F66E1D68B8DF008D7B94 /* NSURLSession+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSURLSession+AnyPromise.h"; path = "Sources/NSURLSession+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 63C700021D5C021F003BAE60 /* TestNSURLSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestNSURLSession.swift; path = Tests/TestNSURLSession.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKFoundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFCE1D5C00F2003BAE60 /* afterlife.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = afterlife.swift; path = Sources/afterlife.swift; sourceTree = SOURCE_ROOT; }; + 63C7FFD01D5C00F2003BAE60 /* NSNotificationCenter+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSNotificationCenter+AnyPromise.m"; path = "Sources/NSNotificationCenter+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63C7FFD11D5C00F2003BAE60 /* NSNotificationCenter+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSNotificationCenter+Promise.swift"; path = "Sources/NSNotificationCenter+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63C7FFD21D5C00F2003BAE60 /* NSObject+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSObject+Promise.swift"; path = "Sources/NSObject+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63C7FFD41D5C00F2003BAE60 /* NSTask+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSTask+AnyPromise.m"; path = "Sources/NSTask+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63C7FFD51D5C00F2003BAE60 /* Process+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Process+Promise.swift"; path = "Sources/Process+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63C7FFDA1D5C00F2003BAE60 /* NSURLSession+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSURLSession+AnyPromise.m"; path = "Sources/NSURLSession+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63C7FFDB1D5C00F2003BAE60 /* NSURLSession+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSURLSession+Promise.swift"; path = "Sources/NSURLSession+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63C7FFEB1D5C00FD003BAE60 /* PMKFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKFoundation.h; path = Sources/PMKFoundation.h; sourceTree = SOURCE_ROOT; }; + 63C7FFF21D5C020D003BAE60 /* PMKNSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKNSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFFD1D5C021F003BAE60 /* TestNSNotificationCenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestNSNotificationCenter.swift; path = Tests/TestNSNotificationCenter.swift; sourceTree = SOURCE_ROOT; }; + 63C7FFFE1D5C021F003BAE60 /* TestNSObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestNSObject.swift; path = Tests/TestNSObject.swift; sourceTree = SOURCE_ROOT; }; + 63C7FFFF1D5C021F003BAE60 /* TestNSTask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestNSTask.swift; path = Tests/TestNSTask.swift; sourceTree = SOURCE_ROOT; }; + 63CAF1051D682F9600D3835B /* TestNSURLSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestNSURLSession.m; path = Tests/TestNSURLSession.m; sourceTree = SOURCE_ROOT; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8131D5C0C4E00503216 /* Cartfile.private */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile.private; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKFoundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8131D5C0C4E00503216 /* Cartfile.private */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKFoundation.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKNSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63C7FFCE1D5C00F2003BAE60 /* afterlife.swift */, + 63C7FFD51D5C00F2003BAE60 /* Process+Promise.swift */, + 6364F66C1D68B8DF008D7B94 /* NSNotificationCenter+AnyPromise.h */, + 63C7FFD01D5C00F2003BAE60 /* NSNotificationCenter+AnyPromise.m */, + 63C7FFD11D5C00F2003BAE60 /* NSNotificationCenter+Promise.swift */, + 63C7FFD21D5C00F2003BAE60 /* NSObject+Promise.swift */, + 6364F66D1D68B8DF008D7B94 /* NSTask+AnyPromise.h */, + 63C7FFD41D5C00F2003BAE60 /* NSTask+AnyPromise.m */, + 6364F66E1D68B8DF008D7B94 /* NSURLSession+AnyPromise.h */, + 63C7FFDA1D5C00F2003BAE60 /* NSURLSession+AnyPromise.m */, + 63C7FFDB1D5C00F2003BAE60 /* NSURLSession+Promise.swift */, + 63C7FFEB1D5C00FD003BAE60 /* PMKFoundation.h */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63C7FFFD1D5C021F003BAE60 /* TestNSNotificationCenter.swift */, + 63C7FFFE1D5C021F003BAE60 /* TestNSObject.swift */, + 63C7FFFF1D5C021F003BAE60 /* TestNSTask.swift */, + 63C700021D5C021F003BAE60 /* TestNSURLSession.swift */, + 63CAF1051D682F9600D3835B /* TestNSURLSession.m */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFED1D5C00FD003BAE60 /* PMKFoundation.h in Headers */, + 6364F66F1D68B8DF008D7B94 /* NSNotificationCenter+AnyPromise.h in Headers */, + 6364F6711D68B8DF008D7B94 /* NSURLSession+AnyPromise.h in Headers */, + 6364F6701D68B8DF008D7B94 /* NSTask+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKFoundation */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKFoundation" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKFoundation; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKFoundation.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKNSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKNSTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKNSTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKNSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKFoundation" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKFoundation */, + 63C7FFF11D5C020D003BAE60 /* PMKNSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + OHHTTPStubs, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFDF1D5C00F2003BAE60 /* NSNotificationCenter+Promise.swift in Sources */, + 63C7FFDC1D5C00F2003BAE60 /* afterlife.swift in Sources */, + 63C7FFDE1D5C00F2003BAE60 /* NSNotificationCenter+AnyPromise.m in Sources */, + 63C7FFE91D5C00F2003BAE60 /* NSURLSession+Promise.swift in Sources */, + 63C7FFE31D5C00F2003BAE60 /* Process+Promise.swift in Sources */, + 63C7FFE01D5C00F2003BAE60 /* NSObject+Promise.swift in Sources */, + 63C7FFE81D5C00F2003BAE60 /* NSURLSession+AnyPromise.m in Sources */, + 63C7FFE21D5C00F2003BAE60 /* NSTask+AnyPromise.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C700051D5C021F003BAE60 /* TestNSTask.swift in Sources */, + 63C700031D5C021F003BAE60 /* TestNSNotificationCenter.swift in Sources */, + 63C700081D5C021F003BAE60 /* TestNSURLSession.swift in Sources */, + 63CAF1061D682F9600D3835B /* TestNSURLSession.m in Sources */, + 63C700041D5C021F003BAE60 /* TestNSObject.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKFoundation */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.0.4; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.0.4; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKFoundation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKFoundation" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKNSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/xcshareddata/xcschemes/PMKFoundation.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/xcshareddata/xcschemes/PMKFoundation.xcscheme new file mode 100644 index 0000000..660f49f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/PMKFoundation.xcodeproj/xcshareddata/xcschemes/PMKFoundation.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package.resolved b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package.resolved new file mode 100644 index 0000000..0f8aecf --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "PromiseKit", + "repositoryURL": "https://github.com/mxcl/PromiseKit.git", + "state": { + "branch": null, + "revision": "9e5bc43281cae89ab0b6e47df3ea25a2c44af7f0", + "version": "6.5.0" + } + } + ] + }, + "version": 1 +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package.swift new file mode 100644 index 0000000..6072eb0 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package.swift @@ -0,0 +1,23 @@ +import PackageDescription + +let package = Package( + name: "PMKFoundation", + dependencies: [ + .Package(url: "https://github.com/mxcl/PromiseKit.git", majorVersion: 6) + ], + swiftLanguageVersions: [3, 4], + exclude: [ + "Sources/NSNotificationCenter+AnyPromise.m", + "Sources/NSTask+AnyPromise.m", + "Sources/NSURLSession+AnyPromise.m", + "Sources/PMKFoundation.h", + "Tests" // currently SwiftPM is not savvy to having a single test… + ] +) + +#if os(Linux) +package.exclude += [ + "Sources/afterlife.swift", + "Sources/NSObject+Promise.swift" +] +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package@swift-4.2.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package@swift-4.2.swift new file mode 100644 index 0000000..2c56e45 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Package@swift-4.2.swift @@ -0,0 +1,32 @@ +// swift-tools-version:4.2 + +import PackageDescription + +let pkg = Package(name: "PMKFoundation") +pkg.products = [ + .library(name: "PMKFoundation", targets: ["PMKFoundation"]), +] +pkg.dependencies = [ + .package(url: "https://github.com/mxcl/PromiseKit.git", .upToNextMajor(from: "6.0.0")) +] +pkg.swiftLanguageVersions = [.v3, .v4, .v4_2] + +let target: Target = .target(name: "PMKFoundation") +target.path = "Sources" +target.exclude = ["NSNotificationCenter", "NSTask", "NSURLSession"].flatMap { + ["\($0)+AnyPromise.m", "\($0)+AnyPromise.h"] +} +target.exclude.append("PMKFoundation.h") + +target.dependencies = [ + "PromiseKit" +] + +#if os(Linux) +target.exclude += [ + "afterlife.swift", + "NSObject+Promise.swift" +] +#endif + +pkg.targets = [target] diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/README.markdown new file mode 100644 index 0000000..0e43ceb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/README.markdown @@ -0,0 +1,46 @@ +# PromiseKit Foundation Extensions ![Build Status] + +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. + +## CococaPods + +```ruby +pod "PromiseKit/Foundation", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/Foundation" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKFoundation +``` + +```objc +// objc +@import PromiseKit; +@import PMKFoundation; +``` + +## SwiftPM + +```swift +let package = Package( + dependencies: [ + .Package(url: "https://github.com/PromiseKit/Foundation.git", majorVersion: 3) + ] +) +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/Foundation.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h new file mode 100644 index 0000000..351a93b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.h @@ -0,0 +1,44 @@ +#import +#import + + +/** + To import the `NSNotificationCenter` category: + + use_frameworks! + pod "PromiseKit/Foundation" + + Or `NSNotificationCenter` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + #import +*/ +@interface NSNotificationCenter (PromiseKit) +/** + Observe the named notification once. + + [NSNotificationCenter once:UIKeyboardWillShowNotification].then(^(id note, id userInfo){ + UIViewAnimationCurve curve = [userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; + CGFloat duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; + + return [UIView promiseWithDuration:duration delay:0.0 options:(curve << 16) animations:^{ + + }]; + }); + + @warning *Important* Promises only resolve once. If you need your block to execute more than once then use `-addObserverForName:object:queue:usingBlock:`. + + @param notificationName The name of the notification for which to register the observer. + + @return A promise that fulfills with two parameters: + + 1. The NSNotification object. + 2. The NSNotification’s userInfo property. +*/ ++ (AnyPromise *)once:(NSString *)notificationName NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m new file mode 100644 index 0000000..f8aee71 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+AnyPromise.m @@ -0,0 +1,18 @@ +#import +#import +#import "PMKFoundation.h" + +@implementation NSNotificationCenter (PromiseKit) + ++ (AnyPromise *)once:(NSString *)name { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + __block id identifier; + identifier = [[NSNotificationCenter defaultCenter] addObserverForName:name object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + [[NSNotificationCenter defaultCenter] removeObserver:identifier name:name object:nil]; + identifier = nil; + resolve(PMKManifold(note, note.userInfo)); + }]; + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift new file mode 100644 index 0000000..3b7f843 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSNotificationCenter+Promise.swift @@ -0,0 +1,33 @@ +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `NSNotificationCenter` category: + + use_frameworks! + pod "PromiseKit/Foundation" + + Or `NSNotificationCenter` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + import PromiseKit +*/ +extension NotificationCenter { + /// Observe the named notification once + public func observe(once name: Notification.Name, object: Any? = nil) -> Guarantee { + let (promise, fulfill) = Guarantee.pending() + #if os(Linux) && ((swift(>=4.0) && !swift(>=4.0.1)) || (swift(>=3.0) && !swift(>=3.2.1))) + let id = addObserver(forName: name, object: object, queue: nil, usingBlock: fulfill) + #else + let id = addObserver(forName: name, object: object, queue: nil, using: fulfill) + #endif + promise.done { _ in self.removeObserver(id) } + return promise + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift new file mode 100644 index 0000000..135719b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSObject+Promise.swift @@ -0,0 +1,57 @@ +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `NSObject` category: + + use_frameworks! + pod "PromiseKit/Foundation" + + Or `NSObject` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + import PromiseKit +*/ +extension NSObject { + /** + - Returns: A promise that resolves when the provided keyPath changes. + - Warning: *Important* The promise must not outlive the object under observation. + - SeeAlso: Apple’s KVO documentation. + */ + public func observe(_: PMKNamespacer, keyPath: String) -> Guarantee { + return Guarantee { KVOProxy(observee: self, keyPath: keyPath, resolve: $0) } + } +} + +private class KVOProxy: NSObject { + var retainCycle: KVOProxy? + let fulfill: (Any?) -> Void + + @discardableResult + init(observee: NSObject, keyPath: String, resolve: @escaping (Any?) -> Void) { + fulfill = resolve + super.init() + observee.addObserver(self, forKeyPath: keyPath, options: NSKeyValueObservingOptions.new, context: pointer) + retainCycle = self + } + + fileprivate override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { + if let change = change, context == pointer { + defer { retainCycle = nil } + fulfill(change[NSKeyValueChangeKey.newKey]) + if let object = object as? NSObject, let keyPath = keyPath { + object.removeObserver(self, forKeyPath: keyPath) + } + } + } + + private lazy var pointer: UnsafeMutableRawPointer = { + return Unmanaged.passUnretained(self).toOpaque() + }() +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h new file mode 100644 index 0000000..29c2c03 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.h @@ -0,0 +1,53 @@ +#if TARGET_OS_MAC && !TARGET_OS_EMBEDDED && !TARGET_OS_SIMULATOR + +#import +#import + +#define PMKTaskErrorLaunchPathKey @"PMKTaskErrorLaunchPathKey" +#define PMKTaskErrorArgumentsKey @"PMKTaskErrorArgumentsKey" +#define PMKTaskErrorStandardOutputKey @"PMKTaskErrorStandardOutputKey" +#define PMKTaskErrorStandardErrorKey @"PMKTaskErrorStandardErrorKey" +#define PMKTaskErrorExitStatusKey @"PMKTaskErrorExitStatusKey" + +/** + To import the `NSTask` category: + + use_frameworks! + pod "PromiseKit/Foundation" + + Or `NSTask` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + #import +*/ +@interface NSTask (PromiseKit) + +/** + Launches the receiver and resolves when it exits. + + If the task fails the promise is rejected with code `PMKTaskError`, and + `userInfo` keys: `PMKTaskErrorStandardOutputKey`, + `PMKTaskErrorStandardErrorKey` and `PMKTaskErrorExitStatusKey`. + + NSTask *task = [NSTask new]; + task.launchPath = @"/usr/bin/basename"; + task.arguments = @[@"/usr/bin/sleep"]; + [task promise].then(^(NSString *stdout){ + //… + }); + + @return A promise that fulfills with three parameters: + + 1) The stdout interpreted as a UTF8 string. + 2) The stderr interpreted as a UTF8 string. + 3) The stdout as `NSData`. +*/ +- (AnyPromise *)promise NS_REFINED_FOR_SWIFT; + +@end + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m new file mode 100644 index 0000000..beae277 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSTask+AnyPromise.m @@ -0,0 +1,59 @@ +#import +#import +#import +#import +#import + +#if TARGET_OS_MAC && !TARGET_OS_EMBEDDED && !TARGET_OS_SIMULATOR + +#import "NSTask+AnyPromise.h" + +@implementation NSTask (PromiseKit) + +- (AnyPromise *)promise { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + self.standardOutput = [NSPipe pipe]; + self.standardError = [NSPipe pipe]; + self.terminationHandler = ^(NSTask *task){ + id stdoutData = [[task.standardOutput fileHandleForReading] readDataToEndOfFile]; + id stdoutString = [[NSString alloc] initWithData:stdoutData encoding:NSUTF8StringEncoding]; + id stderrData = [[task.standardError fileHandleForReading] readDataToEndOfFile]; + id stderrString = [[NSString alloc] initWithData:stderrData encoding:NSUTF8StringEncoding]; + + if (task.terminationReason == NSTaskTerminationReasonExit && self.terminationStatus == 0) { + resolve(PMKManifold(stdoutString, stderrString, stdoutData)); + } else { + id cmd = [NSMutableArray arrayWithObject:task.launchPath]; + [cmd addObjectsFromArray:task.arguments]; + cmd = [cmd componentsJoinedByString:@" "]; + + id info = @{ + NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Failed executing: %@.", cmd], + PMKTaskErrorStandardOutputKey: stdoutString, + PMKTaskErrorStandardErrorKey: stderrString, + PMKTaskErrorExitStatusKey: @(task.terminationStatus), + }; + + resolve([NSError errorWithDomain:PMKErrorDomain code:PMKTaskError userInfo:info]); + } + }; + + #if __clang_major__ >= 9 + if (@available(macOS 10.13, *)) { + NSError *error = nil; + + if (![self launchAndReturnError:&error]) { + resolve(error); + } + } else { + [self launch]; + } + #else + [self launch]; // might @throw + #endif + }]; +} + +@end + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h new file mode 100644 index 0000000..71952d4 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.h @@ -0,0 +1,79 @@ +#import +#import +#import +#import + +#define PMKURLErrorFailingURLResponseKey @"PMKURLErrorFailingURLResponseKey" +#define PMKURLErrorFailingDataKey @"PMKURLErrorFailingDataKey" +#define PMKURLErrorFailingStringKey @"PMKURLErrorFailingStringKey" +#define PMKJSONErrorJSONObjectKey @"PMKJSONErrorJSONObjectKey" + +/** + Really we shouldn’t assume JSON for (application|text)/(x-)javascript, + really we should return a String of Javascript. However in practice + for the apps we write it *will be* JSON. Thus if you actually want + a Javascript String, use the promise variant of our category functions. + */ +#define PMKHTTPURLResponseIsJSON(rsp) [@[@"application/json", @"text/json", @"text/javascript", @"application/x-javascript", @"application/javascript"] containsObject:[rsp MIMEType]] +#define PMKHTTPURLResponseIsImage(rsp) [@[@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap"] containsObject:[rsp MIMEType]] +#define PMKHTTPURLResponseIsText(rsp) [[rsp MIMEType] hasPrefix:@"text/"] + +#define PMKJSONDeserializationOptions ((NSJSONReadingOptions)(NSJSONReadingAllowFragments | NSJSONReadingMutableContainers)) + + +/** + To import the `NSURLSession` category: + + use_frameworks! + pod "PromiseKit/Foundation" + + Or `NSURLConnection` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + #import +*/ +@interface NSURLSession (PromiseKit) + +/** + Creates a task that retrieves the contents of a URL based on the + specified URL request object. + + PromiseKit automatically deserializes the raw HTTP data response into the + appropriate rich data type based on the mime type the server provides. + Thus if the response is JSON you will get the deserialized JSON response. + PromiseKit supports decoding into strings, JSON and UIImages. + + However if your server does not provide a rich content-type, you will + just get `NSData`. This is rare, but a good example we came across was + downloading files from Dropbox. + + PromiseKit goes to quite some lengths to provide good `NSError` objects + for error conditions at all stages of the HTTP to rich-data type + pipeline. We provide the following additional `userInfo` keys as + appropriate: + + - `PMKURLErrorFailingDataKey` + - `PMKURLErrorFailingStringKey` + - `PMKURLErrorFailingURLResponseKey` + + [[NSURLConnection sharedSession] promiseDataTaskWithRequest:rq].then(^(id response){ + // response is probably an NSDictionary deserialized from JSON + }); + + @param request The URL request. + + @return A promise that fulfills with three parameters: + + 1) The deserialized data response. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + + @see https://github.com/mxcl/OMGHTTPURLRQ +*/ +- (AnyPromise *)promiseDataTaskWithRequest:(NSURLRequest *)request NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m new file mode 100644 index 0000000..901eb28 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+AnyPromise.m @@ -0,0 +1,113 @@ +#import +#import +#import +#import "NSURLSession+AnyPromise.h" +#import +#import +#import +#import +#import +#import +#import +#import + +@implementation NSURLSession (PromiseKit) + +- (AnyPromise *)promiseDataTaskWithRequest:(NSURLRequest *)rq { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [[self dataTaskWithRequest:rq completionHandler:^(NSData *data, id rsp, NSError *urlError){ + assert(![NSThread isMainThread]); + + PMKResolver fulfiller = ^(id responseObject){ + resolve(PMKManifold(responseObject, rsp, data)); + }; + PMKResolver rejecter = ^(NSError *error){ + id userInfo = error.userInfo.mutableCopy ?: [NSMutableDictionary new]; + if (data) userInfo[PMKURLErrorFailingDataKey] = data; + if (rsp) userInfo[PMKURLErrorFailingURLResponseKey] = rsp; + error = [NSError errorWithDomain:error.domain code:error.code userInfo:userInfo]; + resolve(error); + }; + + NSStringEncoding (^stringEncoding)(void) = ^NSStringEncoding{ + id encodingName = [rsp textEncodingName]; + if (encodingName) { + CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)encodingName); + if (encoding != kCFStringEncodingInvalidId) + return CFStringConvertEncodingToNSStringEncoding(encoding); + } + return NSUTF8StringEncoding; + }; + + if (urlError) { + rejecter(urlError); + } else if (![rsp isKindOfClass:[NSHTTPURLResponse class]]) { + fulfiller(data); + } else if ([rsp statusCode] < 200 || [rsp statusCode] >= 300) { + id info = @{ + NSLocalizedDescriptionKey: @"The server returned a bad HTTP response code", + NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, + NSURLErrorFailingURLErrorKey: rq.URL + }; + id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadServerResponse userInfo:info]; + rejecter(err); + } else if (PMKHTTPURLResponseIsJSON(rsp)) { + // work around ever-so-common Rails workaround: https://github.com/rails/rails/issues/1742 + if ([rsp expectedContentLength] == 1 && [data isEqualToData:[NSData dataWithBytes:" " length:1]]) + return fulfiller(nil); + + NSError *err = nil; + id json = [NSJSONSerialization JSONObjectWithData:data options:PMKJSONDeserializationOptions error:&err]; + if (!err) { + fulfiller(json); + } else { + id userInfo = err.userInfo.mutableCopy; + if (data) { + NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding()]; + if (string) + userInfo[PMKURLErrorFailingStringKey] = string; + } + long long length = [rsp expectedContentLength]; + id bytes = length <= 0 ? @"" : [NSString stringWithFormat:@"%lld bytes", length]; + id fmt = @"The server claimed a %@ JSON response, but decoding failed with: %@"; + userInfo[NSLocalizedDescriptionKey] = [NSString stringWithFormat:fmt, bytes, userInfo[NSLocalizedDescriptionKey]]; + err = [NSError errorWithDomain:err.domain code:err.code userInfo:userInfo]; + rejecter(err); + } + #ifdef UIKIT_EXTERN + } else if (PMKHTTPURLResponseIsImage(rsp)) { + UIImage *image = [[UIImage alloc] initWithData:data]; + image = [[UIImage alloc] initWithCGImage:[image CGImage] scale:image.scale orientation:image.imageOrientation]; + if (image) + fulfiller(image); + else { + id info = @{ + NSLocalizedDescriptionKey: @"The server returned invalid image data", + NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, + NSURLErrorFailingURLErrorKey: rq.URL + }; + id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:info]; + rejecter(err); + } + #endif + } else if (PMKHTTPURLResponseIsText(rsp)) { + id str = [[NSString alloc] initWithData:data encoding:stringEncoding()]; + if (str) + fulfiller(str); + else { + id info = @{ + NSLocalizedDescriptionKey: @"The server returned invalid string data", + NSURLErrorFailingURLStringErrorKey: rq.URL.absoluteString, + NSURLErrorFailingURLErrorKey: rq.URL + }; + id err = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:info]; + rejecter(err); + } + } else { + fulfiller(data); + } + }] resume]; + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift new file mode 100644 index 0000000..13259a0 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/NSURLSession+Promise.swift @@ -0,0 +1,241 @@ +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `NSURLSession` category: + + use_frameworks! + pod "PromiseKit/Foundation" + + Or `NSURLSession` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + import PromiseKit +*/ +extension URLSession { + /** + Example usage: + + firstly { + URLSession.shared.dataTask(.promise, with: rq) + }.compactMap { data, _ in + try JSONSerialization.jsonObject(with: data) as? [String: Any] + }.then { json in + //… + } + + We recommend the use of [OMGHTTPURLRQ] which allows you to construct correct REST requests: + + firstly { + let rq = OMGHTTPURLRQ.POST(url, json: parameters) + URLSession.shared.dataTask(.promise, with: rq) + }.then { data, urlResponse in + //… + } + + We provide a convenience initializer for `String` specifically for this promise: + + firstly { + URLSession.shared.dataTask(.promise, with: rq) + }.compactMap(String.init).then { string in + // decoded per the string encoding specified by the server + }.then { string in + print("response: string") + } + + Other common types can be easily decoded using compactMap also: + + firstly { + URLSession.shared.dataTask(.promise, with: rq) + }.compactMap { + UIImage(data: $0) + }.then { + self.imageView.image = $0 + } + + Though if you do decode the image this way, we recommend inflating it on a background thread + first as this will improve main thread performance when rendering the image: + + firstly { + URLSession.shared.dataTask(.promise, with: rq) + }.compactMap(on: QoS.userInitiated) { data, _ in + guard let img = UIImage(data: data) else { return nil } + _ = cgImage?.dataProvider?.data + return img + }.then { + self.imageView.image = $0 + } + + - Parameter convertible: A URL or URLRequest. + - Returns: A promise that represents the URL request. + - SeeAlso: [OMGHTTPURLRQ] + - Remark: We deliberately don’t provide a `URLRequestConvertible` for `String` because in our experience, you should be explicit with this error path to make good apps. + + [OMGHTTPURLRQ]: https://github.com/mxcl/OMGHTTPURLRQ + */ + public func dataTask(_: PMKNamespacer, with convertible: URLRequestConvertible) -> Promise<(data: Data, response: URLResponse)> { + return Promise { dataTask(with: convertible.pmkRequest, completionHandler: adapter($0)).resume() } + } + + public func uploadTask(_: PMKNamespacer, with convertible: URLRequestConvertible, from data: Data) -> Promise<(data: Data, response: URLResponse)> { + return Promise { uploadTask(with: convertible.pmkRequest, from: data, completionHandler: adapter($0)).resume() } + } + + public func uploadTask(_: PMKNamespacer, with convertible: URLRequestConvertible, fromFile file: URL) -> Promise<(data: Data, response: URLResponse)> { + return Promise { uploadTask(with: convertible.pmkRequest, fromFile: file, completionHandler: adapter($0)).resume() } + } + + /// - Remark: we force a `to` parameter because Apple deletes the downloaded file immediately after the underyling completion handler returns. + /// - Note: we do not create the destination directory for you, because we move the file with FileManager.moveItem which changes it behavior depending on the directory status of the URL you provide. So create your own directory first! + public func downloadTask(_: PMKNamespacer, with convertible: URLRequestConvertible, to saveLocation: URL) -> Promise<(saveLocation: URL, response: URLResponse)> { + return Promise { seal in + downloadTask(with: convertible.pmkRequest, completionHandler: { tmp, rsp, err in + if let error = err { + seal.reject(error) + } else if let rsp = rsp, let tmp = tmp { + do { + try FileManager.default.moveItem(at: tmp, to: saveLocation) + seal.fulfill((saveLocation, rsp)) + } catch { + seal.reject(error) + } + } else { + seal.reject(PMKError.invalidCallingConvention) + } + }).resume() + } + } +} + + +public protocol URLRequestConvertible { + var pmkRequest: URLRequest { get } +} +extension URLRequest: URLRequestConvertible { + public var pmkRequest: URLRequest { return self } +} +extension URL: URLRequestConvertible { + public var pmkRequest: URLRequest { return URLRequest(url: self) } +} + + +#if !os(Linux) +public extension String { + /** + - Remark: useful when converting a `URLSession` response into a `String` + + firstly { + URLSession.shared.dataTask(.promise, with: rq) + }.map(String.init).done { + print($0) + } + */ + init?(data: Data, urlResponse: URLResponse) { + guard let str = String(bytes: data, encoding: urlResponse.stringEncoding ?? .utf8) else { + return nil + } + self.init(str) + } +} + +private extension URLResponse { + var stringEncoding: String.Encoding? { + guard let encodingName = textEncodingName else { return nil } + let encoding = CFStringConvertIANACharSetNameToEncoding(encodingName as CFString) + guard encoding != kCFStringEncodingInvalidId else { return nil } + return String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(encoding)) + } +} +#endif + +private func adapter(_ seal: Resolver<(data: T, response: U)>) -> (T?, U?, Error?) -> Void { + return { t, u, e in + if let t = t, let u = u { + seal.fulfill((t, u)) + } else if let e = e { + seal.reject(e) + } else { + seal.reject(PMKError.invalidCallingConvention) + } + } +} + + +#if swift(>=3.1) +public enum PMKHTTPError: Error, LocalizedError, CustomStringConvertible { + case badStatusCode(Int, Data, HTTPURLResponse) + + public var errorDescription: String? { + func url(_ rsp: URLResponse) -> String { + return rsp.url?.absoluteString ?? "nil" + } + switch self { + case .badStatusCode(401, _, let response): + return "Unauthorized (\(url(response))" + case .badStatusCode(let code, _, let response): + return "Invalid HTTP response (\(code)) for \(url(response))." + } + } + +#if swift(>=4.0) + public func decodeResponse(_ t: T.Type, decoder: JSONDecoder = JSONDecoder()) -> T? { + switch self { + case .badStatusCode(_, let data, _): + return try? decoder.decode(t, from: data) + } + } +#endif + + //TODO rename responseJSON + public var jsonDictionary: Any? { + switch self { + case .badStatusCode(_, let data, _): + return try? JSONSerialization.jsonObject(with: data) + } + } + + var responseBodyString: String? { + switch self { + case .badStatusCode(_, let data, _): + return String(data: data, encoding: .utf8) + } + } + + public var failureReason: String? { + return responseBodyString + } + + public var description: String { + switch self { + case .badStatusCode(let code, let data, let response): + var dict: [String: Any] = [ + "Status Code": code, + "Body": String(data: data, encoding: .utf8) ?? "\(data.count) bytes" + ] + dict["URL"] = response.url + dict["Headers"] = response.allHeaderFields + return " \(NSDictionary(dictionary: dict))" // as NSDictionary makes the output look like NSHTTPURLResponse looks + } + } +} + +public extension Promise where T == (data: Data, response: URLResponse) { + func validate() -> Promise { + return map { + guard let response = $0.response as? HTTPURLResponse else { return $0 } + switch response.statusCode { + case 200..<300: + return $0 + case let code: + throw PMKHTTPError.badStatusCode(code, $0.data, response) + } + } + } +} +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h new file mode 100644 index 0000000..8796c0d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/PMKFoundation.h @@ -0,0 +1,3 @@ +#import "NSNotificationCenter+AnyPromise.h" +#import "NSURLSession+AnyPromise.h" +#import "NSTask+AnyPromise.h" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift new file mode 100644 index 0000000..03cab3c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/Process+Promise.swift @@ -0,0 +1,190 @@ +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif + +#if os(macOS) + +/** + To import the `Process` category: + + use_frameworks! + pod "PromiseKit/Foundation" + + Or `Process` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + import PromiseKit + */ +extension Process { + /** + Launches the receiver and resolves when it exits. + + let proc = Process() + proc.launchPath = "/bin/ls" + proc.arguments = ["/bin"] + proc.launch(.promise).compactMap { std in + String(data: std.out.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) + }.then { stdout in + print(str) + } + */ + public func launch(_: PMKNamespacer) -> Promise<(out: Pipe, err: Pipe)> { + let (stdout, stderr) = (Pipe(), Pipe()) + + do { + standardOutput = stdout + standardError = stderr + + #if swift(>=4.0) + if #available(OSX 10.13, *) { + try run() + } else if let path = launchPath, FileManager.default.isExecutableFile(atPath: path) { + launch() + } else { + throw PMKError.notExecutable(launchPath) + } + #else + guard let path = launchPath, FileManager.default.isExecutableFile(atPath: path) else { + throw PMKError.notExecutable(launchPath) + } + launch() + #endif + } catch { + return Promise(error: error) + } + + + var q: DispatchQueue { + if #available(macOS 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *) { + return DispatchQueue.global(qos: .default) + } else { + return DispatchQueue.global(priority: .default) + } + } + + return Promise { seal in + q.async { + self.waitUntilExit() + + guard self.terminationReason == .exit, self.terminationStatus == 0 else { + let stdoutData = try? self.readDataFromPipe(stdout) + let stderrData = try? self.readDataFromPipe(stderr) + + let stdoutString = stdoutData.flatMap { (data: Data) -> String? in String(data: data, encoding: .utf8) } + let stderrString = stderrData.flatMap { (data: Data) -> String? in String(data: data, encoding: .utf8) } + + return seal.reject(PMKError.execution(process: self, standardOutput: stdoutString, standardError: stderrString)) + } + seal.fulfill((stdout, stderr)) + } + } + } + + private func readDataFromPipe(_ pipe: Pipe) throws -> Data { + let handle = pipe.fileHandleForReading + defer { handle.closeFile() } + + // Someday, NSFileHandle will probably be updated with throwing equivalents to its read and write methods, + // as NSTask has, to avoid raising exceptions and crashing the app. + // Unfortunately that day has not yet come, so use the underlying BSD calls for now. + + let fd = handle.fileDescriptor + + let bufsize = 1024 * 8 + let buf = UnsafeMutablePointer.allocate(capacity: bufsize) + + #if swift(>=4.1) + defer { buf.deallocate() } + #else + defer { buf.deallocate(capacity: bufsize) } + #endif + + var data = Data() + + while true { + let bytesRead = read(fd, buf, bufsize) + + if bytesRead == 0 { + break + } + + if bytesRead < 0 { + throw POSIXError.Code(rawValue: errno).map { POSIXError($0) } ?? CocoaError(.fileReadUnknown) + } + + data.append(buf, count: bytesRead) + } + + return data + } + + /** + The error generated by PromiseKit’s `Process` extension + */ + public enum PMKError { + /// NOT AVAILABLE ON 10.13 and above because Apple provide this error handling themselves + case notExecutable(String?) + case execution(process: Process, standardOutput: String?, standardError: String?) + } +} + + +extension Process.PMKError: LocalizedError { + public var errorDescription: String? { + switch self { + case .notExecutable(let path?): + return "File not executable: \(path)" + case .notExecutable(nil): + return "No launch path specified" + case .execution(process: let task, standardOutput: _, standardError: _): + return "Failed executing: `\(task)` (\(task.terminationStatus))." + } + } +} + +public extension Promise where T == (out: Pipe, err: Pipe) { + func print() -> Promise { + return tap { result in + switch result { + case .fulfilled(let raw): + let stdout = String(data: raw.out.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) + let stderr = String(data: raw.err.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) + Swift.print("stdout: `\(stdout ?? "")`") + Swift.print("stderr: `\(stderr ?? "")`") + case .rejected(let err): + Swift.print(err) + } + } + } +} + +extension Process { + /// Provided because Foundation’s is USELESS + open override var description: String { + let launchPath = self.launchPath ?? "$0" + var args = [launchPath] + arguments.flatMap{ args += $0 } + return args.map { arg in + let contains: Bool + #if swift(>=3.2) + contains = arg.contains(" ") + #else + contains = arg.characters.contains(" ") + #endif + if contains { + return "\"\(arg)\"" + } else if arg == "" { + return "\"\"" + } else { + return arg + } + }.joined(separator: " ") + } +} + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/afterlife.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/afterlife.swift new file mode 100644 index 0000000..232c8da --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Sources/afterlife.swift @@ -0,0 +1,26 @@ +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + - Returns: A promise that resolves when the provided object deallocates + - Important: The promise is not guarenteed to resolve immediately when the provided object is deallocated. So you cannot write code that depends on exact timing. + */ +public func after(life object: NSObject) -> Guarantee { + var reaper = objc_getAssociatedObject(object, &handle) as? GrimReaper + if reaper == nil { + reaper = GrimReaper() + objc_setAssociatedObject(object, &handle, reaper, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + } + return reaper!.promise +} + +private var handle: UInt8 = 0 + +private class GrimReaper: NSObject { + deinit { + fulfill(()) + } + let (promise, fulfill) = Guarantee.pending() +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSNotificationCenter.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSNotificationCenter.swift new file mode 100644 index 0000000..3851029 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSNotificationCenter.swift @@ -0,0 +1,22 @@ +import PMKFoundation +import Foundation +import PromiseKit +import XCTest + +class NSNotificationCenterTests: XCTestCase { + func test() { + let ex = expectation(description: "") + let userInfo = ["a": 1] + + NotificationCenter.default.observe(once: PMKTestNotification).done { value in + XCTAssertEqual(value.userInfo?.count, 1) + ex.fulfill() + } + + NotificationCenter.default.post(name: PMKTestNotification, object: nil, userInfo: userInfo) + + waitForExpectations(timeout: 1) + } +} + +private let PMKTestNotification = Notification.Name("PMKTestNotification") diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSObject.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSObject.swift new file mode 100644 index 0000000..fc8806e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSObject.swift @@ -0,0 +1,76 @@ +import PMKFoundation +import Foundation +import PromiseKit +import XCTest + +class NSObjectTests: XCTestCase { + func testKVO() { + let ex = expectation(description: "") + + let foo = Foo() + foo.observe(.promise, keyPath: "bar").done { newValue in + XCTAssertEqual(newValue as? String, "moo") + ex.fulfill() + }.catch { _ in + XCTFail() + } + foo.bar = "moo" + + waitForExpectations(timeout: 1) + } + + func testAfterlife() { + let ex = expectation(description: "") + var killme: NSObject! + + autoreleasepool { + + func innerScope() { + killme = NSObject() + after(life: killme).done { _ in + //… + ex.fulfill() + } + } + + innerScope() + + after(.milliseconds(200)).done { + killme = nil + } + } + + waitForExpectations(timeout: 1) + } + + func testMultiObserveAfterlife() { + let ex1 = expectation(description: "") + let ex2 = expectation(description: "") + var killme: NSObject! + + autoreleasepool { + + func innerScope() { + killme = NSObject() + after(life: killme).done { _ in + ex1.fulfill() + } + after(life: killme).done { _ in + ex2.fulfill() + } + } + + innerScope() + + after(.milliseconds(200)).done { + killme = nil + } + } + + waitForExpectations(timeout: 1) + } +} + +private class Foo: NSObject { + @objc dynamic var bar: String = "bar" +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSTask.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSTask.swift new file mode 100644 index 0000000..8d94c48 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSTask.swift @@ -0,0 +1,50 @@ +import PMKFoundation +import Foundation +import PromiseKit +import XCTest + +#if os(macOS) + +class NSTaskTests: XCTestCase { + func test1() { + let ex = expectation(description: "") + let task = Process() + task.launchPath = "/usr/bin/basename" + task.arguments = ["/foo/doe/bar"] + task.launch(.promise).done { stdout, _ in + let stdout = String(data: stdout.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) + XCTAssertEqual(stdout, "bar\n") + ex.fulfill() + } + waitForExpectations(timeout: 10) + } + + func test2() { + let ex = expectation(description: "") + let dir = "PMKAbsentDirectory" + + let task = Process() + task.launchPath = "/bin/ls" + task.arguments = [dir] + + task.launch(.promise).done { _ in + XCTFail() + }.catch { err in + do { + throw err + } catch Process.PMKError.execution(let proc, let stdout, let stderr) { + let expectedStderr = "ls: \(dir): No such file or directory\n" + + XCTAssertEqual(stderr, expectedStderr) + XCTAssertEqual(proc.terminationStatus, 1) + XCTAssertEqual(stdout?.count ?? 0, 0) + } catch { + XCTFail() + } + ex.fulfill() + } + waitForExpectations(timeout: 10) + } +} + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSURLSession.m b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSURLSession.m new file mode 100644 index 0000000..314de69 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSURLSession.m @@ -0,0 +1,55 @@ +@import PMKFoundation; +@import OHHTTPStubs; +@import Foundation; +@import PromiseKit; +@import XCTest; + +@implementation NSURLSessionTests: XCTestCase + +- (void)tearDown { + [OHHTTPStubs removeAllStubs]; +} + +- (void)test200 { + id stubData = [NSData dataWithBytes:"a" length:1]; + + [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *rq){ + return [rq.URL.host isEqualToString:@"example.com"]; + } withStubResponse:^(NSURLRequest *request){ + return [OHHTTPStubsResponse responseWithData:stubData statusCode:200 headers:@{@"Content-Type": @"text/html"}]; + }]; + + id ex = [self expectationWithDescription:@""]; + id rq = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com"]]; + + [[NSURLSession sharedSession] promiseDataTaskWithRequest:rq].then(^{ + [ex fulfill]; + }); + + [self waitForExpectationsWithTimeout:10 handler:nil]; +} + +- (void)testBadJSON { + id stubData = [NSData dataWithBytes:"[a: 3]" length:1]; + + [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *rq){ + return [rq.URL.host isEqualToString:@"example.com"]; + } withStubResponse:^(NSURLRequest *request){ + return [OHHTTPStubsResponse responseWithData:stubData statusCode:200 headers:@{@"Content-Type": @"application/json"}]; + }]; + + id ex = [self expectationWithDescription:@""]; + id rq = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com"]]; + + [[NSURLSession sharedSession] promiseDataTaskWithRequest:rq].catch(^(NSError *err){ + XCTAssertEqualObjects(err.domain, NSCocoaErrorDomain); //TODO this is why we should replace this domain + XCTAssertEqual(err.code, 3840); + XCTAssertEqualObjects(err.userInfo[PMKURLErrorFailingDataKey], stubData); + XCTAssertNotNil(err.userInfo[PMKURLErrorFailingURLResponseKey]); + [ex fulfill]; + }); + + [self waitForExpectationsWithTimeout:10 handler:nil]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSURLSession.swift b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSURLSession.swift new file mode 100644 index 0000000..f6906b5 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Foundation/Tests/TestNSURLSession.swift @@ -0,0 +1,76 @@ +import PMKFoundation +import OHHTTPStubs +import PromiseKit +import XCTest + +class NSURLSessionTests: XCTestCase { + func test1() { + let json: NSDictionary = ["key1": "value1", "key2": ["value2A", "value2B"]] + + OHHTTPStubs.stubRequests(passingTest: { $0.url!.host == "example.com" }) { _ in + return OHHTTPStubsResponse(jsonObject: json, statusCode: 200, headers: nil) + } + + let ex = expectation(description: "") + let rq = URLRequest(url: URL(string: "http://example.com")!) + firstly { + URLSession.shared.dataTask(.promise, with: rq) + }.compactMap { + try JSONSerialization.jsonObject(with: $0.data) as? NSDictionary + }.done { rsp in + XCTAssertEqual(json, rsp) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func test2() { + + // test that URLDataPromise chains thens + // this test because I don’t trust the Swift compiler + + let dummy = ("fred" as NSString).data(using: String.Encoding.utf8.rawValue)! + + OHHTTPStubs.stubRequests(passingTest: { $0.url!.host == "example.com" }) { _ in + return OHHTTPStubsResponse(data: dummy, statusCode: 200, headers: [:]) + } + + let ex = expectation(description: "") + let rq = URLRequest(url: URL(string: "http://example.com")!) + + after(.milliseconds(100)).then { + URLSession.shared.dataTask(.promise, with: rq) + }.done { x in + XCTAssertEqual(x.data, dummy) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + + /// test that our convenience String constructor applies + func test3() { + let dummy = "fred" + + OHHTTPStubs.stubRequests(passingTest: { $0.url!.host == "example.com" }) { _ in + let data = dummy.data(using: .utf8)! + return OHHTTPStubsResponse(data: data, statusCode: 200, headers: [:]) + } + + let ex = expectation(description: "") + let rq = URLRequest(url: URL(string: "http://example.com")!) + + after(.milliseconds(100)).then { + URLSession.shared.dataTask(.promise, with: rq) + }.map(String.init).done { + XCTAssertEqual($0, dummy) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + + override func tearDown() { + OHHTTPStubs.removeAllStubs() + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/.travis.yml new file mode 100644 index 0000000..1b61a4e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/.travis.yml @@ -0,0 +1,39 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'PLAT=iOS SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + - {osx_image: xcode8.3, env: 'PLAT=watchOS SWFT=3.1 DST="OS=3.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=3.2 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=3.3 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=4.0 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.3, env: 'PLAT=iOS SWFT=4.1 DST="OS=9.3,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=10.3.1,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode9.3, env: 'PLAT=watchOS SWFT=4.1 DST="OS=2.2,name=Apple Watch - 38mm"'} + - {osx_image: xcode9.3, env: 'PLAT=watchOS SWFT=4.1 DST="OS=3.2,name=Apple Watch - 38mm"'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=4.1 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode10, env: 'PLAT=watchOS SWFT=4.2 DST="OS=5.0,name=Apple Watch Series 3 - 42mm"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKHealthKit -target PMKHealthKit -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [ "$TEST" == "1" ]; then + xcodebuild -scheme PMKHealthKit -target PMKHKTests -quiet -destination "$DST" build; + fi +script: + - if [ "$TEST" == "1" ]; then + xcodebuild -scheme PMKHealthKit -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Cartfile.resolved new file mode 100644 index 0000000..a1699c6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.4.1" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Info.plist new file mode 100644 index 0000000..20b05ec --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ce31745 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.pbxproj @@ -0,0 +1,447 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6384FB811D5D4F6D00453755 /* HealthKit+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6384FB801D5D4F6D00453755 /* HealthKit+Promise.swift */; }; + 6384FB831D5D4F8B00453755 /* TestHealthKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6384FB821D5D4F8B00453755 /* TestHealthKit.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKHealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKHealthKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKWatchConnectivity; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6384FB801D5D4F6D00453755 /* HealthKit+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "HealthKit+Promise.swift"; path = "Sources/HealthKit+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 6384FB821D5D4F8B00453755 /* TestHealthKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestHealthKit.swift; path = Tests/TestHealthKit.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKHealthKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKHealthKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKHKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKHKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKHealthKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKHealthKit.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKHKTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 6384FB801D5D4F6D00453755 /* HealthKit+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 6384FB821D5D4F8B00453755 /* TestHealthKit.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKHealthKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKHealthKit" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKHealthKit; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKHealthKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKHKTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKHKTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKHKTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKHKTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKHealthKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKHealthKit */, + 63C7FFF11D5C020D003BAE60 /* PMKHKTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6384FB811D5D4F6D00453755 /* HealthKit+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6384FB831D5D4F8B00453755 /* TestHealthKit.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKHealthKit */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKHealthKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKHealthKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKHKTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/xcshareddata/xcschemes/PMKHealthKit.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/xcshareddata/xcschemes/PMKHealthKit.xcscheme new file mode 100644 index 0000000..70a615b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/PMKHealthKit.xcodeproj/xcshareddata/xcschemes/PMKHealthKit.xcscheme @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/README.markdown new file mode 100644 index 0000000..a457ad4 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit HealthKit Extensions ![Build Status] + +This project adds promises to Apple’s HealthKit framework. + +## CocoaPods + +```ruby +pod "PromiseKit/HealthKit" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/PMKHealthKit" ~> 1.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKHealthKit +``` + +```objc +// objc +@import PromiseKit; +@import PMKHealthKit; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/PMKHealthKit.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Sources/HealthKit+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Sources/HealthKit+Promise.swift new file mode 100644 index 0000000..03029c4 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Sources/HealthKit+Promise.swift @@ -0,0 +1,71 @@ +import HealthKit +#if !PMKCocoaPods +import PromiseKit +#endif + +public extension HKHealthStore { + func requestAuthorization(toShare typesToShare: Set?, read typesToRead: Set?) -> Promise { + return Promise { seal in + requestAuthorization(toShare: typesToShare, read: typesToRead, completion: seal.resolve) + } + } + +#if os(iOS) + func enableBackgroundDelivery(for type: HKObjectType, frequency: HKUpdateFrequency) -> Promise { + return Promise { seal in + enableBackgroundDelivery(for: type, frequency: frequency, withCompletion: seal.resolve) + } + } +#endif +} + +public extension HKStatisticsQuery { + static func promise(quantityType: HKQuantityType, quantitySamplePredicate: NSPredicate? = nil, options: HKStatisticsOptions = [], healthStore: HKHealthStore = .init()) -> Promise { + return Promise { seal in + let query = HKStatisticsQuery(quantityType: quantityType, quantitySamplePredicate: quantitySamplePredicate, options: options) { + seal.resolve($1, $2) + } + healthStore.execute(query) + } + } +} + +public extension HKAnchoredObjectQuery { + static func promise(type: HKSampleType, predicate: NSPredicate? = nil, anchor: HKQueryAnchor? = nil, limit: Int = HKObjectQueryNoLimit, healthStore: HKHealthStore = .init()) -> Promise<([HKSample], [HKDeletedObject], HKQueryAnchor)> { + return Promise { seal in + let query = HKAnchoredObjectQuery(type: type, predicate: predicate, anchor: anchor, limit: limit) { + if let a = $1, let b = $2, let c = $3 { + seal.fulfill((a, b, c)) + } else if let e = $4 { + seal.reject(e) + } else { + seal.reject(PMKError.invalidCallingConvention) + } + } + healthStore.execute(query) + } + } + +} + +public extension HKStatisticsCollectionQuery { + func promise(healthStore: HKHealthStore = .init()) -> Promise { + return Promise { seal in + initialResultsHandler = { + seal.resolve($1, $2) + } + healthStore.execute(self) + } + } +} + +public extension HKSampleQuery { + static func promise(sampleType: HKSampleType, predicate: NSPredicate? = nil, limit: Int = HKObjectQueryNoLimit, sortDescriptors: [NSSortDescriptor]? = nil, healthStore: HKHealthStore = .init()) -> Promise<[HKSample]> { + return Promise { seal in + let query = HKSampleQuery(sampleType: sampleType, predicate: predicate, limit: limit, sortDescriptors: sortDescriptors) { + seal.resolve($1, $2) + } + healthStore.execute(query) + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Tests/TestHealthKit.swift b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Tests/TestHealthKit.swift new file mode 100644 index 0000000..727a09d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HealthKit/Tests/TestHealthKit.swift @@ -0,0 +1,4 @@ +import PMKHealthKit +import PromiseKit +import HealthKit +import XCTest diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/.travis.yml new file mode 100644 index 0000000..1266a3b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/.travis.yml @@ -0,0 +1,41 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode9.2, env: 'PLAT=tvOS SWFT=3.2 DST="OS=11.2,name=Apple TV"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=3.2 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=3.3 DST="OS=11.4,name=iPhone SE"'} + - {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=3.3 DST="OS=11.4,name=Apple TV"'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=3.3 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=3.4 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode10, env: 'PLAT=tvOS SWFT=3.4 DST="OS=12.0,name=Apple TV"'} + - {osx_image: xcode10, env: 'PLAT=watchOS SWFT=3.4 DST="OS=5.0,name=Apple Watch Series 3 - 42mm"'} + + - {osx_image: xcode9.2, env: 'PLAT=tvOS SWFT=4.0 DST="OS=11.2,name=Apple TV"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=4.0 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode9.3, env: 'PLAT=tvOS SWFT=4.1 DST="OS=10.2,name=Apple TV 1080p"'} + - {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=4.1 DST="OS=11.4,name=Apple TV" TEST=1'} + - {osx_image: xcode9.3, env: 'PLAT=watchOS SWFT=4.1 DST="OS=3.2,name=Apple Watch - 38mm"'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=4.1 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode10, env: 'PLAT=tvOS SWFT=4.2 DST="OS=12.0,name=Apple TV"'} + - {osx_image: xcode10, env: 'PLAT=watchOS SWFT=4.2 DST="OS=5.0,name=Apple Watch Series 3 - 42mm"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKHomeKit -target PMKHomeKit -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKHomeKit -target PMKHKTests -quiet -destination "$DST" build; + fi +script: + - if [[ "$TEST" == "1" ]]; then + xcodebuild -scheme PMKHomeKit -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Cartfile.resolved new file mode 100644 index 0000000..8d4fefc --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.4" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Carthage.xcconfig new file mode 100644 index 0000000..de9f238 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Carthage.xcconfig @@ -0,0 +1,6 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b8bb250 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.pbxproj @@ -0,0 +1,465 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63C7FFF71D5C020D003BAE60 /* PMKHomeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKHomeKit.framework */; }; + 8312EA1521096DF000A47DDF /* HMAccessoryBrowserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8312EA1421096DF000A47DDF /* HMAccessoryBrowserTests.swift */; }; + 8312EA19210974F600A47DDF /* UtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8312EA18210974F600A47DDF /* UtilsTests.swift */; }; + 838C29D32103FB9700CE5309 /* HMAcessoryBrowser+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 838C29CE2103FB9600CE5309 /* HMAcessoryBrowser+Promise.swift */; }; + 838C29D42103FB9700CE5309 /* HMHome+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 838C29CF2103FB9700CE5309 /* HMHome+Promise.swift */; }; + 838C29D52103FB9700CE5309 /* HMCharacteristic+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 838C29D02103FB9700CE5309 /* HMCharacteristic+Promise.swift */; }; + 838C29D62103FB9700CE5309 /* HMHomeManager+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 838C29D12103FB9700CE5309 /* HMHomeManager+Promise.swift */; }; + 838C29D72103FB9700CE5309 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 838C29D22103FB9700CE5309 /* Utils.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKCoreLocation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKHomeKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKHomeKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKHKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKHKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 8312EA1421096DF000A47DDF /* HMAccessoryBrowserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMAccessoryBrowserTests.swift; sourceTree = ""; }; + 8312EA18210974F600A47DDF /* UtilsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UtilsTests.swift; sourceTree = ""; }; + 838C29CE2103FB9600CE5309 /* HMAcessoryBrowser+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HMAcessoryBrowser+Promise.swift"; sourceTree = ""; }; + 838C29CF2103FB9700CE5309 /* HMHome+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HMHome+Promise.swift"; sourceTree = ""; }; + 838C29D02103FB9700CE5309 /* HMCharacteristic+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HMCharacteristic+Promise.swift"; sourceTree = ""; }; + 838C29D12103FB9700CE5309 /* HMHomeManager+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "HMHomeManager+Promise.swift"; sourceTree = ""; }; + 838C29D22103FB9700CE5309 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKHomeKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKHomeKit.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKHKTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 838C29D02103FB9700CE5309 /* HMCharacteristic+Promise.swift */, + 838C29CE2103FB9600CE5309 /* HMAcessoryBrowser+Promise.swift */, + 838C29CF2103FB9700CE5309 /* HMHome+Promise.swift */, + 838C29D12103FB9700CE5309 /* HMHomeManager+Promise.swift */, + 838C29D22103FB9700CE5309 /* Utils.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 8312EA1421096DF000A47DDF /* HMAccessoryBrowserTests.swift */, + 8312EA18210974F600A47DDF /* UtilsTests.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKHomeKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKHomeKit" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKHomeKit; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKHomeKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKHKTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKHKTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKHKTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKHKTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0940; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKHomeKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKHomeKit */, + 63C7FFF11D5C020D003BAE60 /* PMKHKTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 838C29D62103FB9700CE5309 /* HMHomeManager+Promise.swift in Sources */, + 838C29D52103FB9700CE5309 /* HMCharacteristic+Promise.swift in Sources */, + 838C29D42103FB9700CE5309 /* HMHome+Promise.swift in Sources */, + 838C29D32103FB9700CE5309 /* HMAcessoryBrowser+Promise.swift in Sources */, + 838C29D72103FB9700CE5309 /* Utils.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8312EA1521096DF000A47DDF /* HMAccessoryBrowserTests.swift in Sources */, + 8312EA19210974F600A47DDF /* UtilsTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKHomeKit */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.CoreLocation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.CoreLocation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKHomeKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKHomeKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKHKTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/xcshareddata/xcschemes/PMKHomeKit.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/xcshareddata/xcschemes/PMKHomeKit.xcscheme new file mode 100644 index 0000000..a09f1c8 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/PMKHomeKit.xcodeproj/xcshareddata/xcschemes/PMKHomeKit.xcscheme @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/README.markdown new file mode 100644 index 0000000..b48f5d6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/README.markdown @@ -0,0 +1,32 @@ +# PromiseKit HomeKit Extensions ![Build Status] + +This project adds promises to Apple’s HomeKit framework. + +* Xcode >= 9.3 required for iOS +* Xcode >= 9.0 required for all other platforms + +Thus, Swift versions supported are: 3.2, 3.3, 3.4, 4.0, 4.1 & 4.2. + +## CocoaPods + +```ruby +pod "PromiseKit/HomeKit", "~> 6.0" +``` + +The extensions are built into PromiseKit.framework thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/HomeKit" ~> 1.0 +``` + +The extension is built into it's own framework: + +```swift +import PromiseKit +import PMKHomeKit +``` + + +[Build Status]: https://travis-ci.org/chrischares/PromiseKit-HomeKit.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMAcessoryBrowser+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMAcessoryBrowser+Promise.swift new file mode 100644 index 0000000..80d2e52 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMAcessoryBrowser+Promise.swift @@ -0,0 +1,78 @@ +import Foundation +import HomeKit +#if !PMKCocoaPods +import PromiseKit +#endif + +#if !os(tvOS) && !os(watchOS) + +public enum HMPromiseAccessoryBrowserError: Error { + case noAccessoryFound +} + +public class HMPromiseAccessoryBrowser { + private var proxy: BrowserProxy? + + public func start(scanInterval: ScanInterval) -> Promise<[HMAccessory]> { + proxy = BrowserProxy(scanInterval: scanInterval) + return proxy!.promise + } + + public func stop() { + proxy?.cancel() + } +} + +private class BrowserProxy: PromiseProxy<[HMAccessory]>, HMAccessoryBrowserDelegate { + let browser = HMAccessoryBrowser() + let scanInterval: ScanInterval + + init(scanInterval: ScanInterval) { + self.scanInterval = scanInterval + super.init() + + browser.delegate = self; + browser.startSearchingForNewAccessories() + + //if we have a timeout, set it up + var timeout: TimeInterval? = nil + switch scanInterval { + case .returnAll(let interval): timeout = interval + case .returnFirst(let interval): timeout = interval + } + + if let timeout = timeout { + after(seconds: timeout) + .done { [weak self] () -> Void in + guard let _self = self else { return } + _self.reject(HMPromiseAccessoryBrowserError.noAccessoryFound) + } + } + } + + override func fulfill(_ value: [HMAccessory]) { + browser.stopSearchingForNewAccessories() + super.fulfill(value) + } + + override func reject(_ error: Error ) { + browser.stopSearchingForNewAccessories() + super.reject(error) + } + + override func cancel() { + browser.stopSearchingForNewAccessories() + super.cancel() + } + + /** + HMAccessoryBrowser delegate + */ + func accessoryBrowser(_ browser: HMAccessoryBrowser, didFindNewAccessory accessory: HMAccessory) { + if case .returnFirst = scanInterval { + fulfill([accessory]) + } + } +} + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMCharacteristic+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMCharacteristic+Promise.swift new file mode 100644 index 0000000..a116536 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMCharacteristic+Promise.swift @@ -0,0 +1,46 @@ +import Foundation +import HomeKit +#if !PMKCocoaPods +import PromiseKit +#endif + +public enum AccessoryError: Error { + case incorrectType + case serviceMissing + case characteristicMissing +} + +@available(iOS 8.0, tvOS 10.0, *) +extension HMCharacteristic { + /** + A simple typesafe promise wrapper around readValue + */ + public func read() -> Promise { + return Promise { seal in + self.readValue { error in + if let error = error { seal.reject(error) } + else if let value = self.value as? T { seal.fulfill(value) } + else { seal.reject(AccessoryError.incorrectType) } + } + } + } + /// Because type inference is great... until you can't compile (thanks Swift) + public func readFloat() -> Promise { return read() } + public func readDouble() -> Promise { return read() } + public func readInt() -> Promise { return read() } + public func readString() -> Promise { return read() } + + /** + A simple promise wrapper around writeValue + */ + public func write(_ value: Any?) -> Promise { + return Promise { seal in + self.writeValue(value, completionHandler: seal.resolve) + } + } + /// Explicit is good + public func writeFloat(_ value: Float) -> Promise { return write(value) } + public func writeDouble(_ value: Double) -> Promise { return write(value) } + public func writeInt(_ value: Int) -> Promise { return write(value) } + public func writeString(_ value: String) -> Promise { return write(value) } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMHome+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMHome+Promise.swift new file mode 100644 index 0000000..cbf6a95 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMHome+Promise.swift @@ -0,0 +1,82 @@ +import Foundation +import HomeKit +#if !PMKCocoaPods +import PromiseKit +#endif + +#if !os(tvOS) && !os(watchOS) + +extension HMHome { + + @available(iOS 8.0, *) + public func updateName(_ name: String) -> Promise { + return Promise { seal in + self.updateName(name, completionHandler: seal.resolve) + } + } + + /// Add and setup a new HMAccessory. Displays it's own UI + @available(iOS 11.3, *) + public func addAndSetupAccessories(with payload: HMAccessorySetupPayload) -> Promise<[HMAccessory]> { + return Promise { seal in + self.addAndSetupAccessories(with: payload, completionHandler: seal.resolve) + } + } + + /// Add and setup a new HMAccessory. Displays it's own UI + @available(iOS 10.0, *) + public func addAndSetupAccessories() -> Promise<[HMAccessory]> { + // We need to compare what we have before the action to after to know what is new + let beforeAccessories = self.accessories + let home = self + + return Promise { seal in + self.addAndSetupAccessories { error in + if let error = error { seal.reject(error) } + else { + let newAccessories = home.accessories.filter { beforeAccessories.contains($0) == false } + seal.fulfill(newAccessories) + } + } + } + } + + @available(iOS 8.0, *) + public func addAccessory(_ accessory: HMAccessory) -> Promise { + return Promise { seal in + self.addAccessory(accessory, completionHandler: seal.resolve) + } + } + + @available(iOS 8.0, *) + public func assignAccessory(_ accessory: HMAccessory, to room: HMRoom) -> Promise { + return Promise { seal in + self.assignAccessory(accessory, to: room, completionHandler: seal.resolve) + } + } + + @available(iOS 8.0, *) + public func removeAccessory(_ accessory: HMAccessory) -> Promise { + return Promise { seal in + self.removeAccessory(accessory, completionHandler: seal.resolve) + } + } + + /** + Rooms + */ + @available(iOS 8.0, *) + public func addRoom(withName name: String) -> Promise { + return Promise { seal in + self.addRoom(withName: name, completionHandler: seal.resolve) + } + } + + @available(iOS 8.0, *) + public func removeRoom(_ room: HMRoom) -> Promise { + return Promise { seal in + self.removeRoom(room, completionHandler: seal.resolve) + } + } +} +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMHomeManager+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMHomeManager+Promise.swift new file mode 100644 index 0000000..33e6311 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/HMHomeManager+Promise.swift @@ -0,0 +1,62 @@ +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif +import HomeKit + +@available(iOS 8.0, tvOS 10.0, *) +public enum HomeKitError: Error { + case permissionDeined +} + +@available(iOS 8.0, tvOS 10.0, *) +extension HMHomeManager { + public func homes() -> Promise<[HMHome]> { + return HMHomeManagerProxy().promise + } + + #if !os(tvOS) && !os(watchOS) + + @available(iOS 8.0, *) + public func addHome(withName name: String) -> Promise { + return Promise { seal in + self.addHome(withName: name, completionHandler: seal.resolve) + } + } + + @available(iOS 8.0, *) + public func removeHome(_ home: HMHome) -> Promise { + return Promise { seal in + self.removeHome(home, completionHandler: seal.resolve) + } + } + + @available(iOS 8.0, *) + public func updatePrimaryHome(_ home: HMHome) -> Promise { + return Promise { seal in + self.updatePrimaryHome(home, completionHandler: seal.resolve) + } + } + + #endif +} + +@available(iOS 8.0, tvOS 10.0, *) +internal class HMHomeManagerProxy: PromiseProxy<[HMHome]>, HMHomeManagerDelegate { + + fileprivate let manager: HMHomeManager + + override init() { + self.manager = HMHomeManager() + super.init() + self.manager.delegate = self + + DispatchQueue.main.asyncAfter(deadline: .now() + 20.0) { [weak self] in + self?.reject(HomeKitError.permissionDeined) + } + } + + func homeManagerDidUpdateHomes(_ manager: HMHomeManager) { + fulfill(manager.homes) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/Utils.swift b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/Utils.swift new file mode 100644 index 0000000..907dbbd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Sources/Utils.swift @@ -0,0 +1,45 @@ +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + Commonly used functionality when promisifying a delegate pattern +*/ +internal class PromiseProxy: NSObject { + internal let (promise, seal) = Promise.pending(); + + private var retainCycle: PromiseProxy? + + override init() { + super.init() + // Create a retain cycle + self.retainCycle = self + // And ensure we break it when the promise is resolved + _ = promise.ensure { self.retainCycle = nil } + } + + /// These functions ensure we only resolve the promise once + internal func fulfill(_ value: T) { + guard self.promise.isResolved == false else { return } + seal.fulfill(value) + } + internal func reject(_ error: Error) { + guard self.promise.isResolved == false else { return } + seal.reject(error) + } + + /// Cancel helper + internal func cancel() { + self.reject(PMKError.cancelled) + } +} + +/** + Different ways to scan. +*/ +public enum ScanInterval { + // Return after our first item with an optional time limit + case returnFirst(timeout: TimeInterval?) + // Scan for this duration before returning all + case returnAll(interval: TimeInterval) +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/Entitlements.plist b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/Entitlements.plist new file mode 100644 index 0000000..76a15bb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/Entitlements.plist @@ -0,0 +1,12 @@ + + + + + com.apple.private.tcc.allow + + kTCCServiceAddressBook + kTCCServiceCalendar + kTCCServicePhotos + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/HMAccessoryBrowserTests.swift b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/HMAccessoryBrowserTests.swift new file mode 100644 index 0000000..b6f555f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/HMAccessoryBrowserTests.swift @@ -0,0 +1,84 @@ +// +// HMAccessoryBrowserTests.swift +// PMKHKTests +// +// Created by Chris Chares on 7/25/18. +// Copyright © 2018 Max Howell. All rights reserved. +// + +import XCTest +import PromiseKit +import HomeKit +@testable import PMKHomeKit + +#if os(iOS) + +class HMAccessoryBrowserTests: XCTestCase { + + func testBrowserScanReturningFirst() { + swizzle(HMAccessoryBrowser.self, #selector(HMAccessoryBrowser.startSearchingForNewAccessories)) { + let ex = expectation(description: "") + + HMPromiseAccessoryBrowser().start(scanInterval: .returnFirst(timeout: 0.5)) + .done { accessories in + XCTAssertEqual(accessories.count, 1) + ex.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } + } + + func testBrowserScanReturningTimeout() { + let ex = expectation(description: "") + + HMPromiseAccessoryBrowser().start(scanInterval: .returnFirst(timeout: 0.5)) + .catch { error in + // Why would we have discovered anything? + ex.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } +} + +extension HMAccessoryBrowser { + @objc func pmk_startSearchingForNewAccessories() { + after(.milliseconds(100)) + .done { swag in + self.delegate!.accessoryBrowser?(self, didFindNewAccessory: MockAccessory()) + } + } +} + +/// Mocks +class MockAccessory: HMAccessory { + var _uniqueID: UUID = UUID() + override var uniqueIdentifier: UUID { return _uniqueID } + + override init() { + super.init() + } +} + +// Utilty taken from https://github.com/PromiseKit/CoreLocation/blob/master/Tests/CLLocationManagerTests.swift +import ObjectiveC + +func swizzle(_ foo: AnyClass, _ from: Selector, isClassMethod: Bool = false, body: () -> Void) { + let originalMethod: Method + let swizzledMethod: Method + + if isClassMethod { + originalMethod = class_getClassMethod(foo, from)! + swizzledMethod = class_getClassMethod(foo, Selector("pmk_\(from)"))! + } else { + originalMethod = class_getInstanceMethod(foo, from)! + swizzledMethod = class_getInstanceMethod(foo, Selector("pmk_\(from)"))! + } + + method_exchangeImplementations(originalMethod, swizzledMethod) + body() + method_exchangeImplementations(swizzledMethod, originalMethod) +} + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/UtilsTests.swift b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/UtilsTests.swift new file mode 100644 index 0000000..d1c167c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/HomeKit/Tests/UtilsTests.swift @@ -0,0 +1,63 @@ +// +// UtilsTests.swift +// PMKHKTests +// +// Created by Chris Chares on 7/25/18. +// Copyright © 2018 Max Howell. All rights reserved. +// + +import XCTest +import PromiseKit +@testable import PMKHomeKit + +class UtilsTests: XCTestCase { + + var strongProxy: PromiseProxy? = PromiseProxy() + + override func setUp() { + strongProxy = PromiseProxy() + } + + override func tearDown() { + strongProxy = nil + } + + // The proxy should create a retain cycle until the promise is resolved + func testRetainCycle() { + weak var weakVar = strongProxy + XCTAssertNotNil(weakVar) + + let exp = expectation(description: "") + strongProxy = nil + after(.milliseconds(50)) + .done { + XCTAssertNotNil(weakVar) + exp.fulfill() + } + waitForExpectations(timeout: 1.0, handler: nil) + } + + // Once resolved, the proxy should break the retain cycle + func testRelease() { + weak var weakVar = strongProxy + XCTAssertNotNil(weakVar) + + let exp = expectation(description: "") + strongProxy!.fulfill(42) + strongProxy = nil + + after(.milliseconds(50)) + .done { + XCTAssertNil(weakVar) + exp.fulfill() + } + waitForExpectations(timeout: 1.0, handler: nil) + } + + // Cancel should reject with a PMKError + func testCancel() { + let proxy = strongProxy! + proxy.cancel() + XCTAssertNotNil(proxy.promise.error) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/.gitignore new file mode 100644 index 0000000..f5554ff --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/.gitignore @@ -0,0 +1,5 @@ +xcuserdata +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/.travis.yml new file mode 100644 index 0000000..d27b1dc --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/.travis.yml @@ -0,0 +1,72 @@ +branches: + only: + - master +stages: + - lint + - test +jobs: + include: + - &pod + stage: lint + osx_image: xcode8.3 + env: SWIFT=3.1 + name: pod lib lint --swift-version=3.1 + os: osx + language: objective-c + before_install: + gem install cocoapods --prerelease --version 1.6.0.beta.1 + install: + carthage bootstrap --no-build PromiseKit + script: | + cd Carthage/Checkouts/PromiseKit + mv .github/PromiseKit.podspec . + rm -rf Extensions/MapKit/Sources + cp -R ../../../Sources Extensions/MapKit + pod lib lint --subspec=PromiseKit/MapKit --fail-fast --swift-version=$SWIFT + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=3.2 + name: pod lib lint --swift-version=3.2 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=3.3 + name: pod lib lint --swift-version=3.3 + - <<: *pod + osx_image: xcode10 + env: SWIFT=3.4 + name: pod lib lint --swift-version=3.4 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=4.0 + name: pod lib lint --swift-version=4.0 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=4.1 + name: pod lib lint --swift-version=4.1 + - <<: *pod + osx_image: xcode10 + env: SWIFT=4.2 + name: pod lib lint --swift-version=4.2 + + - &test + stage: test + osx_image: xcode10 + name: macOS Tests + env: DST='arch=x86_64' PLAT=macOS + os: osx + language: objective-c + cache: + directories: + - Carthage + before_install: + carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT + install: + xcodebuild -scheme PMKMapKit -target PMKMapKit -quiet -destination "$DST" SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: + xcodebuild -scheme PMKMapKit -quiet -destination "$DST" test + - <<: *test + env: DST='OS=12.0,name=iPhone SE' PLAT=iOS + name: iOS Tests + - <<: *test + env: DST='OS=12.0,name=Apple TV' PLAT=tvOS + name: tvOS Tests diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Cartfile.resolved new file mode 100644 index 0000000..d903612 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.5.0" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0e1b3d9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.pbxproj @@ -0,0 +1,471 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6358AB711D5D4B3A00B9B157 /* MKDirections+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6358AB6B1D5D4B3A00B9B157 /* MKDirections+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6358AB721D5D4B3A00B9B157 /* MKDirections+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 6358AB6C1D5D4B3A00B9B157 /* MKDirections+AnyPromise.m */; }; + 6358AB731D5D4B3A00B9B157 /* MKDirections+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6358AB6D1D5D4B3A00B9B157 /* MKDirections+Promise.swift */; }; + 6358AB741D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6358AB6E1D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6358AB751D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 6358AB6F1D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.m */; }; + 6358AB761D5D4B3A00B9B157 /* MKMapSnapshotter+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6358AB701D5D4B3A00B9B157 /* MKMapSnapshotter+Promise.swift */; }; + 6358AB781D5D4B4700B9B157 /* TestMapKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6358AB771D5D4B4700B9B157 /* TestMapKit.swift */; }; + 6358AB7A1D5D4B6700B9B157 /* PMKMapKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 6358AB791D5D4B6700B9B157 /* PMKMapKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63C7FFF71D5C020D003BAE60 /* PMKMapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKMapKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKMapKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6358AB6B1D5D4B3A00B9B157 /* MKDirections+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "MKDirections+AnyPromise.h"; path = "Sources/MKDirections+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 6358AB6C1D5D4B3A00B9B157 /* MKDirections+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "MKDirections+AnyPromise.m"; path = "Sources/MKDirections+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 6358AB6D1D5D4B3A00B9B157 /* MKDirections+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MKDirections+Promise.swift"; path = "Sources/MKDirections+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 6358AB6E1D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "MKMapSnapshotter+AnyPromise.h"; path = "Sources/MKMapSnapshotter+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 6358AB6F1D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "MKMapSnapshotter+AnyPromise.m"; path = "Sources/MKMapSnapshotter+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 6358AB701D5D4B3A00B9B157 /* MKMapSnapshotter+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MKMapSnapshotter+Promise.swift"; path = "Sources/MKMapSnapshotter+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 6358AB771D5D4B4700B9B157 /* TestMapKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestMapKit.swift; path = Tests/TestMapKit.swift; sourceTree = SOURCE_ROOT; }; + 6358AB791D5D4B6700B9B157 /* PMKMapKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKMapKit.h; path = Sources/PMKMapKit.h; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKMapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKMapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKMKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKMKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKMapKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKMapKit.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKMKTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 6358AB791D5D4B6700B9B157 /* PMKMapKit.h */, + 6358AB6B1D5D4B3A00B9B157 /* MKDirections+AnyPromise.h */, + 6358AB6C1D5D4B3A00B9B157 /* MKDirections+AnyPromise.m */, + 6358AB6D1D5D4B3A00B9B157 /* MKDirections+Promise.swift */, + 6358AB6E1D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.h */, + 6358AB6F1D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.m */, + 6358AB701D5D4B3A00B9B157 /* MKMapSnapshotter+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 6358AB771D5D4B4700B9B157 /* TestMapKit.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6358AB7A1D5D4B6700B9B157 /* PMKMapKit.h in Headers */, + 6358AB711D5D4B3A00B9B157 /* MKDirections+AnyPromise.h in Headers */, + 6358AB741D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKMapKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKMapKit" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKMapKit; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKMapKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKMKTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKMKTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKMKTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKMKTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKMapKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKMapKit */, + 63C7FFF11D5C020D003BAE60 /* PMKMKTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6358AB761D5D4B3A00B9B157 /* MKMapSnapshotter+Promise.swift in Sources */, + 6358AB751D5D4B3A00B9B157 /* MKMapSnapshotter+AnyPromise.m in Sources */, + 6358AB721D5D4B3A00B9B157 /* MKDirections+AnyPromise.m in Sources */, + 6358AB731D5D4B3A00B9B157 /* MKDirections+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6358AB781D5D4B4700B9B157 /* TestMapKit.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKMapKit */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.MapKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.2; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.MapKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.2; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKMapKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKMapKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKMKTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/xcshareddata/xcschemes/PMKMapKit.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/xcshareddata/xcschemes/PMKMapKit.xcscheme new file mode 100644 index 0000000..a1df4b6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/PMKMapKit.xcodeproj/xcshareddata/xcschemes/PMKMapKit.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/README.markdown new file mode 100644 index 0000000..e302b4c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit MapKit Extensions ![Build Status] + +This project adds promises to Apple’s MapKit framework. + +## CocoaPods + +```ruby +pod "PromiseKit/MapKit", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/MapKit" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKMapKit +``` + +```objc +// objc +@import PromiseKit; +@import PMKMapKit; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/MapKit.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+AnyPromise.h new file mode 100644 index 0000000..e227cfb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+AnyPromise.h @@ -0,0 +1,30 @@ +#import +#import + +/** + To import the `MKDirections` category: + + use_frameworks! + pod "PromiseKit/MapKit" + + And then in your sources: + + @import PromiseKit; +*/ +@interface MKDirections (PromiseKit) + +/** + Begins calculating the requested route information asynchronously. + + @return A promise that fulfills with a `MKDirectionsResponse`. +*/ +- (AnyPromise *)calculateDirections NS_REFINED_FOR_SWIFT; + +/** + Begins calculating the requested travel-time information asynchronously. + + @return A promise that fulfills with a `MKETAResponse`. +*/ +- (AnyPromise *)calculateETA NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+AnyPromise.m new file mode 100644 index 0000000..9b84be1 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+AnyPromise.m @@ -0,0 +1,22 @@ +#import "MKDirections+AnyPromise.h" + + +@implementation MKDirections (PromiseKit) + +- (AnyPromise *)calculateDirections { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self calculateDirectionsWithCompletionHandler:^(id rsp, id err){ + resolve(err ?: rsp); + }]; + }]; +} + +- (AnyPromise *)calculateETA { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self calculateETAWithCompletionHandler:^(id rsp, id err){ + resolve(err ?: rsp); + }]; + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+Promise.swift new file mode 100644 index 0000000..2230d46 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKDirections+Promise.swift @@ -0,0 +1,38 @@ +import MapKit +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `MKDirections` category: + + use_frameworks! + pod "PromiseKit/MapKit" + + And then in your sources: + + import PromiseKit +*/ +extension MKDirections { +#if swift(>=4.2) + /// Begins calculating the requested route information asynchronously. + public func calculate() -> Promise { + return Promise { calculate(completionHandler: $0.resolve) } + } + + /// Begins calculating the requested travel-time information asynchronously. + public func calculateETA() -> Promise { + return Promise { calculateETA(completionHandler: $0.resolve) } + } +#else + /// Begins calculating the requested route information asynchronously. + public func calculate() -> Promise { + return Promise { calculate(completionHandler: $0.resolve) } + } + + /// Begins calculating the requested travel-time information asynchronously. + public func calculateETA() -> Promise { + return Promise { calculateETA(completionHandler: $0.resolve) } + } +#endif +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+AnyPromise.h new file mode 100644 index 0000000..13f33e9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+AnyPromise.h @@ -0,0 +1,23 @@ +#import +#import + +/** + To import the `MKMapSnapshotter` category: + + use_frameworks! + pod "PromiseKit/MapKit" + + And then in your sources: + + @import PromiseKit; +*/ +@interface MKMapSnapshotter (PromiseKit) + +/** + Starts generating the snapshot using the options set in this object. + + @return A promise that fulfills with the generated `MKMapSnapshot` object. +*/ +- (AnyPromise *)start NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+AnyPromise.m new file mode 100644 index 0000000..c732648 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+AnyPromise.m @@ -0,0 +1,14 @@ +#import "MKMapSnapshotter+AnyPromise.h" + + +@implementation MKMapSnapshotter (PromiseKit) + +- (AnyPromise *)start { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self startWithCompletionHandler:^(MKMapSnapshot *snapshot, NSError *error) { + resolve(error ?: snapshot); + }]; + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+Promise.swift new file mode 100644 index 0000000..768cfb7 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/MKMapSnapshotter+Promise.swift @@ -0,0 +1,28 @@ +import MapKit +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `MKMapSnapshotter` category: + + use_frameworks! + pod "PromiseKit/MapKit" + + And then in your sources: + + import PromiseKit +*/ +extension MKMapSnapshotter { +#if swift(>=4.2) + /// Starts generating the snapshot using the options set in this object. + public func start() -> Promise { + return Promise { start(completionHandler: $0.resolve) } + } +#else + /// Starts generating the snapshot using the options set in this object. + public func start() -> Promise { + return Promise { start(completionHandler: $0.resolve) } + } +#endif +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/PMKMapKit.h b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/PMKMapKit.h new file mode 100644 index 0000000..d0babbb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Sources/PMKMapKit.h @@ -0,0 +1,2 @@ +#import "MKDirections+AnyPromise.h" +#import "MKMapSnapshotter+AnyPromise.h" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Tests/TestMapKit.swift b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Tests/TestMapKit.swift new file mode 100644 index 0000000..41cbdd6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MapKit/Tests/TestMapKit.swift @@ -0,0 +1,63 @@ +import PromiseKit +import PMKMapKit +import MapKit +import XCTest + +class Test_MKDirections_Swift: XCTestCase { + func test_directions_response() { + let ex = expectation(description: "") + + class MockDirections: MKDirections { + override func calculate(completionHandler: @escaping MKDirectionsHandler) { + completionHandler(MKDirectionsResponse(), nil) + } + } + + let rq = MKDirectionsRequest() + let directions = MockDirections(request: rq) + + directions.calculate().done { _ in + ex.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } + + + func test_ETA_response() { + let ex = expectation(description: "") + + class MockDirections: MKDirections { + override func calculateETA(completionHandler: @escaping MKETAHandler) { + completionHandler(MKETAResponse(), nil) + } + } + + let rq = MKDirectionsRequest() + MockDirections(request: rq).calculateETA().done { rsp in + ex.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } + +} + +class Test_MKSnapshotter_Swift: XCTestCase { + func test() { + let ex = expectation(description: "") + + class MockSnapshotter: MKMapSnapshotter { + override func start(completionHandler: @escaping MKMapSnapshotCompletionHandler) { + completionHandler(MKMapSnapshot(), nil) + } + } + + let snapshotter = MockSnapshotter() + snapshotter.start().done { _ in + ex.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/.travis.yml new file mode 100644 index 0000000..21e154d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/.travis.yml @@ -0,0 +1,34 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'PLAT=iOS SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=3.4 DST="OS=12.0,name=iPhone SE"'} + + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=8.4,name=iPhone 4s"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=9.3,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=10.3.1,name=iPhone SE"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform iOS --verbose +install: + - xcodebuild -scheme PMKMessagesUI -target PMKMessagesUI -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKMessagesUI -target PMKMFTests -quiet -destination "$DST" build; + fi +script: + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKMessagesUI -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.pbxproj new file mode 100644 index 0000000..cb047e9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.pbxproj @@ -0,0 +1,449 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 634B8E521D5D534F00D54CED /* MFMailComposeViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 634B8E501D5D534F00D54CED /* MFMailComposeViewController+Promise.swift */; }; + 634B8E531D5D534F00D54CED /* MFMessageComposeViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 634B8E511D5D534F00D54CED /* MFMessageComposeViewController+Promise.swift */; }; + 634B8E551D5D535900D54CED /* TestMessageUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 634B8E541D5D535900D54CED /* TestMessageUI.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKMessagesUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKMessagesUI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKMessagesUI; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 634B8E501D5D534F00D54CED /* MFMailComposeViewController+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MFMailComposeViewController+Promise.swift"; path = "Sources/MFMailComposeViewController+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 634B8E511D5D534F00D54CED /* MFMessageComposeViewController+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MFMessageComposeViewController+Promise.swift"; path = "Sources/MFMessageComposeViewController+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 634B8E541D5D535900D54CED /* TestMessageUI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestMessageUI.swift; path = Tests/TestMessageUI.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKMessagesUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKMessagesUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKMFTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKMFTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKMessagesUI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKMessagesUI.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKMFTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 634B8E501D5D534F00D54CED /* MFMailComposeViewController+Promise.swift */, + 634B8E511D5D534F00D54CED /* MFMessageComposeViewController+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 634B8E541D5D535900D54CED /* TestMessageUI.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKMessagesUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKMessagesUI" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKMessagesUI; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKMessagesUI.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKMFTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKMFTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKMFTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKMFTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKMessagesUI" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKMessagesUI */, + 63C7FFF11D5C020D003BAE60 /* PMKMFTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 634B8E531D5D534F00D54CED /* MFMessageComposeViewController+Promise.swift in Sources */, + 634B8E521D5D534F00D54CED /* MFMailComposeViewController+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 634B8E551D5D535900D54CED /* TestMessageUI.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKMessagesUI */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.MessagesUI; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.MessagesUI; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKMessagesUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKMessagesUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKMFTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/xcshareddata/xcschemes/PMKMessagesUI.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/xcshareddata/xcschemes/PMKMessagesUI.xcscheme new file mode 100644 index 0000000..b12a604 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/PMKMessagesUI.xcodeproj/xcshareddata/xcschemes/PMKMessagesUI.xcscheme @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/README.markdown new file mode 100644 index 0000000..ab0f9ae --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/README.markdown @@ -0,0 +1,36 @@ +# PromiseKit MessagesUI Extensions ![Build Status] + +This project adds promises to Apple’s MessagesUI framework. + +The Objective-C equivalents of this repo are in the UIKit extensions. + +## CocoaPods + +```ruby +pod "PromiseKit/MessagesUI", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/MessagesUI" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKMessagesUI +``` + +```objc +// objc +@import PromiseKit; +@import PMKMessagesUI; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/MessagesUI.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Sources/MFMailComposeViewController+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Sources/MFMailComposeViewController+Promise.swift new file mode 100644 index 0000000..dd0335c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Sources/MFMailComposeViewController+Promise.swift @@ -0,0 +1,81 @@ +import MessageUI.MFMailComposeViewController +import UIKit.UIViewController +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import this `UIViewController` category: + + use_frameworks! + pod "PromiseKit/MessageUI" + + And then in your sources: + + import PromiseKit +*/ +extension UIViewController { + /// Presents the message view controller and resolves with the user action. + public func promise(_ vc: MFMailComposeViewController, animated: Bool = true, completion:(() -> Void)? = nil) -> Promise { + let proxy = PMKMailComposeViewControllerDelegate() + proxy.retainCycle = proxy + vc.mailComposeDelegate = proxy + present(vc, animated: animated, completion: completion) + _ = proxy.promise.ensure { + self.dismiss(animated: animated, completion: nil) + } + return proxy.promise + } +} + +extension MFMailComposeViewController { + /// Errors representing PromiseKit MFMailComposeViewController failures + public enum PMKError: CancellableError, CustomStringConvertible { + /// The user cancelled sending mail + case cancelled + case failed + + /// - Returns: true + public var isCancelled: Bool { + switch self { + case .cancelled: + return true + case .failed: + return false + } + } + + public var description: String { + switch self { + case .failed: + return "The attempt to save or send the message was unsuccessful." + case .cancelled: + return "The mail was cancelled" + } + + } + } +} + +private class PMKMailComposeViewControllerDelegate: NSObject, MFMailComposeViewControllerDelegate, UINavigationControllerDelegate { + + let (promise, seal) = Promise.pending() + var retainCycle: NSObject? + + @objc func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) { + defer { retainCycle = nil } + + if let error = error { + seal.reject(error) + } else { + switch result { + case .failed: + seal.reject(MFMailComposeViewController.PMKError.failed) + case .cancelled: + seal.reject(MFMailComposeViewController.PMKError.cancelled) + default: + seal.fulfill(result) + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Sources/MFMessageComposeViewController+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Sources/MFMessageComposeViewController+Promise.swift new file mode 100644 index 0000000..c4c2475 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Sources/MFMessageComposeViewController+Promise.swift @@ -0,0 +1,78 @@ +import Foundation +import MessageUI.MFMessageComposeViewController +import UIKit.UIViewController +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import this `UIViewController` category: + + use_frameworks! + pod "PromiseKit/MessageUI" + + And then in your sources: + + import PromiseKit +*/ +extension UIViewController { + /// Presents the message view controller and resolves with the user action. + public func promise(_ vc: MFMessageComposeViewController, animated: Bool = true, completion:(() -> Void)? = nil) -> Promise { + let proxy = PMKMessageComposeViewControllerDelegate() + proxy.retainCycle = proxy + vc.messageComposeDelegate = proxy + present(vc, animated: animated, completion: completion) + _ = proxy.promise.ensure { + vc.dismiss(animated: animated, completion: nil) + } + return proxy.promise + } +} + +extension MFMessageComposeViewController { + /// Errors representing PromiseKit MFMailComposeViewController failures + public enum PMKError: CancellableError, CustomStringConvertible { + /// The user cancelled sending the message + case cancelled + case failed + + /// - Returns: true + public var isCancelled: Bool { + switch self { + case .cancelled: + return true + case .failed: + return false + } + } + + public var description: String { + switch self { + case .failed: + return "The attempt to save or send the message was unsuccessful." + case .cancelled: + return "The message was cancelled" + } + + } + } +} + +private class PMKMessageComposeViewControllerDelegate: NSObject, MFMessageComposeViewControllerDelegate, UINavigationControllerDelegate { + + let (promise, seal) = Promise.pending() + var retainCycle: NSObject? + + @objc func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) { + defer { retainCycle = nil } + + switch result { + case .sent: + seal.fulfill(()) + case .failed: + seal.reject(MFMessageComposeViewController.PMKError.failed) + case .cancelled: + seal.reject(MFMessageComposeViewController.PMKError.cancelled) + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Tests/TestMessageUI.swift b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Tests/TestMessageUI.swift new file mode 100644 index 0000000..082c95a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/MessagesUI/Tests/TestMessageUI.swift @@ -0,0 +1,69 @@ +import PMKMessagesUI +import PromiseKit +import MessageUI +import XCTest +import UIKit + + +class MessageUITests: XCTestCase { + var rootvc: UIViewController! + + func test_can_cancel_mail_composer() { + let ex1 = expectation(description: "") + let ex2 = expectation(description: "") + var order = false + + let mailer = MFMailComposeViewController() + mailer.setToRecipients(["mxcl@me.com"]) + + let promise = rootvc.promise(mailer, animated: false, completion: { + after(seconds: 0.25).done { _ in + XCTAssertFalse(order) + let button = mailer.viewControllers[0].navigationItem.leftBarButtonItem! + UIControl().sendAction(button.action!, to: button.target, for: nil) + ex1.fulfill() + } + }) + promise.catch { _ -> Void in + XCTFail() + } + promise.catch(policy: .allErrors) { _ -> Void in + // seems necessary to give vc stack a bit of time + after(seconds: 0.5).done(ex2.fulfill) + order = true + } + waitForExpectations(timeout: 10, handler: nil) + + XCTAssertNil(rootvc.presentedViewController) + } + + func test_can_cancel_message_composer() { + let ex1 = expectation(description: "") + let ex2 = expectation(description: "") + var order = false + + let messager = MFMessageComposeViewController() + + let promise = rootvc.promise(messager, animated: false, completion: { + after(seconds: 0.25).done { _ in + XCTAssertFalse(order) + + let button = messager.viewControllers[0].navigationItem.leftBarButtonItem! + UIControl().sendAction(button.action!, to: button.target, for: nil) + ex1.fulfill() + } + }) + + promise.catch { _ -> Void in + XCTFail() + } + promise.catch(policy: .allErrors) { _ -> Void in + // seems necessary to give vc stack a bit of time + after(seconds: 0.5).done(ex2.fulfill) + order = true + } + waitForExpectations(timeout: 10, handler: nil) + + XCTAssertNil(rootvc.presentedViewController) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/.travis.yml new file mode 100644 index 0000000..6337a05 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/.travis.yml @@ -0,0 +1,42 @@ +language: objective-c +os: osx +matrix: + include: + # - {osx_image: xcode8.3, env: 'PLAT=macOS SWFT=3.1 DST="arch=x86_64"'} + # - {osx_image: xcode8.3, env: 'PLAT=iOS SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + # - {osx_image: xcode8.3, env: 'PLAT=tvOS SWFT=3.1 DST="OS=10.2,name=Apple TV 1080p"'} + # - {osx_image: xcode8.3, env: 'PLAT=watchOS SWFT=3.1 DST="OS=3.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.2, env: 'PLAT=macOS SWFT=3.2 DST="arch=x86_64"'} + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=tvOS SWFT=3.2 DST="OS=11.2,name=Apple TV"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=3.2 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.4, env: 'PLAT=macOS SWFT=3.3 DST="arch=x86_64"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=3.3 DST="OS=11.4,name=Apple TV"'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=3.3 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.2, env: 'PLAT=macOS SWFT=4.0 DST="arch=x86_64"'} + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=tvOS SWFT=4.0 DST="OS=11.2,name=Apple TV"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=4.0 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.4, env: 'PLAT=macOS SWFT=4.1 DST="arch=x86_64" TEST=1'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=4.1 DST="OS=11.4,name=Apple TV" TEST=1'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=4.1 DST="OS=4.3,name=Apple Watch - 38mm"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKOMGHTTPURLRQ -target PMKOMGHTTPURLRQ -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKOMGHTTPURLRQ -target PMKOMGTests -quiet -destination "$DST" build; + fi +script: + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKOMGHTTPURLRQ -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile new file mode 100644 index 0000000..62674f6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile @@ -0,0 +1,3 @@ +github "mxcl/PromiseKit" ~> 6.3 +github "mxcl/OMGHTTPURLRQ" ~> 3.2 +github "PromiseKit/Foundation" ~> 3.1 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile.private b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile.private new file mode 100644 index 0000000..13f8280 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile.private @@ -0,0 +1 @@ +github "AliSoftware/OHHTTPStubs" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile.resolved new file mode 100644 index 0000000..ebbdb14 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Cartfile.resolved @@ -0,0 +1,4 @@ +github "AliSoftware/OHHTTPStubs" "6.1.0" +github "PromiseKit/Foundation" "3.1.0" +github "mxcl/OMGHTTPURLRQ" "3.2.5" +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c619061 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.pbxproj @@ -0,0 +1,466 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6331B3FC1D657CB700544154 /* PMKOMGHTTPURLRQ.h in Headers */ = {isa = PBXBuildFile; fileRef = 6331B3F91D657CB700544154 /* PMKOMGHTTPURLRQ.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6331B3FF1D657DA400544154 /* NSURLSession+OMG+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 6331B3FD1D657DA400544154 /* NSURLSession+OMG+AnyPromise.m */; }; + 6331B4001D657DA400544154 /* NSURLSession+OMG+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6331B3FE1D657DA400544154 /* NSURLSession+OMG+Promise.swift */; }; + 6342D1B51D68E7BB005D7062 /* TestNSURLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 6331B4011D657DDB00544154 /* TestNSURLSession.m */; }; + 63C700081D5C021F003BAE60 /* TestNSURLSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C700021D5C021F003BAE60 /* TestNSURLSession.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKOMGHTTPURLRQ.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKOMGHTTPURLRQ.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKFoundation; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6331B3F91D657CB700544154 /* PMKOMGHTTPURLRQ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKOMGHTTPURLRQ.h; path = Sources/PMKOMGHTTPURLRQ.h; sourceTree = SOURCE_ROOT; }; + 6331B3FD1D657DA400544154 /* NSURLSession+OMG+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSURLSession+OMG+AnyPromise.m"; path = "Sources/NSURLSession+OMG+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 6331B3FE1D657DA400544154 /* NSURLSession+OMG+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSURLSession+OMG+Promise.swift"; path = "Sources/NSURLSession+OMG+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 6331B4011D657DDB00544154 /* TestNSURLSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestNSURLSession.m; path = Tests/TestNSURLSession.m; sourceTree = SOURCE_ROOT; }; + 63C700021D5C021F003BAE60 /* TestNSURLSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestNSURLSession.swift; path = Tests/TestNSURLSession.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKOMGHTTPURLRQ.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKOMGHTTPURLRQ.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKOMGTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKOMGTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8131D5C0C4E00503216 /* Cartfile.private */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile.private; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKOMGHTTPURLRQ.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8131D5C0C4E00503216 /* Cartfile.private */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKOMGHTTPURLRQ.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKOMGTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 6331B3F91D657CB700544154 /* PMKOMGHTTPURLRQ.h */, + 6331B3FD1D657DA400544154 /* NSURLSession+OMG+AnyPromise.m */, + 6331B3FE1D657DA400544154 /* NSURLSession+OMG+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63C700021D5C021F003BAE60 /* TestNSURLSession.swift */, + 6331B4011D657DDB00544154 /* TestNSURLSession.m */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6331B3FC1D657CB700544154 /* PMKOMGHTTPURLRQ.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKOMGHTTPURLRQ */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKOMGHTTPURLRQ" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKOMGHTTPURLRQ; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKOMGHTTPURLRQ.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKOMGTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKOMGTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKOMGTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKOMGTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKOMGHTTPURLRQ" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKOMGHTTPURLRQ */, + 63C7FFF11D5C020D003BAE60 /* PMKOMGTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + OMGHTTPURLRQ, + OHHTTPStubs, + PMKFoundation, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6331B3FF1D657DA400544154 /* NSURLSession+OMG+AnyPromise.m in Sources */, + 6331B4001D657DA400544154 /* NSURLSession+OMG+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C700081D5C021F003BAE60 /* TestNSURLSession.swift in Sources */, + 6342D1B51D68E7BB005D7062 /* TestNSURLSession.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKOMGHTTPURLRQ */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.OMGHTTPURLRQ; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.OMGHTTPURLRQ; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKOMGHTTPURLRQ" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKOMGHTTPURLRQ" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKOMGTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/xcshareddata/xcschemes/PMKOMGHTTPURLRQ.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/xcshareddata/xcschemes/PMKOMGHTTPURLRQ.xcscheme new file mode 100644 index 0000000..687cbb2 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/PMKOMGHTTPURLRQ.xcodeproj/xcshareddata/xcschemes/PMKOMGHTTPURLRQ.xcscheme @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/README.markdown new file mode 100644 index 0000000..078e121 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/README.markdown @@ -0,0 +1,65 @@ +# DEPRECATED + +Use PMKFoundation or PMKAlamofire, the promises provided by this repository are minimal +and add little value over just using OMG by itself and passing its URLRequests to +URLSession manually. + +# PromiseKit OMGHTTPURLRQ Extensions ![Build Status] + +This project provides convenience methods on NSURLSession using [OMGHTTPURLRQ]. + +## Usage + +```swift +URLSession.shared.POST(url, formData: params).then { data -> Void in + // by default you just get the raw `Data` +} + +URLSession.shared.GET(url).asDictionary().then { json -> Void in + // call `asDictionary()` to have the result decoded + // as JSON with the result being an `NSDictionary` + // the promise is rejected if the JSON can not be + // decoded or the resulting object is not a dictionary +} + +URLSession.shared.PUT(url, json: params).asArray().then { json -> Void in + // json: NSArray +} + +URLSession.shared.DELETE(url).asString().then { string -> Void in + // string: String +} +``` + +## CocoaPods + +```ruby +pod "PromiseKit/OMGHTTPURLRQ", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/OMGHTTPURLRQ-" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import OMGHTTPURLRQ +import PMKOMGHTTPURLRQ +``` + +```objc +// objc +@import PromiseKit; +@import OMGHTTPURLRQ; +@import PMKOMGHTTPURLRQ; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/OMGHTTPURLRQ.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/NSURLSession+OMG+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/NSURLSession+OMG+AnyPromise.m new file mode 100644 index 0000000..967354c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/NSURLSession+OMG+AnyPromise.m @@ -0,0 +1,100 @@ +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import "PMKOMGHTTPURLRQ.h" + +#if !COCOAPODS +#import +#else +#import "NSURLSession+AnyPromise.h" +#endif + +static id PMKURLRequestFromURLFormat(NSError **err, id urlFormat, ...); +static id go(NSURLSession *, NSMutableURLRequest *); + + +@implementation NSURLSession (PMKOMG) + +- (AnyPromise *)GET:(id)urlFormat, ... { + id err; + id rq = PMKURLRequestFromURLFormat(&err, urlFormat); + if (err) return [AnyPromise promiseWithValue:err]; + return go(self, rq); +} + +- (AnyPromise *)GET:(NSString *)url query:(NSDictionary *)params { + id err; + id rq = [OMGHTTPURLRQ GET:url:params error:&err]; + if (err) return [AnyPromise promiseWithValue:err]; + return go(self, rq); +} + +- (AnyPromise *)POST:(NSString *)url formURLEncodedParameters:(NSDictionary *)params { + id err; + id rq = [OMGHTTPURLRQ POST:url:params error:&err]; + if (err) return [AnyPromise promiseWithValue:err]; + return go(self, rq); +} + +- (AnyPromise *)POST:(NSString *)urlString JSON:(NSDictionary *)params { + id err; + id rq = [OMGHTTPURLRQ POST:urlString JSON:params error:&err]; + if (err) return [AnyPromise promiseWithValue:err]; + return go(self, rq); +} + +- (AnyPromise *)PUT:(NSString *)url formURLEncodedParameters:(NSDictionary *)params { + id err; + id rq = [OMGHTTPURLRQ PUT:url:params error:&err]; + if (err) return [AnyPromise promiseWithValue:err]; + return go(self, rq); + +} + +- (AnyPromise *)DELETE:(NSString *)url formURLEncodedParameters:(NSDictionary *)params { + id err; + id rq = [OMGHTTPURLRQ DELETE:url :params error:&err]; + if (err) return [AnyPromise promiseWithValue:err]; + return go(self, rq); +} + +- (AnyPromise *)PATCH:(NSString *)url JSON:(NSDictionary *)params { + id err; + id rq = [OMGHTTPURLRQ PATCH:url JSON:params error:&err]; + if (err) return [AnyPromise promiseWithValue:err]; + return go(self, rq); +} + +@end + + +static id PMKURLRequestFromURLFormat(NSError **err, id urlFormat, ...) { + if ([urlFormat isKindOfClass:[NSString class]]) { + va_list arguments; + va_start(arguments, urlFormat); + urlFormat = [[NSString alloc] initWithFormat:urlFormat arguments:arguments]; + va_end(arguments); + } else if ([urlFormat isKindOfClass:[NSURL class]]) { + NSMutableURLRequest *rq = [[NSMutableURLRequest alloc] initWithURL:urlFormat]; + [rq setValue:OMGUserAgent() forHTTPHeaderField:@"User-Agent"]; + return rq; + } else { + urlFormat = [urlFormat description]; + } + return [OMGHTTPURLRQ GET:urlFormat:nil error:err]; +} + +static id go(NSURLSession *session, NSMutableURLRequest *rq) { + if ([rq valueForHTTPHeaderField:@"User-Agent"] == nil) { + [rq setValue:OMGUserAgent() forHTTPHeaderField:@"User-Agent"]; + } + return [session promiseDataTaskWithRequest:rq]; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/NSURLSession+OMG+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/NSURLSession+OMG+Promise.swift new file mode 100644 index 0000000..eca8512 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/NSURLSession+OMG+Promise.swift @@ -0,0 +1,170 @@ +import OMGHTTPURLRQ +import Foundation +#if !PMKCocoaPods +import PMKFoundation +import PromiseKit +#endif + +/** + To import the `OMGHTTPURLRQ` category: + + use_frameworks! + pod "PromiseKit/OMGHTTPURLRQ" + + And then in your sources: + + import PromiseKit + + We provide convenience categories for the `URLSession.shared`, or + an instance method `promise`. If you need more complicated behavior + we recommend wrapping that usage in a `Promise` initializer. +*/ +extension URLSession { + /** + Makes a **GET** request to the provided URL. + + let p = URLSession.shared.GET("http://example.com", query: ["foo": "bar"]) + p.then { data -> Void in + //… + } + p.asImage().then { image -> Void in + //… + } + p.asDictionary().then { json -> Void in + //… + } + + - Parameter url: The URL to request. + - Parameter query: The parameters to be encoded as the query string for the GET request. + - Returns: A promise that represents the GET request. + */ + public func GET(_ url: String, query: [String: Any]? = nil) -> Promise<(data: Data, response: URLResponse)> { + return start(try OMGHTTPURLRQ.get(url, query) as URLRequest) + } + + /** + Makes a POST request to the provided URL passing form URL encoded + parameters. + + Form URL-encoding is the standard way to POST on the Internet, so + probably this is what you want. If it doesn’t work, try the `+POST:JSON` + variant. + + let url = "http://jsonplaceholder.typicode.com/posts" + let params = ["title": "foo", "body": "bar", "userId": 1] + URLSession.shared.POST(url, formData: params).asDictionary().then { json -> Void in + //… + } + + - Parameter url: The URL to request. + - Parameter formData: The parameters to be form URL-encoded and passed as the POST body. + - Returns: A promise that represents the POST request. + */ + public func POST(_ url: String, formData: [String: Any]? = nil) -> Promise<(data: Data, response: URLResponse)> { + return start(try OMGHTTPURLRQ.post(url, formData) as URLRequest) + } + + /** + Makes a POST request to the provided URL passing multipart form-data. + + let formData = OMGMultipartFormData() + let imgData = Data(contentsOfFile: "image.png") + formData.addFile(imgdata, parameterName: "file1", filename: "myimage1.png", contentType: "image/png") + + URLSession.shared.POST(url, multipartFormData: formData).then { data in + //… + } + + - Parameter url: The URL to request. + - Parameter multipartFormData: The parameters to be multipart form-data encoded and passed as the POST body. + - Returns: A promise that represents the POST request. + - SeeAlso: [https://github.com/mxcl/OMGHTTPURLRQ](OMGHTTPURLRQ) + */ + public func POST(_ url: String, multipartFormData: OMGMultipartFormData) -> Promise<(data: Data, response: URLResponse)> { + return start(try OMGHTTPURLRQ.post(url, multipartFormData) as URLRequest) + } + + /** + Makes a POST request to the provided URL passing JSON encoded + parameters. + + Most web servers nowadays support POST with either JSON or form + URL-encoding. If in doubt try form URL-encoded parameters first. + + let url = "http://jsonplaceholder.typicode.com/posts" + let params = ["title": "foo", "body": "bar", "userId": 1] + URLSession.shared.POST(url, json: params).asDictionary().then { json -> Void in + //… + } + + - Parameter url: The URL to request. + - Parameter json: The parameters to be JSON-encoded and passed as the POST body. + - Returns: A promise that represents the POST request. + */ + public func POST(_ url: String, json: [String: Any]? = nil) -> Promise<(data: Data, response: URLResponse)> { + return start(try OMGHTTPURLRQ.post(url, json: json) as URLRequest) + } + + /** + Makes a PUT request to the provided URL passing JSON encoded parameters. + + let url = "http://jsonplaceholder.typicode.com/posts" + let params = ["title": "foo", "body": "bar", "userId": 1] + URLSession.shared.PUT(url, json: params).asDictionary().then { json -> Void in + //… + } + + - Parameter url: The URL to request. + - Parameter json: The parameters to be JSON-encoded and passed as the PUT body. + - Returns: A promise that represents the PUT request. + */ + public func PUT(_ url: String, json: [String: Any]? = nil) -> Promise<(data: Data, response: URLResponse)> { + return start(try OMGHTTPURLRQ.put(url, json: json) as URLRequest) + } + + /** + Makes a DELETE request to the provided URL passing form URL-encoded + parameters. + + let url = "http://jsonplaceholder.typicode.com/posts/1" + URLSession.shared.DELETE(url).then.asDictionary() { json -> Void in + //… + } + + - Parameter url: The URL to request. + - Returns: A promise that represents the PUT request. + */ + public func DELETE(_ url: String) -> Promise<(data: Data, response: URLResponse)> { + return start(try OMGHTTPURLRQ.delete(url, nil) as URLRequest) + } + + /** + Makes a PATCH request to the provided URL passing the provided JSON parameters. + + let url = "http://jsonplaceholder.typicode.com/posts/1" + let params = ["foo": "bar"] + NSURLConnection.PATCH(url, json: params).asDictionary().then { json -> Void in + //… + } + - Parameter url: The URL to request. + - Parameter json: The JSON parameters to encode as the PATCH body. + - Returns: A promise that represents the PUT request. + */ + public func PATCH(_ url: String, json: [String: Any]? = nil) -> Promise<(data: Data, response: URLResponse)> { + return start(try OMGHTTPURLRQ.patch(url, json: json) as URLRequest) + } + + private func start(_ body: @autoclosure () throws -> URLRequest) -> Promise<(data: Data, response: URLResponse)> { + do { + var request = try body() + + if request.value(forHTTPHeaderField: "User-Agent") == nil { + request.setValue(OMGUserAgent(), forHTTPHeaderField: "User-Agent") + } + + return dataTask(.promise, with: request) + } catch { + return Promise(error: error) + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/PMKOMGHTTPURLRQ.h b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/PMKOMGHTTPURLRQ.h new file mode 100644 index 0000000..3c29f2d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Sources/PMKOMGHTTPURLRQ.h @@ -0,0 +1,200 @@ +#import +#import + +/** + To import the `NSURLSession` category: + + use_frameworks! + pod "PromiseKit/Foundation" + + Or `NSURLSession` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + #import + + PromiseKit automatically deserializes the raw HTTP data response into the + appropriate rich data type based on the mime type the server provides. + Thus if the response is JSON you will get the deserialized JSON response. + PromiseKit supports decoding into strings, JSON and UIImages. + + However if your server does not provide a rich content-type, you will + just get `NSData`. This is rare, but a good example we came across was + downloading files from Dropbox. + + PromiseKit goes to quite some lengths to provide good `NSError` objects + for error conditions at all stages of the HTTP to rich-data type + pipeline. We provide the following additional `userInfo` keys as + appropriate: + + - `PMKURLErrorFailingDataKey` + - `PMKURLErrorFailingStringKey` + - `PMKURLErrorFailingURLResponseKey` + + PromiseKit uses [OMGHTTPURLRQ](https://github.com/mxcl/OMGHTTPURLRQ) to + make its HTTP requests. PromiseKit only provides a convenience layer + above OMGHTTPURLRQ, thus if you need more power (eg. a multipartFormData + POST), use OMGHTTPURLRQ to generate the `NSURLRequest` and then pass + that request to `+promise:`. + + @see https://github.com/mxcl/OMGHTTPURLRQ + */ +@interface NSURLSession (PMKOMG) + +/** + Makes a GET request to the provided URL. + + [NSURLSession GET:@"http://placekitten.com/320/320"].then(^(UIImage *img){ + // PromiseKit decodes the image (if it’s an image) + }); + + @param urlStringFormatOrURL The `NSURL` or string format to request. + + @return A promise that fulfills with three parameters: + + 1) The deserialized data response. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + */ +- (AnyPromise *)GET:(id)urlStringFormatOrURL, ... NS_REFINED_FOR_SWIFT; + +/** + Makes a GET request with the provided query parameters. + + id url = @"http://jsonplaceholder.typicode.com/comments"; + id params = @{@"postId": @1}; + [NSURLSession GET:url query:params].then(^(NSDictionary *jsonResponse){ + // PromiseKit decodes the JSON dictionary (if it’s JSON) + }); + + @param urlString The `NSURL` or URL string format to request. + + @param parameters The parameters to be encoded as the query string for the GET request. + + @return A promise that fulfills with three parameters: + + 1) The deserialized data response. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + */ +- (AnyPromise *)GET:(NSString *)urlString query:(NSDictionary *)parameters NS_REFINED_FOR_SWIFT; + +/** + Makes a POST request to the provided URL passing form URL encoded + parameters. + + Form URL-encoding is the standard way to POST on the Internet, so + probably this is what you want. If it doesn’t work, try the `+POST:JSON` + variant. + + id url = @"http://jsonplaceholder.typicode.com/posts"; + id params = @{@"title": @"foo", @"body": @"bar", @"userId": @1}; + [NSURLSession POST:url formURLEncodedParameters:params].then(^(NSDictionary *jsonResponse){ + // PromiseKit decodes the JSON dictionary (if it’s JSON) + }); + + @param urlString The URL to request. + + @param parameters The parameters to be form URL-encoded and passed as the POST body. + + @return A promise that fulfills with three parameters: + + 1) The deserialized data response. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + */ +- (AnyPromise *)POST:(NSString *)urlString formURLEncodedParameters:(NSDictionary *)parameters NS_REFINED_FOR_SWIFT; + +/** + Makes a POST request to the provided URL passing JSON encoded parameters. + + Most web servers nowadays support POST with either JSON or form + URL-encoding. If in doubt try form URL-encoded parameters first. + + id url = @"http://jsonplaceholder.typicode.com/posts"; + id params = @{@"title": @"foo", @"body": @"bar", @"userId": @1}; + [NSURLSession POST:url JSON:params].then(^(NSDictionary *jsonResponse){ + // PromiseKit decodes the JSON dictionary (if it’s JSON) + }); + + @param urlString The URL to request. + + @param JSONParameters The parameters to be JSON encoded and passed as the POST body. + + @return A promise that fulfills with three parameters: + + 1) The deserialized data response. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + */ +- (AnyPromise *)POST:(NSString *)urlString JSON:(NSDictionary *)JSONParameters NS_REFINED_FOR_SWIFT; + +/** + Makes a PUT request to the provided URL passing form URL-encoded + parameters. + + id url = @"http://jsonplaceholder.typicode.com/posts/1"; + id params = @{@"id": @1, @"title": @"foo", @"body": @"bar", @"userId": @1}; + [NSURLSession PUT:url formURLEncodedParameters:params].then(^(NSDictionary *jsonResponse){ + // PromiseKit decodes the JSON dictionary (if it’s JSON) + }); + + @param urlString The URL to request. + + @param parameters The parameters to be form URL-encoded and passed as the HTTP body. + + @return A promise that fulfills with three parameters: + + 1) The deserialized data response. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + */ +- (AnyPromise *)PUT:(NSString *)urlString formURLEncodedParameters:(NSDictionary *)parameters NS_REFINED_FOR_SWIFT; + +/** + Makes a DELETE request to the provided URL passing form URL-encoded + parameters. + + id url = @"http://jsonplaceholder.typicode.com/posts/1"; + id params = nil; + [NSURLSession DELETE:url formURLEncodedParameters:params].then(^(NSDictionary *jsonResponse){ + // PromiseKit decodes the JSON dictionary (if it’s JSON) + }); + + @param urlString The URL to request. + + @param parameters The parameters to be form URL-encoded and passed as the HTTP body. + + @return A promise that fulfills with three parameters: + + 1) The deserialized data response. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + */ +- (AnyPromise *)DELETE:(NSString *)urlString formURLEncodedParameters:(NSDictionary *)parameters NS_REFINED_FOR_SWIFT; + +/** + Makes a PATCH request to the provided URL passing the provided JSON parameters. + + id url = @"http://jsonplaceholder.typicode.com/posts/1"; + id params = nil; + [NSURLSession PATCH:url JSON:params].then(^(NSDictionary *jsonResponse){ + // PromiseKit decodes the JSON dictionary (if it’s JSON) + }); + + @param urlString The URL to request. + + @param JSONParameters The JSON parameters. + + @return A promise that fulfills with three parameters: + + 1) The deserialized data response. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + */ +- (AnyPromise *)PATCH:(NSString *)urlString JSON:(NSDictionary *)JSONParameters NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Tests/TestNSURLSession.m b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Tests/TestNSURLSession.m new file mode 100644 index 0000000..d8c6d0d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Tests/TestNSURLSession.m @@ -0,0 +1,48 @@ +@import PMKOMGHTTPURLRQ; +@import PMKFoundation; +@import OHHTTPStubs; +@import PromiseKit; +@import XCTest; + + +@implementation NSURLSessionTests: XCTestCase + +- (void)tearDown { + [OHHTTPStubs removeAllStubs]; +} + +- (void)test1 { + id stubData = [NSData dataWithBytes:"[a: 3]" length:1]; + + [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest *rq){ + return [rq.URL.host isEqualToString:@"example.com"]; + } withStubResponse:^(NSURLRequest *request){ + return [OHHTTPStubsResponse responseWithData:stubData statusCode:200 headers:@{@"Content-Type": @"application/json"}]; + }]; + + id ex = [self expectationWithDescription:@""]; + + [[NSURLSession sharedSession] GET:[NSURL URLWithString:@"http://example.com"]].catch(^(NSError *err){ + XCTAssertEqualObjects(err.domain, NSCocoaErrorDomain); //TODO this is why we should replace this domain + XCTAssertEqual(err.code, 3840); + XCTAssertEqualObjects(err.userInfo[PMKURLErrorFailingDataKey], stubData); + XCTAssertNotNil(err.userInfo[PMKURLErrorFailingURLResponseKey]); + [ex fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test2 { + id ex = [self expectationWithDescription:@""]; + + [[NSURLSession sharedSession] GET:nil].catch(^(NSError *err){ + XCTAssertEqualObjects(err.domain, NSURLErrorDomain); + XCTAssertEqual(err.code, NSURLErrorUnsupportedURL); + [ex fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Tests/TestNSURLSession.swift b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Tests/TestNSURLSession.swift new file mode 100644 index 0000000..8e3d77e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/OMGHTTPURLRQ/Tests/TestNSURLSession.swift @@ -0,0 +1,74 @@ +import PMKOMGHTTPURLRQ +import OHHTTPStubs +import PromiseKit +import XCTest + +class NSURLSessionTests: XCTestCase { + func test1() { + let json: NSDictionary = ["key1": "value1", "key2": ["value2A", "value2B"]] + + OHHTTPStubs.stubRequests(passingTest: { $0.url!.host == "example.com" }) { _ in + return OHHTTPStubsResponse(jsonObject: json, statusCode: 200, headers: nil) + } + + let ex = expectation(description: "") + URLSession.shared.GET("http://example.com").compactMap { + try JSONSerialization.jsonObject(with: $0.data) + }.done { + XCTAssertEqual(json, $0 as? NSDictionary) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func test2() { + + // test that Promise chains thens + // this test because I don’t trust the Swift compiler + + let dummy = ("fred" as NSString).data(using: String.Encoding.utf8.rawValue)! + + OHHTTPStubs.stubRequests(passingTest: { $0.url!.host == "example.com" }) { _ in + return OHHTTPStubsResponse(data: dummy, statusCode: 200, headers: [:]) + } + + let ex = expectation(description: "") + + after(seconds: 0.1).then { + URLSession.shared.GET("http://example.com") + }.done { + XCTAssertEqual($0.data, dummy) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + + func testSyntax() { + let json: NSDictionary = ["key1": "value1", "key2": ["value2A", "value2B"]] + + OHHTTPStubs.stubRequests(passingTest: { + $0.url!.host == "example.com" + }, withStubResponse: { _ in + OHHTTPStubsResponse(jsonObject: json, statusCode: 200, headers: nil) + }) + + let p = URLSession.shared.GET("http://example.com", query: [ + "1": 1, + "2": 2 + ]) + + let ex = expectation(description: "") + p.compactMap { + try JSONSerialization.jsonObject(with: $0.data) + }.done { + XCTAssertEqual(json, $0 as? NSDictionary) + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + override func tearDown() { + OHHTTPStubs.removeAllStubs() + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/Photos/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/Photos/.travis.yml new file mode 100644 index 0000000..d7b4187 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/.travis.yml @@ -0,0 +1,39 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'PLAT=iOS SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + - {osx_image: xcode8.3, env: 'PLAT=tvOS SWFT=3.1 DST="OS=10.2,name=Apple TV 1080p"'} + + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=tvOS SWFT=3.2 DST="OS=11.2,name=Apple TV"'} + + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=3.3 DST="OS=11.4,name=Apple TV"'} + + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=3.4 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode10, env: 'PLAT=tvOS SWFT=3.4 DST="OS=12.0,name=Apple TV"'} + + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=tvOS SWFT=4.0 DST="OS=11.2,name=Apple TV"'} + + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=4.1 DST="OS=11.4,name=Apple TV" TEST=1'} + + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode10, env: 'PLAT=tvOS SWFT=4.2 DST="OS=12.0,name=Apple TV"'} + +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKPhotos -target PMKPhotos -quiet -destination "$DST" build SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKPhotos -target PMKPHTests -quiet -destination "$DST" build; + fi +script: + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKPhotos -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7115171 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.pbxproj @@ -0,0 +1,447 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 63859F4C1D5D4D5F0021C52A /* PHPhotoLibrary+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63859F4B1D5D4D5F0021C52A /* PHPhotoLibrary+Promise.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKPhotos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKPhotos.framework */; }; + 63EE66491D5F8915002F86B0 /* PHPhototLibraryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63EE66481D5F8915002F86B0 /* PHPhototLibraryTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKPhotos; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 63859F4B1D5D4D5F0021C52A /* PHPhotoLibrary+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "PHPhotoLibrary+Promise.swift"; path = "Sources/PHPhotoLibrary+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKPhotos.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKPhotos.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKPHTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKPHTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63EE66481D5F8915002F86B0 /* PHPhototLibraryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PHPhototLibraryTests.swift; path = Tests/PHPhototLibraryTests.swift; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKPhotos.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKPhotos.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKPHTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 63859F4B1D5D4D5F0021C52A /* PHPhotoLibrary+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63EE66481D5F8915002F86B0 /* PHPhototLibraryTests.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKPhotos */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKPhotos" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKPhotos; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKPhotos.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKPHTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKPHTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKPHTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKPHTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKPhotos" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKPhotos */, + 63C7FFF11D5C020D003BAE60 /* PMKPHTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63859F4C1D5D4D5F0021C52A /* PHPhotoLibrary+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63EE66491D5F8915002F86B0 /* PHPhototLibraryTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKPhotos */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 10.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 10.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Photos; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Photos; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKPhotos" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKPhotos" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKPHTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/xcshareddata/xcschemes/PMKPhotos.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/xcshareddata/xcschemes/PMKPhotos.xcscheme new file mode 100644 index 0000000..a769b31 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/PMKPhotos.xcodeproj/xcshareddata/xcschemes/PMKPhotos.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/Photos/README.markdown new file mode 100644 index 0000000..a6bad75 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit Photos Extensions ![Build Status] + +This project adds promises to Apple’s Photos framework. + +## CocoaPods + +```ruby +pod "PromiseKit/Photos", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/Photos" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKPhotos +``` + +```objc +// objc +@import PromiseKit; +@import PMKPhotos; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/Photos.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/Sources/PHPhotoLibrary+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Sources/PHPhotoLibrary+Promise.swift new file mode 100644 index 0000000..993762f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Sources/PHPhotoLibrary+Promise.swift @@ -0,0 +1,24 @@ +import Photos.PHPhotoLibrary +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `PHPhotoLibrary` category: + + use_frameworks! + pod "PromiseKit/Photos" + + And then in your sources: + + import PromiseKit +*/ +extension PHPhotoLibrary { + /** + - Returns: A promise that fulfills with the user’s authorization + - Note: This promise cannot reject. + */ + public class func requestAuthorization() -> Guarantee { + return Guarantee(resolver: PHPhotoLibrary.requestAuthorization) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Photos/Tests/PHPhototLibraryTests.swift b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Tests/PHPhototLibraryTests.swift new file mode 100644 index 0000000..d0c1fec --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Photos/Tests/PHPhototLibraryTests.swift @@ -0,0 +1,12 @@ +import PromiseKit +import PMKPhotos +import Photos +import XCTest + +class PHTestCase: XCTestCase { + func test() { + let ex = expectation(description: "") + PHPhotoLibrary.requestAuthorization().done{ _ in ex.fulfill() } + waitForExpectations(timeout: 10) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/.travis.yml new file mode 100644 index 0000000..35ceeb9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/.travis.yml @@ -0,0 +1,16 @@ +os: osx +language: objective-c +osx_image: xcode9.4 +env: + - PLAT=iOS DST="OS=11.4,name=iPhone 5s" + - PLAT=tvOS DST="OS=11.4,name=Apple TV" + - PLAT=macOS DST="arch=x86_64" +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKQuartzCore -quiet -destination "$DST" build +script: + - xcodebuild -scheme PMKQuartzCore -quiet -destination "$DST" test diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQCTests/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQCTests/Info.plist new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQCTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQCTests/PMKQCTests.swift b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQCTests/PMKQCTests.swift new file mode 100644 index 0000000..47b21e9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQCTests/PMKQCTests.swift @@ -0,0 +1,35 @@ +// +// PMKQCTests.swift +// PMKQCTests +// +// Created by Max Howell on 8/13/16. +// Copyright © 2016 Max Howell. All rights reserved. +// + +import XCTest + +class PMKQCTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3ff65a3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.pbxproj @@ -0,0 +1,455 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 637B4A741D5D5FC600E1BC6C /* PMKQuartzCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 637B4A731D5D5FC600E1BC6C /* PMKQuartzCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 639E8D041D5D651300D210E4 /* CALayer+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 639E8D021D5D651300D210E4 /* CALayer+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 639E8D051D5D651300D210E4 /* CALayer+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 639E8D031D5D651300D210E4 /* CALayer+AnyPromise.m */; }; + 63D9E6791D6013E7006B2661 /* PMKQCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D9E6781D6013E7006B2661 /* PMKQCTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 637B4A731D5D5FC600E1BC6C /* PMKQuartzCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKQuartzCore.h; path = Sources/PMKQuartzCore.h; sourceTree = SOURCE_ROOT; }; + 639E8D021D5D651300D210E4 /* CALayer+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CALayer+AnyPromise.h"; path = "Sources/CALayer+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 639E8D031D5D651300D210E4 /* CALayer+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CALayer+AnyPromise.m"; path = "Sources/CALayer+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 639E8D061D5D651D00D210E4 /* TestQuartzCore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestQuartzCore.m; path = Tests/TestQuartzCore.m; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKQuartzCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKQuartzCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + 63D9E6761D6013E7006B2661 /* PMKQCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKQCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63D9E6781D6013E7006B2661 /* PMKQCTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PMKQCTests.swift; sourceTree = ""; }; + 63D9E67A1D6013E7006B2661 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63D9E6731D6013E7006B2661 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63D9E6771D6013E7006B2661 /* PMKQCTests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKQuartzCore.framework */, + 63D9E6761D6013E7006B2661 /* PMKQCTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 637B4A731D5D5FC600E1BC6C /* PMKQuartzCore.h */, + 639E8D021D5D651300D210E4 /* CALayer+AnyPromise.h */, + 639E8D031D5D651300D210E4 /* CALayer+AnyPromise.m */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 639E8D061D5D651D00D210E4 /* TestQuartzCore.m */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; + 63D9E6771D6013E7006B2661 /* PMKQCTests */ = { + isa = PBXGroup; + children = ( + 63D9E6781D6013E7006B2661 /* PMKQCTests.swift */, + 63D9E67A1D6013E7006B2661 /* Info.plist */, + ); + path = PMKQCTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 637B4A741D5D5FC600E1BC6C /* PMKQuartzCore.h in Headers */, + 639E8D041D5D651300D210E4 /* CALayer+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKQuartzCore */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKQuartzCore" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKQuartzCore; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKQuartzCore.framework */; + productType = "com.apple.product-type.framework"; + }; + 63D9E6751D6013E7006B2661 /* PMKQCTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63D9E67B1D6013E7006B2661 /* Build configuration list for PBXNativeTarget "PMKQCTests" */; + buildPhases = ( + 63D9E6721D6013E7006B2661 /* Sources */, + 63D9E6731D6013E7006B2661 /* Frameworks */, + 63D9E6741D6013E7006B2661 /* Resources */, + 63D9E67E1D6013F5006B2661 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKQCTests; + productName = PMKQCTests; + productReference = 63D9E6761D6013E7006B2661 /* PMKQCTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63D9E6751D6013E7006B2661 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKQuartzCore" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKQuartzCore */, + 63D9E6751D6013E7006B2661 /* PMKQCTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 63D9E6741D6013E7006B2661 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 63D9E67E1D6013F5006B2661 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 639E8D051D5D651300D210E4 /* CALayer+AnyPromise.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63D9E6721D6013E7006B2661 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63D9E6791D6013E7006B2661 /* PMKQCTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.QuartzCore; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.QuartzCore; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + 63D9E67C1D6013E7006B2661 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + INFOPLIST_FILE = PMKQCTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.PMKQCTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63D9E67D1D6013E7006B2661 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + INFOPLIST_FILE = PMKQCTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.PMKQCTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKQuartzCore" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKQuartzCore" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63D9E67B1D6013E7006B2661 /* Build configuration list for PBXNativeTarget "PMKQCTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63D9E67C1D6013E7006B2661 /* Debug */, + 63D9E67D1D6013E7006B2661 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/xcshareddata/xcschemes/PMKQuartzCore.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/xcshareddata/xcschemes/PMKQuartzCore.xcscheme new file mode 100644 index 0000000..b82ed04 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/PMKQuartzCore.xcodeproj/xcshareddata/xcschemes/PMKQuartzCore.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/README.markdown new file mode 100644 index 0000000..a122759 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit QuartzCore Extensions ![Build Status] + +This project adds promises to Apple’s QuartzCore framework. + +## CocoaPods + +```ruby +pod "PromiseKit/QuartzCore" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/QuartzCore" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKQuartzCore +``` + +```objc +// objc +@import PromiseKit; +@import PMKQuartzCore; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/QuartzCore.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h new file mode 100644 index 0000000..0026d37 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.h @@ -0,0 +1,40 @@ +// +// CALayer+AnyPromise.h +// +// Created by María Patricia Montalvo Dzib on 24/11/14. +// Copyright (c) 2014 Aluxoft SCP. All rights reserved. +// + +#import +#import + +/** + To import the `CALayer` category: + + use_frameworks! + pod "PromiseKit/QuartzCore" + + Or `CALayer` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + @import PromiseKit; +*/ +@interface CALayer (PromiseKit) + +/** + Add the specified animation object to the layer’s render tree. + + @return A promise that thens two parameters: + + 1. `@YES` if the animation progressed entirely to completion. + 2. The `CAAnimation` object. + + @see addAnimation:forKey +*/ +- (AnyPromise *)promiseAnimation:(CAAnimation *)animation forKey:(NSString *)key; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m new file mode 100644 index 0000000..6ad7e2f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/CALayer+AnyPromise.m @@ -0,0 +1,36 @@ +// +// CALayer+PromiseKit.m +// +// Created by María Patricia Montalvo Dzib on 24/11/14. +// Copyright (c) 2014 Aluxoft SCP. All rights reserved. +// + +#import +#import "CALayer+AnyPromise.h" + +@interface PMKCAAnimationDelegate : NSObject { +@public + PMKResolver resolve; + CAAnimation *animation; +} +@end + +@implementation PMKCAAnimationDelegate + +- (void)animationDidStop:(CAAnimation *)ignoreOrRetainCycleHappens finished:(BOOL)flag { + resolve(PMKManifold(@(flag), animation)); + animation.delegate = nil; +} + +@end + +@implementation CALayer (PromiseKit) + +- (AnyPromise *)promiseAnimation:(CAAnimation *)animation forKey:(NSString *)key { + PMKCAAnimationDelegate *d = animation.delegate = [PMKCAAnimationDelegate new]; + d->animation = animation; + [self addAnimation:animation forKey:key]; + return [[AnyPromise alloc] initWithResolver:&d->resolve]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h new file mode 100644 index 0000000..585f7fd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Sources/PMKQuartzCore.h @@ -0,0 +1 @@ +#import "CALayer+AnyPromise.h" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Tests/TestQuartzCore.m b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Tests/TestQuartzCore.m new file mode 100644 index 0000000..249d5f7 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/QuartzCore/Tests/TestQuartzCore.m @@ -0,0 +1,18 @@ +@import PMKQuartzCore; +@import PromiseKit; +@import QuartzCore; +@import XCTest; + +@implementation TestCALayer: XCTestCase + +- (void)test { + id ex = [self expectationWithDescription:@""]; + + [[CALayer layer] promiseAnimation:[CAAnimation new] forKey:@"center"].then(^{ + [ex fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/Social/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/Social/.travis.yml new file mode 100644 index 0000000..b923f17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/.travis.yml @@ -0,0 +1,26 @@ +os: osx +language: objective-c +osx_image: xcode10 +env: + - PLAT=macOS SWFT=3.4 DST="arch=x86_64" + - PLAT=iOS SWFT=3.4 DST="OS=11.4,name=iPhone 5s" + + - PLAT=macOS SWFT=4.2 DST="arch=x86_64" TEST=1 + - PLAT=iOS SWFT=4.2 DST="OS=8.4,name=iPhone 4s" + - PLAT=iOS SWFT=4.2 DST="OS=9.3,name=iPhone 5s" + - PLAT=iOS SWFT=4.2 DST="OS=10.3.1,name=iPhone SE" + - PLAT=iOS SWFT=4.2 DST="OS=11.4,name=iPhone 5s" TEST=1 +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKSocial -target PMKSocial -quiet -destination "$DST" build SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKSocial -target PMKSLTests -quiet -destination "$DST" build; + fi +script: + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKSocial -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/Social/Cartfile new file mode 100644 index 0000000..6f40a07 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Cartfile @@ -0,0 +1,2 @@ +github "mxcl/PromiseKit" ~> 6.0 +github "PromiseKit/Foundation" ~> 3.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/Social/Cartfile.resolved new file mode 100644 index 0000000..f46a345 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Cartfile.resolved @@ -0,0 +1,2 @@ +github "PromiseKit/Foundation" "3.2.0" +github "mxcl/PromiseKit" "6.3.4" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/Social/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/Social/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b194d41 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.pbxproj @@ -0,0 +1,466 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 637B4A741D5D5FC600E1BC6C /* PMKSocial.h in Headers */ = {isa = PBXBuildFile; fileRef = 637B4A731D5D5FC600E1BC6C /* PMKSocial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63B8B9A81D5D621F007AAB62 /* SLComposeViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B8B9A41D5D621F007AAB62 /* SLComposeViewController+Promise.swift */; }; + 63B8B9A91D5D621F007AAB62 /* SLRequest+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 63B8B9A51D5D621F007AAB62 /* SLRequest+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63B8B9AA1D5D621F007AAB62 /* SLRequest+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B8B9A61D5D621F007AAB62 /* SLRequest+AnyPromise.m */; }; + 63B8B9AB1D5D621F007AAB62 /* SLRequest+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B8B9A71D5D621F007AAB62 /* SLRequest+Promise.swift */; }; + 63B8B9AE1D5D622E007AAB62 /* TestSocial.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B8B9AC1D5D622E007AAB62 /* TestSocial.m */; }; + 63B8B9AF1D5D622E007AAB62 /* TestSocial.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B8B9AD1D5D622E007AAB62 /* TestSocial.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKSocial.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKSocial.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKSocial; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 637B4A731D5D5FC600E1BC6C /* PMKSocial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKSocial.h; path = Sources/PMKSocial.h; sourceTree = SOURCE_ROOT; }; + 63B8B9A41D5D621F007AAB62 /* SLComposeViewController+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "SLComposeViewController+Promise.swift"; path = "Sources/SLComposeViewController+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63B8B9A51D5D621F007AAB62 /* SLRequest+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SLRequest+AnyPromise.h"; path = "Sources/SLRequest+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 63B8B9A61D5D621F007AAB62 /* SLRequest+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "SLRequest+AnyPromise.m"; path = "Sources/SLRequest+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 63B8B9A71D5D621F007AAB62 /* SLRequest+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "SLRequest+Promise.swift"; path = "Sources/SLRequest+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63B8B9AC1D5D622E007AAB62 /* TestSocial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestSocial.m; path = Tests/TestSocial.m; sourceTree = SOURCE_ROOT; }; + 63B8B9AD1D5D622E007AAB62 /* TestSocial.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestSocial.swift; path = Tests/TestSocial.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKSocial.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKSocial.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKSLTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKSLTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKSocial.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKSocial.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKSLTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 637B4A731D5D5FC600E1BC6C /* PMKSocial.h */, + 63B8B9A41D5D621F007AAB62 /* SLComposeViewController+Promise.swift */, + 63B8B9A51D5D621F007AAB62 /* SLRequest+AnyPromise.h */, + 63B8B9A61D5D621F007AAB62 /* SLRequest+AnyPromise.m */, + 63B8B9A71D5D621F007AAB62 /* SLRequest+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 63B8B9AC1D5D622E007AAB62 /* TestSocial.m */, + 63B8B9AD1D5D622E007AAB62 /* TestSocial.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 637B4A741D5D5FC600E1BC6C /* PMKSocial.h in Headers */, + 63B8B9A91D5D621F007AAB62 /* SLRequest+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKSocial */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKSocial" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKSocial; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKSocial.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKSLTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKSLTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKSLTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKSLTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKSocial" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKSocial */, + 63C7FFF11D5C020D003BAE60 /* PMKSLTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + PMKFoundation, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63B8B9A81D5D621F007AAB62 /* SLComposeViewController+Promise.swift in Sources */, + 63B8B9AB1D5D621F007AAB62 /* SLRequest+Promise.swift in Sources */, + 63B8B9AA1D5D621F007AAB62 /* SLRequest+AnyPromise.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63B8B9AF1D5D622E007AAB62 /* TestSocial.swift in Sources */, + 63B8B9AE1D5D622E007AAB62 /* TestSocial.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKSocial */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.StoreKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.StoreKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKSocial" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKSocial" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKSLTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/xcshareddata/xcschemes/PMKSocial.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/xcshareddata/xcschemes/PMKSocial.xcscheme new file mode 100644 index 0000000..3574c7b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/PMKSocial.xcodeproj/xcshareddata/xcschemes/PMKSocial.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/Social/README.markdown new file mode 100644 index 0000000..bd6a9f9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit Social Extensions ![Build Status] + +This project adds promises to Apple’s Social framework. + +## CocoaPods + +```ruby +pod "PromiseKit/Social", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/Social" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKSocial +``` + +```objc +// objc +@import PromiseKit; +@import PMKSocial; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/Social.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/PMKSocial.h b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/PMKSocial.h new file mode 100644 index 0000000..8eeb321 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/PMKSocial.h @@ -0,0 +1 @@ +#import "SLRequest+AnyPromise.h" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLComposeViewController+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLComposeViewController+Promise.swift new file mode 100644 index 0000000..ab23a10 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLComposeViewController+Promise.swift @@ -0,0 +1,48 @@ +#if !os(OSX) + +import Social.SLComposeViewController +import UIKit.UIViewController +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import this `UIViewController` category: + + use_frameworks! + pod "PromiseKit/Social" + + And then in your sources: + + import PromiseKit +*/ +extension UIViewController { + /// Presents the message view controller and resolves with the user action. + public func promise(_ vc: SLComposeViewController, animated: Bool = true, completion: (() -> Void)? = nil) -> Promise { + present(vc, animated: animated, completion: completion) + return Promise { seal in + vc.completionHandler = { result in + if result == .cancelled { + seal.reject(SLComposeViewController.PMKError.cancelled) + } else { + seal.fulfill(()) + } + } + } + } +} + +extension SLComposeViewController { + /// Errors representing PromiseKit SLComposeViewController failures + public enum PMKError: CancellableError { + /// The user cancelled the view controller. + case cancelled + + /// - Returns: true + public var isCancelled: Bool { + switch self { case .cancelled: return true } + } + } +} + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+AnyPromise.h new file mode 100644 index 0000000..190417f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+AnyPromise.h @@ -0,0 +1,36 @@ +// +// Created by merowing on 09/05/2014. +// +// +// + +#import +#import + +/** + To import the `SLRequest` category: + + use_frameworks! + pod "PromiseKit/Social" + + And then in your sources: + + @import PromiseKit; +*/ +@interface SLRequest (PromiseKit) + +/** + Performs the request asynchronously. + + @return A promise that fulfills with three parameters: + + 1) The response decoded as JSON. + 2) The `NSHTTPURLResponse`. + 3) The raw `NSData` response. + + @warning *Note* If PromiseKit determines the response is not JSON, the first + parameter will instead be plain `NSData`. +*/ +- (AnyPromise *)promise NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+AnyPromise.m new file mode 100644 index 0000000..01a1ea9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+AnyPromise.m @@ -0,0 +1,51 @@ +// +// Created by merowing on 09/05/2014. +// +// +// + +#import +#import "SLRequest+AnyPromise.h" + +#if COCOAPODS +#import "NSURLSession+AnyPromise.h" +#else +#import +#endif + +@implementation SLRequest (PromiseKit) + +- (AnyPromise *)promise { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + [self performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { + + assert(![NSThread isMainThread]); + + if (error) + return resolve(error); + + NSInteger const statusCode = urlResponse.statusCode; + if (statusCode < 200 || statusCode >= 300) { + id userInfo = [NSMutableDictionary new]; + userInfo[PMKURLErrorFailingURLResponseKey] = urlResponse; + userInfo[NSLocalizedDescriptionKey] = [NSHTTPURLResponse localizedStringForStatusCode:statusCode]; + + if (responseData) { + id str = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; + userInfo[PMKURLErrorFailingStringKey] = str; + } + + resolve([NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadServerResponse userInfo:userInfo]); + } + else if (PMKHTTPURLResponseIsJSON(urlResponse)) { + id err = nil; + id json = [NSJSONSerialization JSONObjectWithData:responseData options:PMKJSONDeserializationOptions error:&err]; + resolve(err ?: PMKManifold(json, urlResponse, responseData)); + } else { + resolve(PMKManifold(responseData, urlResponse, responseData)); + } + }]; + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+Promise.swift new file mode 100644 index 0000000..c2a0431 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Sources/SLRequest+Promise.swift @@ -0,0 +1,37 @@ +#if !PMKCocoaPods +import PMKFoundation +import PromiseKit +#endif +import Social + +/** + To import the `SLRequest` category: + + use_frameworks! + pod "PromiseKit/Social" + + And then in your sources: + + import PromiseKit +*/ +extension SLRequest { + /** + Performs the request asynchronously. + + - Returns: A promise that fulfills with the response. + - SeeAlso: `URLDataPromise` + */ + public func perform() -> Promise<(data: Data, response: HTTPURLResponse)> { + return Promise { seal in + perform { data, rsp, error in + if let data = data, let rsp = rsp { + seal.fulfill((data, rsp)) + } else if let error = error { + seal.reject(error) + } else { + seal.reject(PMKError.invalidCallingConvention) + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSLComposeViewController.swift b/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSLComposeViewController.swift new file mode 100644 index 0000000..3ada515 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSLComposeViewController.swift @@ -0,0 +1,16 @@ +import XCTest + +class UITest_SLComposeViewController_Swift: PMKiOSUITestCase { + func test_can_cancel() { + let app = XCUIApplication() + app.tables.staticTexts["5"].tap() + + sleep(5) // takes longer than usual + + app.alerts.buttons["Cancel"].tap() + + sleep(3) // takes longer than usual (this may only pass when you look at it) + + XCTAssertTrue(value) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSocial.m b/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSocial.m new file mode 100644 index 0000000..61e646b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSocial.m @@ -0,0 +1,136 @@ +@import PMKSocial; +@import XCTest; + + +@interface MockSLRequest: SLRequest +@property id response; +@property id data; +@property id error; +@end +@implementation MockSLRequest +- (void)performRequestWithHandler:(SLRequestHandler)handler { + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + handler(_data, _response, _error); + }); +} +@end + + +@implementation Test_SLRequest_ObjC: XCTestCase + +- (void)test1 { + id url = [NSURL URLWithString:@"http://example.com"]; + id input = @{@"3": @4}; + + MockSLRequest *request = (id) [MockSLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:url parameters:@{@"1": @2}]; + request.response = [[NSHTTPURLResponse alloc] initWithURL:url statusCode:200 HTTPVersion:@"1.1" headerFields:@{@"Content-Type": @"application/json"}]; + request.data = [NSJSONSerialization dataWithJSONObject:input options:0 error:nil]; + + id ex = [self expectationWithDescription:@""]; + [request promise].then(^(id json){ + XCTAssertEqualObjects(json, input); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test2 { + id url = [NSURL URLWithString:@"http://example.com"]; + + MockSLRequest *request = (id) [MockSLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:url parameters:@{@"1": @2}]; + request.response = [[NSHTTPURLResponse alloc] initWithURL:url statusCode:500 HTTPVersion:@"1.1" headerFields:@{}]; + + id ex = [self expectationWithDescription:@""]; + [request promise].catch(^(id err){ + XCTAssertEqualObjects(NSURLErrorDomain, [err domain]); + XCTAssertEqual([err code], NSURLErrorBadServerResponse); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test3 { + id url = [NSURL URLWithString:@"http://example.com"]; + id data = [NSData dataWithBytes:"abc" length:3]; + + MockSLRequest *request = (id) [MockSLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:url parameters:@{@"1": @2}]; + request.response = [[NSHTTPURLResponse alloc] initWithURL:url statusCode:200 HTTPVersion:@"1.1" headerFields:@{}]; + request.data = data; + + id ex = [self expectationWithDescription:@""]; + [request promise].then(^(id rspdata){ + XCTAssertEqualObjects(data, rspdata); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test4 { + id url = [NSURL URLWithString:@"http://example.com"]; + + MockSLRequest *request = (id) [MockSLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:url parameters:@{@"1": @2}]; + request.response = [[NSHTTPURLResponse alloc] initWithURL:url statusCode:200 HTTPVersion:@"1.1" headerFields:@{}]; + request.error = [NSError errorWithDomain:@"Cat" code:123 userInfo:nil]; + + id ex = [self expectationWithDescription:@""]; + [request promise].catch(^(NSError *error){ + XCTAssertEqual(error.code, 123); + XCTAssertEqualObjects(error.domain, @"Cat"); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +@end + + +#ifndef TARGET_OS_MAC + +#import +@import Social.SLComposeViewController; +@import Stubbilino; +#import "UIViewController+AnyPromise.h" + +@implementation Test_SLComposeViewController_ObjC: XCTestCase + +- (void)__test:(SLComposeViewControllerResult)dummy :(void (^)(AnyPromise *, id expectation))block { + id rootvc = [UIViewController new]; + id ex = [self expectationWithDescription:@""]; + + SLComposeViewController *composevc = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; + + id stub = [Stubbilino stubObject:rootvc]; + [stub stubMethod:@selector(presentViewController:animated:completion:) withBlock:^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + composevc.completionHandler(dummy); + }); + }]; + + block([rootvc promiseViewController:composevc animated:NO completion:nil], ex); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test1 { + NSInteger dummy = SLComposeViewControllerResultDone; + + [self __test:dummy :^(AnyPromise *promise, id expectation) { + promise.then(^(id result){ + XCTAssertEqual([result integerValue], dummy); + [expectation fulfill]; + }); + }]; +} + +- (void)test2 { + [self __test:SLComposeViewControllerResultCancelled :^(AnyPromise *promise, id expectation) { + promise.catchWithPolicy(PMKCatchPolicyAllErrors, ^(NSError *error){ + XCTAssertTrue(error.cancelled); + [expectation fulfill]; + }); + }]; +} + +@end + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSocial.swift b/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSocial.swift new file mode 100644 index 0000000..9fb1888 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/Social/Tests/TestSocial.swift @@ -0,0 +1,56 @@ +import PromiseKit +import PMKSocial +import Social +import XCTest + +class SLRequestTests: XCTestCase { + func testSLRequest() { + // I tried to just override SLRequest, but Swift wouldn't let me + // then use the long initializer, and an exception is thrown inside + // init() + + swizzle(SLRequest.self, #selector(SLRequest.perform(handler:))) { + let url = URL(string: "https://api.twitter.com/1.1/statuses/user_timeline.json") + let params = ["foo": "bar"] + let rq = SLRequest(forServiceType: SLServiceTypeTwitter, requestMethod: .GET, url: url, parameters: params)! + + let ex = expectation(description: "") + rq.perform().done { + XCTAssertEqual($0.data, Data()) + ex.fulfill() + }.catch { + XCTFail("\($0)") + } + waitForExpectations(timeout: 1, handler: nil) + } + } +} + +extension SLRequest { + @objc private func pmk_performRequestWithHandler(_ handler: @escaping SLRequestHandler) { + after(seconds: 0).done { _ in + let rsp = HTTPURLResponse(url: URL(string: "http://example.com")!, statusCode: 200, httpVersion: "2.0", headerFields: [:]) + handler(Data(), rsp, nil) + } + } +} + + +import ObjectiveC + +func swizzle(_ foo: AnyClass, _ from: Selector, isClassMethod: Bool = false, body: () -> Void) { + let originalMethod: Method! + let swizzledMethod: Method! + + if isClassMethod { + originalMethod = class_getClassMethod(foo, from) + swizzledMethod = class_getClassMethod(foo, Selector("pmk_\(from)")) + } else { + originalMethod = class_getInstanceMethod(foo, from) + swizzledMethod = class_getInstanceMethod(foo, Selector("pmk_\(from)")) + } + + method_exchangeImplementations(originalMethod, swizzledMethod) + body() + method_exchangeImplementations(swizzledMethod, originalMethod) +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/.travis.yml new file mode 100644 index 0000000..d4b378d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/.travis.yml @@ -0,0 +1,72 @@ +branches: + only: + - master +stages: + - lint + - test +jobs: + include: + - &pod + stage: lint + osx_image: xcode8.3 + env: SWIFT=3.1 + name: pod lib lint --swift-version=3.1 + os: osx + language: objective-c + before_install: + gem install cocoapods --prerelease --version 1.6.0.beta.1 + install: + carthage bootstrap --no-build PromiseKit + script: | + cd Carthage/Checkouts/PromiseKit + mv .github/PromiseKit.podspec . + rm -rf Extensions/StoreKit/Sources + cp -R ../../../Sources Extensions/StoreKit + pod lib lint --subspec=PromiseKit/StoreKit --fail-fast --swift-version=$SWIFT + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=3.2 + name: pod lib lint --swift-version=3.2 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=3.3 + name: pod lib lint --swift-version=3.3 + - <<: *pod + osx_image: xcode10 + env: SWIFT=3.4 + name: pod lib lint --swift-version=3.4 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=4.0 + name: pod lib lint --swift-version=4.0 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=4.1 + name: pod lib lint --swift-version=4.1 + - <<: *pod + osx_image: xcode10 + env: SWIFT=4.2 + name: pod lib lint --swift-version=4.2 + + - &test + stage: test + osx_image: xcode10 + name: macOS Tests + env: DST='arch=x86_64' PLAT=macOS + os: osx + language: objective-c + cache: + directories: + - Carthage + before_install: + carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT + install: + xcodebuild -scheme PMKStoreKit -target PMKStoreKit -quiet -destination "$DST" SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: + xcodebuild -scheme PMKStoreKit -quiet -destination "$DST" test + - <<: *test + env: DST='OS=12.0,name=iPhone SE' PLAT=iOS + name: iOS Tests + - <<: *test + env: DST='OS=12.0,name=Apple TV' PLAT=tvOS + name: tvOS Tests diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Cartfile.resolved new file mode 100644 index 0000000..2235519 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.5.1" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..aa81743 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.pbxproj @@ -0,0 +1,475 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 637B4A6C1D5D5F9B00E1BC6C /* SKRequest+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 637B4A691D5D5F9B00E1BC6C /* SKRequest+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 637B4A6D1D5D5F9B00E1BC6C /* SKRequest+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 637B4A6A1D5D5F9B00E1BC6C /* SKRequest+AnyPromise.m */; }; + 637B4A6E1D5D5F9B00E1BC6C /* SKProductsRequest+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637B4A6B1D5D5F9B00E1BC6C /* SKProductsRequest+Promise.swift */; }; + 637B4A711D5D5FA400E1BC6C /* TestStoreKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 637B4A6F1D5D5FA400E1BC6C /* TestStoreKit.m */; }; + 637B4A721D5D5FA400E1BC6C /* TestStoreKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637B4A701D5D5FA400E1BC6C /* TestStoreKit.swift */; }; + 637B4A741D5D5FC600E1BC6C /* PMKStoreKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 637B4A731D5D5FC600E1BC6C /* PMKStoreKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63C7FFF71D5C020D003BAE60 /* PMKStoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKStoreKit.framework */; }; + B95EDB3B216E07C300963D64 /* SKPaymentQueue+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = B95EDB3A216E07C300963D64 /* SKPaymentQueue+Promise.swift */; }; + D3F6DBF31EA245750013E242 /* SKPayment+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3F6DBF21EA245750013E242 /* SKPayment+Promise.swift */; }; + D3F6DBF51EA246340013E242 /* SKReceiptRefreshRequest+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3F6DBF41EA246340013E242 /* SKReceiptRefreshRequest+Promise.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKStoreKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 637B4A691D5D5F9B00E1BC6C /* SKRequest+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SKRequest+AnyPromise.h"; path = "Sources/SKRequest+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 637B4A6A1D5D5F9B00E1BC6C /* SKRequest+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "SKRequest+AnyPromise.m"; path = "Sources/SKRequest+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 637B4A6B1D5D5F9B00E1BC6C /* SKProductsRequest+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "SKProductsRequest+Promise.swift"; path = "Sources/SKProductsRequest+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 637B4A6F1D5D5FA400E1BC6C /* TestStoreKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestStoreKit.m; path = Tests/TestStoreKit.m; sourceTree = SOURCE_ROOT; }; + 637B4A701D5D5FA400E1BC6C /* TestStoreKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestStoreKit.swift; path = Tests/TestStoreKit.swift; sourceTree = SOURCE_ROOT; }; + 637B4A731D5D5FC600E1BC6C /* PMKStoreKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKStoreKit.h; path = Sources/PMKStoreKit.h; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKStoreKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKStoreKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKSKTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKSKTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; + B95EDB3A216E07C300963D64 /* SKPaymentQueue+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SKPaymentQueue+Promise.swift"; sourceTree = ""; }; + D3F6DBF21EA245750013E242 /* SKPayment+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "SKPayment+Promise.swift"; path = "Sources/SKPayment+Promise.swift"; sourceTree = SOURCE_ROOT; }; + D3F6DBF41EA246340013E242 /* SKReceiptRefreshRequest+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "SKReceiptRefreshRequest+Promise.swift"; path = "Sources/SKReceiptRefreshRequest+Promise.swift"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKStoreKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKStoreKit.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKSKTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 637B4A731D5D5FC600E1BC6C /* PMKStoreKit.h */, + 637B4A691D5D5F9B00E1BC6C /* SKRequest+AnyPromise.h */, + 637B4A6A1D5D5F9B00E1BC6C /* SKRequest+AnyPromise.m */, + 637B4A6B1D5D5F9B00E1BC6C /* SKProductsRequest+Promise.swift */, + D3F6DBF21EA245750013E242 /* SKPayment+Promise.swift */, + D3F6DBF41EA246340013E242 /* SKReceiptRefreshRequest+Promise.swift */, + B95EDB3A216E07C300963D64 /* SKPaymentQueue+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 637B4A6F1D5D5FA400E1BC6C /* TestStoreKit.m */, + 637B4A701D5D5FA400E1BC6C /* TestStoreKit.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 637B4A741D5D5FC600E1BC6C /* PMKStoreKit.h in Headers */, + 637B4A6C1D5D5F9B00E1BC6C /* SKRequest+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKStoreKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKStoreKit" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKStoreKit; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKStoreKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKSKTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKSKTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKSKTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKSKTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKStoreKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKStoreKit */, + 63C7FFF11D5C020D003BAE60 /* PMKSKTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D3F6DBF51EA246340013E242 /* SKReceiptRefreshRequest+Promise.swift in Sources */, + 637B4A6D1D5D5F9B00E1BC6C /* SKRequest+AnyPromise.m in Sources */, + B95EDB3B216E07C300963D64 /* SKPaymentQueue+Promise.swift in Sources */, + 637B4A6E1D5D5F9B00E1BC6C /* SKProductsRequest+Promise.swift in Sources */, + D3F6DBF31EA245750013E242 /* SKPayment+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 637B4A721D5D5FA400E1BC6C /* TestStoreKit.swift in Sources */, + 637B4A711D5D5FA400E1BC6C /* TestStoreKit.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKStoreKit */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.StoreKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.StoreKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKStoreKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKStoreKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKSKTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/xcshareddata/xcschemes/PMKStoreKit.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/xcshareddata/xcschemes/PMKStoreKit.xcscheme new file mode 100644 index 0000000..5d19962 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/PMKStoreKit.xcodeproj/xcshareddata/xcschemes/PMKStoreKit.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/README.markdown new file mode 100644 index 0000000..95475aa --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit StoreKit Extensions ![Build Status] + +This project adds promises to Apple’s StoreKit framework. + +## CocoaPods + +```ruby +pod "PromiseKit/StoreKit", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/StoreKit" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKStoreKit +``` + +```objc +// objc +@import PromiseKit; +@import PMKStoreKit; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/StoreKit.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/PMKStoreKit.h b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/PMKStoreKit.h new file mode 100644 index 0000000..fb67b80 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/PMKStoreKit.h @@ -0,0 +1 @@ +#import "SKRequest+AnyPromise.h" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKPayment+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKPayment+Promise.swift new file mode 100644 index 0000000..be3e1f7 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKPayment+Promise.swift @@ -0,0 +1,45 @@ +#if !PMKCocoaPods +import PromiseKit +#endif +import StoreKit + +extension SKPayment { + public func promise() -> Promise { + return PaymentObserver(payment: self).promise + } +} + +private class PaymentObserver: NSObject, SKPaymentTransactionObserver { + let (promise, seal) = Promise.pending() + let payment: SKPayment + var retainCycle: PaymentObserver? + + init(payment: SKPayment) { + self.payment = payment + super.init() + SKPaymentQueue.default().add(self) + SKPaymentQueue.default().add(payment) + retainCycle = self + } + + func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { + guard let transaction = transactions.first(where: { $0.payment == payment }) else { + return + } + switch transaction.transactionState { + case .purchased, .restored: + queue.finishTransaction(transaction) + seal.fulfill(transaction) + queue.remove(self) + retainCycle = nil + case .failed: + let error = transaction.error ?? PMKError.cancelled + queue.finishTransaction(transaction) + seal.reject(error) + queue.remove(self) + retainCycle = nil + default: + break + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKPaymentQueue+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKPaymentQueue+Promise.swift new file mode 100644 index 0000000..c60148c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKPaymentQueue+Promise.swift @@ -0,0 +1,55 @@ +#if !PMKCocoaPods +import PromiseKit +#endif +import StoreKit + +public extension SKPaymentQueue { + func restoreCompletedTransactions(_: PMKNamespacer) -> Promise<[SKPaymentTransaction]> { + return PaymentObserver(self).promise + } + + func restoreCompletedTransactions(_: PMKNamespacer, withApplicationUsername username: String?) -> Promise<[SKPaymentTransaction]> { + return PaymentObserver(self, withApplicationUsername: true, userName: username).promise + } +} + +private class PaymentObserver: NSObject, SKPaymentTransactionObserver { + let (promise, seal) = Promise<[SKPaymentTransaction]>.pending() + var retainCycle: PaymentObserver? + var finishedTransactions = [SKPaymentTransaction]() + + //TODO:PMK7: this is weird, just have a `String?` parameter + init(_ paymentQueue: SKPaymentQueue, withApplicationUsername: Bool = false, userName: String? = nil) { + super.init() + paymentQueue.add(self) + withApplicationUsername ? + paymentQueue.restoreCompletedTransactions() : + paymentQueue.restoreCompletedTransactions(withApplicationUsername: userName) + retainCycle = self + } + + func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { + for transaction in transactions where transaction.transactionState == .restored { + finishedTransactions.append(transaction) + queue.finishTransaction(transaction) + } + } + + func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue) { + resolve(queue, nil) + } + + func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error) { + resolve(queue, error) + } + + func resolve(_ queue: SKPaymentQueue, _ error: Error?) { + if let error = error { + seal.reject(error) + } else { + seal.fulfill(finishedTransactions) + } + queue.remove(self) + retainCycle = nil + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKProductsRequest+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKProductsRequest+Promise.swift new file mode 100644 index 0000000..5497fcd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKProductsRequest+Promise.swift @@ -0,0 +1,52 @@ +import StoreKit +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `SKRequest` category: + + use_frameworks! + pod "PromiseKit/StoreKit" + + And then in your sources: + + import PromiseKit +*/ +extension SKProductsRequest { + /** + Sends the request to the Apple App Store. + + - Returns: A promise that fulfills if the request succeeds. + */ + public func start(_: PMKNamespacer) -> Promise { + let proxy = SKDelegate() + delegate = proxy + proxy.retainCycle = proxy + start() + return proxy.promise + } +} + + +fileprivate class SKDelegate: NSObject, SKProductsRequestDelegate { + let (promise, seal) = Promise.pending() + var retainCycle: SKDelegate? + + @objc fileprivate func request(_ request: SKRequest, didFailWithError error: Error) { + seal.reject(error) + retainCycle = nil + } + + @objc fileprivate func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) { + seal.fulfill(response) + retainCycle = nil + } +} + +// perhaps one day Apple will actually make their errors into Errors… +//extension SKError: CancellableError { +// public var isCancelled: Bool { +// return true +// } +//} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKReceiptRefreshRequest+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKReceiptRefreshRequest+Promise.swift new file mode 100644 index 0000000..3bbc784 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKReceiptRefreshRequest+Promise.swift @@ -0,0 +1,35 @@ +#if !PMKCocoaPods +import PromiseKit +#endif +import StoreKit + +extension SKReceiptRefreshRequest { + public func promise() -> Promise { + return ReceiptRefreshObserver(request: self).promise + } +} + +private class ReceiptRefreshObserver: NSObject, SKRequestDelegate { + let (promise, seal) = Promise.pending() + let request: SKReceiptRefreshRequest + var retainCycle: ReceiptRefreshObserver? + + init(request: SKReceiptRefreshRequest) { + self.request = request + super.init() + request.delegate = self + request.start() + retainCycle = self + } + + + func requestDidFinish(_: SKRequest) { + seal.fulfill(request) + retainCycle = nil + } + + func request(_: SKRequest, didFailWithError error: Error) { + seal.reject(error) + retainCycle = nil + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKRequest+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKRequest+AnyPromise.h new file mode 100644 index 0000000..a2f473d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKRequest+AnyPromise.h @@ -0,0 +1,31 @@ +// +// PromiseKit+StoreKit.h +// Aluxoft SCP +// +// Created by Josejulio Martínez on 16/05/14. + +#import +#import + +/** + To import the `SKRequest` category: + + use_frameworks! + pod "PromiseKit/StoreKit" + + And then in your sources: + + @import PromiseKit; +*/ +@interface SKRequest (PromiseKit) + +/** + Sends the request to the Apple App Store. + + @return A promise that fulfills when the request succeeds. If the + receiver is an SKProductsRequest, the promise fulfills with its + `SKProductsResponse`, otherwise the promise is void. +*/ +- (AnyPromise *)promise NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKRequest+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKRequest+AnyPromise.m new file mode 100644 index 0000000..896807a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Sources/SKRequest+AnyPromise.m @@ -0,0 +1,48 @@ +// +// PromiseKit+StoreKit.m +// Aluxoft SCP +// +// Created by Josejulio Martínez on 16/05/14. +// + +#import "SKRequest+AnyPromise.h" +#import + +//TODO do categories work on inherited classes? As would solve our swift SKProductsRequest problem + +@interface PMKSKRequestDelegate : NSObject { +@public + PMKResolver resolve; + id retainCycle; +} +@end + +@implementation PMKSKRequestDelegate + +- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { + resolve(response); + retainCycle = request.delegate = nil; +} + +- (void)requestDidFinish:(SKRequest *)request { + resolve(nil); + retainCycle = request.delegate = nil; +} + +- (void)request:(SKRequest *)request didFailWithError:(NSError *)error { + resolve(error); + retainCycle = request.delegate = nil; +} + +@end + +@implementation SKProductsRequest (PromiseKit) + +- (AnyPromise *)promise { + PMKSKRequestDelegate *d = [PMKSKRequestDelegate new]; + d->retainCycle = self.delegate = d; + [self start]; + return [[AnyPromise alloc] initWithResolver:&d->resolve]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.m b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.m new file mode 100644 index 0000000..9be7296 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.m @@ -0,0 +1,27 @@ +@import PMKStoreKit; +@import PromiseKit; +@import StoreKit; +@import XCTest; + +@implementation PMKSKProductsRequest: SKProductsRequest + +- (void)start { + PMKAfter(0.5).then(^{ + [self.delegate productsRequest:self didReceiveResponse:[SKProductsResponse new]]; + }); +} + +@end + +@implementation SKProductsRequestTests: XCTestCase + +- (void)test { + id ex = [self expectationWithDescription:@""]; + SKProductsRequest *rq = [PMKSKProductsRequest new]; + [rq promise].then(^{ + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.swift b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.swift new file mode 100644 index 0000000..e40ae84 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/StoreKit/Tests/TestStoreKit.swift @@ -0,0 +1,22 @@ +import PMKStoreKit +import PromiseKit +import StoreKit +import XCTest + +class SKProductsRequestTests: XCTestCase { + func test() { + class MockProductsRequest: SKProductsRequest { + override func start() { + after(seconds: 0.1).done { + self.delegate?.productsRequest(self, didReceive: SKProductsResponse()) + } + } + } + + let ex = expectation(description: "") + MockProductsRequest().start(.promise).done { _ in + ex.fulfill() + } + waitForExpectations(timeout: 1, handler: nil) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/.travis.yml new file mode 100644 index 0000000..013749d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/.travis.yml @@ -0,0 +1,22 @@ +language: objective-c +osx_image: xcode9.3 +env: + - DESTINATION="arch=x86_64" PLATFORM=Mac TEST=1 + - DESTINATION="OS=11.3,name=iPhone SE" PLATFORM=iOS TEST=1 + - DESTINATION="OS=10.3.1,name=iPhone SE" PLATFORM=iOS + - DESTINATION="OS=9.3,name=iPhone 5s" PLATFORM=iOS + - DESTINATION="OS=8.4,name=iPhone 4s" PLATFORM=iOS + - DESTINATION="OS=11.3,name=Apple TV" PLATFORM=tvOS TEST=1 + - DESTINATION="OS=10.2,name=Apple TV 1080p" PLATFORM=tvOS + - DESTINATION="OS=9.2,name=Apple TV 1080p" PLATFORM=tvOS +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLATFORM --verbose +install: + - xcodebuild -scheme PMKSystemConfiguration -target PMKSystemConfiguration -destination "$DESTINATION" build + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKSystemConfiguration -target PMKSCTests -destination "$DESTINATION" build; + fi +script: + - if [[ $TEST == "1" ]]; then + xcodebuild -scheme PMKSystemConfiguration -destination "$DESTINATION" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f59f77d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.pbxproj @@ -0,0 +1,457 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6358AB7A1D5D4B6700B9B157 /* PMKSystemConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 6358AB791D5D4B6700B9B157 /* PMKSystemConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6362F84E1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 6362F84C1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6362F84F1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 6362F84D1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.m */; }; + 6383E14B1D611E0D00897651 /* SCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6383E14A1D611E0D00897651 /* SCTests.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKSystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKSystemConfiguration.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKSystemConfiguration; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6358AB791D5D4B6700B9B157 /* PMKSystemConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKSystemConfiguration.h; path = Sources/PMKSystemConfiguration.h; sourceTree = SOURCE_ROOT; }; + 6362F84C1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SCNetworkReachability+AnyPromise.h"; path = "Sources/SCNetworkReachability+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 6362F84D1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "SCNetworkReachability+AnyPromise.m"; path = "Sources/SCNetworkReachability+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 6383E14A1D611E0D00897651 /* SCTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SCTests.swift; path = Tests/SCTests.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKSystemConfiguration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKSystemConfiguration.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKSCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKSCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKSystemConfiguration.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKSystemConfiguration.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKSCTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 6358AB791D5D4B6700B9B157 /* PMKSystemConfiguration.h */, + 6362F84C1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.h */, + 6362F84D1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.m */, + ); + path = Sources; + sourceTree = ""; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 6383E14A1D611E0D00897651 /* SCTests.swift */, + ); + path = Tests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6358AB7A1D5D4B6700B9B157 /* PMKSystemConfiguration.h in Headers */, + 6362F84E1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKSystemConfiguration */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKSystemConfiguration" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKSystemConfiguration; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKSystemConfiguration.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKSCTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKSCTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKSCTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKSCTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0920; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0920; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKSystemConfiguration" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKSystemConfiguration */, + 63C7FFF11D5C020D003BAE60 /* PMKSCTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6362F84F1D5D934C0021D2DD /* SCNetworkReachability+AnyPromise.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6383E14B1D611E0D00897651 /* SCTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKSystemConfiguration */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKSystemConfiguration" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKSystemConfiguration" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKSCTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/xcshareddata/xcschemes/PMKSystemConfiguration.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/xcshareddata/xcschemes/PMKSystemConfiguration.xcscheme new file mode 100644 index 0000000..389fad8 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/PMKSystemConfiguration.xcodeproj/xcshareddata/xcschemes/PMKSystemConfiguration.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/README.markdown new file mode 100644 index 0000000..6c1952c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit SystemConfiguration Extensions ![Build Status] + +This project adds promises to Apple’s SystemConfiguration framework. + +## CocoaPods + +```ruby +pod "PromiseKit/SystemConfiguration" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/SystemConfiguration" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKSystemConfiguration +``` + +```objc +// objc +@import PromiseKit; +@import PMKSystemConfiguration; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/Foundation.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/PMKSystemConfiguration.h b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/PMKSystemConfiguration.h new file mode 100644 index 0000000..a8d32fb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/PMKSystemConfiguration.h @@ -0,0 +1 @@ +#import "SCNetworkReachability+AnyPromise.h" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+AnyPromise.h new file mode 100644 index 0000000..81f86dc --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+AnyPromise.h @@ -0,0 +1,18 @@ +#import + +/** + Resolves as soon as the Internet is accessible. If it is already + accessible, resolves immediately. + + To import `SCNetworkReachability`: + + use_frameworks! + pod "PromiseKit/SystemConfiguration" + + And then in your sources: + + @import PromiseKit; + + @return A void promise that fulfills when the Internet becomes accessible. +*/ +AnyPromise *SCNetworkReachability(); diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+AnyPromise.m new file mode 100644 index 0000000..5aaf0b1 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+AnyPromise.m @@ -0,0 +1,116 @@ +#import +#import +#import +#import +#import +#import +#import +#import + +@interface JTSReachability: NSObject { +@public + PMKResolver resolve; + id retainCycle; +} +- (BOOL)reachable; +- (void)start; +@end + + +AnyPromise *SCNetworkReachability() { + JTSReachability *reach = [JTSReachability new]; + if (reach.reachable) + return [AnyPromise promiseWithValue:nil]; + reach->retainCycle = reach; + [reach start]; + return [[AnyPromise alloc] initWithResolver:&reach->resolve]; +} + + +static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) { + JTSReachability *reachability = (__bridge JTSReachability *)info; + if (reachability.reachable) { + reachability->resolve(nil); + reachability->retainCycle = nil; + } +} + + +@implementation JTSReachability { + SCNetworkReachabilityRef reachabilityRef; +} + +- (instancetype)init { + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + + reachabilityRef = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)&zeroAddress); + + return self; +} + +- (void)start { + SCNetworkReachabilityContext context = {0, (__bridge void *)(self), NULL, NULL, NULL}; + SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context); + SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); +} + +- (void)dealloc { + SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + CFRelease(reachabilityRef); +} + +- (BOOL)reachable { + SCNetworkReachabilityFlags flags; + if (!SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) + return NO; + + if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) + return NO; + + BOOL returnValue = NO; + + if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) + { + /* + If the target host is reachable and no connection is required then we'll assume (for now) that you're on Wi-Fi... + */ + returnValue = YES; + } + + if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) + { + /* + ... and the connection is on-demand (or on-traffic) if the calling application is using the CFSocketStream or higher APIs... + */ + + if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) + { + /* + ... and no [user] intervention is needed... + */ + returnValue = YES; + } + } + +#if TARGET_OS_IPHONE + if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) + { + /* + ... but WWAN connections are OK if the calling application is using the CFNetwork APIs. + */ + if (flags & kSCNetworkReachabilityFlagsConnectionRequired) { + returnValue = NO; + } else { + returnValue = YES; + } + } +#endif + + return returnValue; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+Promise.swift new file mode 100644 index 0000000..b751b66 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Sources/SCNetworkReachability+Promise.swift @@ -0,0 +1,62 @@ +import SystemConfiguration +#if !PMKCocoaPods +import PromiseKit +#endif + +public extension SCNetworkReachability { + + enum PMKError: Error { + case couldNotInitializeReachability + } + + static func promise() -> Promise { + do { + var zeroAddress = sockaddr() + zeroAddress.sa_len = UInt8(MemoryLayout.size) + zeroAddress.sa_family = sa_family_t(AF_INET) + guard let ref = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) else { + throw PMKError.couldNotInitializeReachability + } + + var flags = SCNetworkReachabilityFlags() + if SCNetworkReachabilityGetFlags(ref, &flags), flags.contains(.reachable) { + return Promise() + } + + return try Helper(ref: ref).pending.promise + } catch { + return Promise(error: error) + } + } +} + +private func callback(reachability: SCNetworkReachability, flags: SCNetworkReachabilityFlags, info: UnsafeMutableRawPointer?) { + if let info = info, flags.contains(.reachable) { + Unmanaged.fromOpaque(info).takeUnretainedValue().pending.resolver.fulfill(()) + } +} + +private class Helper { + let pending = Promise.pending() + let ref: SCNetworkReachability + + init(ref: SCNetworkReachability) throws { + self.ref = ref + + var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) + context.info = UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()) + + guard SCNetworkReachabilitySetCallback(ref, callback, &context) else { + throw SCNetworkReachability.PMKError.couldNotInitializeReachability + } + guard SCNetworkReachabilitySetDispatchQueue(ref, .main) else { + SCNetworkReachabilitySetCallback(ref, nil, nil) + throw SCNetworkReachability.PMKError.couldNotInitializeReachability + } + + _ = pending.promise.ensure { + SCNetworkReachabilitySetCallback(self.ref, nil, nil) + SCNetworkReachabilitySetDispatchQueue(self.ref, nil) + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Tests/SCTests.swift b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Tests/SCTests.swift new file mode 100644 index 0000000..9494601 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/SystemConfiguration/Tests/SCTests.swift @@ -0,0 +1,9 @@ +import PMKSystemConfiguration +import XCTest + +class PMKSCTestCase: XCTestCase { + func test() { + // just verify everything links etc. + SCNetworkReachability() + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/.gitignore new file mode 100644 index 0000000..30f5004 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/.travis.yml new file mode 100644 index 0000000..e2cf84e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/.travis.yml @@ -0,0 +1,70 @@ +branches: + only: + - master +stages: + - lint + - carthage + - test +jobs: + include: + - &pod + stage: lint + osx_image: xcode8.3 + env: SWIFT=3.1 + name: pod lib lint --swift-version=3.1 + os: osx + language: objective-c + before_install: + gem install cocoapods --prerelease --version 1.6.0.beta.1 + install: + carthage bootstrap --no-build PromiseKit + script: | + cd Carthage/Checkouts/PromiseKit + mv .github/PromiseKit.podspec . + rm -rf Extensions/UIKit/Sources + cp -R ../../../Sources Extensions/UIKit + pod lib lint --subspec=PromiseKit/UIKit --fail-fast --swift-version=$SWIFT + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=3.2 + name: pod lib lint --swift-version=3.2 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=3.3 + name: pod lib lint --swift-version=3.3 + - <<: *pod + osx_image: xcode10 + env: SWIFT=3.4 + name: pod lib lint --swift-version=3.4 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=4.0 + name: pod lib lint --swift-version=4.0 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=4.1 + name: pod lib lint --swift-version=4.1 + - <<: *pod + osx_image: xcode10 + env: SWIFT=4.2 + name: pod lib lint --swift-version=4.2 + + - &test + stage: test + osx_image: xcode10 + name: iOS Tests + env: DST='OS=12.0,name=iPhone SE' PLAT=iOS + os: osx + language: objective-c + cache: + directories: + - Carthage + before_install: + carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT + install: + xcodebuild -scheme PMKUIKit -target PMKUIKit -quiet -destination "$DST" SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + script: + xcodebuild -scheme PMKUIKit -quiet -destination "$DST" test + - <<: *test + env: DST='OS=12.0,name=Apple TV' PLAT=tvOS + name: tvOS Tests diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Cartfile.resolved new file mode 100644 index 0000000..d903612 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.5.0" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Info.plist new file mode 100644 index 0000000..34dfbc3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fff1565 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.pbxproj @@ -0,0 +1,753 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6304D6FE1D5F986A00CE6C99 /* PMKUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 6304D6FD1D5F986A00CE6C99 /* PMKUIKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 630B2E161D5D0B3200DC10E9 /* TestUIImagePickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 630B2DF71D5D0AD400DC10E9 /* TestUIImagePickerController.swift */; }; + 632B573520324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632B573420324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift */; }; + 6332142B1D83CD17009F67CE /* TestUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6332142A1D83CD17009F67CE /* TestUIView.swift */; }; + 637E2C841D5C2E0B0043E370 /* UIView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 637E2C771D5C2E0B0043E370 /* UIView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 637E2C851D5C2E0B0043E370 /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 637E2C781D5C2E0B0043E370 /* UIView+AnyPromise.m */; }; + 637E2C861D5C2E0B0043E370 /* UIView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637E2C791D5C2E0B0043E370 /* UIView+Promise.swift */; }; + 637E2C871D5C2E0B0043E370 /* UIViewController+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 637E2C7A1D5C2E0B0043E370 /* UIViewController+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 637E2C881D5C2E0B0043E370 /* UIViewController+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 637E2C7B1D5C2E0B0043E370 /* UIViewController+AnyPromise.m */; }; + 637E2C951D5C2E720043E370 /* TestUIImagePickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637E2C8E1D5C2E720043E370 /* TestUIImagePickerController.swift */; }; + 637E2C961D5C2E720043E370 /* TestUIViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 637E2C8F1D5C2E720043E370 /* TestUIViewController.m */; }; + 637E2C9B1D5C2F600043E370 /* infrastructure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637E2C9A1D5C2F600043E370 /* infrastructure.swift */; }; + 63A686811D88E93300D1C66B /* UIImagePickerController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A6867E1D88E93300D1C66B /* UIImagePickerController+Promise.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKUIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKUIKit.framework */; }; + 63C9C4571D5D339900101ECE /* app.swift in Sources */ = {isa = PBXBuildFile; fileRef = 630B2DF41D5D0AD400DC10E9 /* app.swift */; }; + 63C9C4581D5D339B00101ECE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 630B2DF51D5D0AD400DC10E9 /* Default-568h@2x.png */; }; + 63C9C45E1D5D341600101ECE /* PMKUIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKUIKit.framework */; }; + 63C9C45F1D5D341600101ECE /* PMKUIKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKUIKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKUIKit; + }; + 63C9C4591D5D33A900101ECE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C9C4441D5D334700101ECE; + remoteInfo = PMKTestsHost; + }; + 63C9C45B1D5D33AB00101ECE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C9C4441D5D334700101ECE; + remoteInfo = PMKTestsHost; + }; + 63C9C4601D5D341600101ECE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKUIKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 63C9C4621D5D341600101ECE /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 63C9C45F1D5D341600101ECE /* PMKUIKit.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 6304D6FD1D5F986A00CE6C99 /* PMKUIKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PMKUIKit.h; path = Sources/PMKUIKit.h; sourceTree = SOURCE_ROOT; }; + 630B2DF41D5D0AD400DC10E9 /* app.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = app.swift; path = UITests/app.swift; sourceTree = ""; }; + 630B2DF51D5D0AD400DC10E9 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "UITests/Default-568h@2x.png"; sourceTree = ""; }; + 630B2DF71D5D0AD400DC10E9 /* TestUIImagePickerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestUIImagePickerController.swift; path = UITests/TestUIImagePickerController.swift; sourceTree = ""; }; + 630B2E131D5D0AF500DC10E9 /* PMKUIUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKUIUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 632B573420324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewPropertyAnimator+Promise.swift"; sourceTree = ""; }; + 6332142A1D83CD17009F67CE /* TestUIView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestUIView.swift; path = Tests/TestUIView.swift; sourceTree = SOURCE_ROOT; }; + 637E2C771D5C2E0B0043E370 /* UIView+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIView+AnyPromise.h"; path = "Sources/UIView+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 637E2C781D5C2E0B0043E370 /* UIView+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIView+AnyPromise.m"; path = "Sources/UIView+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 637E2C791D5C2E0B0043E370 /* UIView+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIView+Promise.swift"; path = "Sources/UIView+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 637E2C7A1D5C2E0B0043E370 /* UIViewController+AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+AnyPromise.h"; path = "Sources/UIViewController+AnyPromise.h"; sourceTree = SOURCE_ROOT; }; + 637E2C7B1D5C2E0B0043E370 /* UIViewController+AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+AnyPromise.m"; path = "Sources/UIViewController+AnyPromise.m"; sourceTree = SOURCE_ROOT; }; + 637E2C8E1D5C2E720043E370 /* TestUIImagePickerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestUIImagePickerController.swift; path = Tests/TestUIImagePickerController.swift; sourceTree = SOURCE_ROOT; }; + 637E2C8F1D5C2E720043E370 /* TestUIViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestUIViewController.m; path = Tests/TestUIViewController.m; sourceTree = SOURCE_ROOT; }; + 637E2C9A1D5C2F600043E370 /* infrastructure.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = infrastructure.swift; path = Tests/infrastructure.swift; sourceTree = SOURCE_ROOT; }; + 63A6867E1D88E93300D1C66B /* UIImagePickerController+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIImagePickerController+Promise.swift"; path = "Sources/UIImagePickerController+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKUIKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKUIKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C9C4451D5D334700101ECE /* PMKTestsHost.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PMKTestsHost.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 630B2E0D1D5D0AF500DC10E9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKUIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C9C4421D5D334700101ECE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C9C45E1D5D341600101ECE /* PMKUIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 630B2DF31D5D0ABF00DC10E9 /* TestsHost */ = { + isa = PBXGroup; + children = ( + 630B2DF41D5D0AD400DC10E9 /* app.swift */, + 630B2DF51D5D0AD400DC10E9 /* Default-568h@2x.png */, + 630B2DF71D5D0AD400DC10E9 /* TestUIImagePickerController.swift */, + ); + name = TestsHost; + sourceTree = ""; + }; + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 630B2DF31D5D0ABF00DC10E9 /* TestsHost */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKUIKit.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKUITests.xctest */, + 630B2E131D5D0AF500DC10E9 /* PMKUIUITests.xctest */, + 63C9C4451D5D334700101ECE /* PMKTestsHost.app */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 6304D6FD1D5F986A00CE6C99 /* PMKUIKit.h */, + 637E2C771D5C2E0B0043E370 /* UIView+AnyPromise.h */, + 637E2C781D5C2E0B0043E370 /* UIView+AnyPromise.m */, + 637E2C791D5C2E0B0043E370 /* UIView+Promise.swift */, + 637E2C7A1D5C2E0B0043E370 /* UIViewController+AnyPromise.h */, + 637E2C7B1D5C2E0B0043E370 /* UIViewController+AnyPromise.m */, + 63A6867E1D88E93300D1C66B /* UIImagePickerController+Promise.swift */, + 632B573420324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 637E2C8E1D5C2E720043E370 /* TestUIImagePickerController.swift */, + 637E2C8F1D5C2E720043E370 /* TestUIViewController.m */, + 6332142A1D83CD17009F67CE /* TestUIView.swift */, + 637E2C9A1D5C2F600043E370 /* infrastructure.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6304D6FE1D5F986A00CE6C99 /* PMKUIKit.h in Headers */, + 637E2C871D5C2E0B0043E370 /* UIViewController+AnyPromise.h in Headers */, + 637E2C841D5C2E0B0043E370 /* UIView+AnyPromise.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 630B2DFF1D5D0AF500DC10E9 /* PMKUIUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 630B2E101D5D0AF500DC10E9 /* Build configuration list for PBXNativeTarget "PMKUIUITests" */; + buildPhases = ( + 630B2E041D5D0AF500DC10E9 /* Sources */, + 630B2E0D1D5D0AF500DC10E9 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C9C45A1D5D33A900101ECE /* PBXTargetDependency */, + ); + name = PMKUIUITests; + productName = PMKUIUITests; + productReference = 630B2E131D5D0AF500DC10E9 /* PMKUIUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; + 63C7FFA61D5BEE09003BAE60 /* PMKUIKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKUIKit" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKUIKit; + productName = PMKUIKit; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKUIKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKUITests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 6332EC8D1D5D085F00480270 /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + 63C9C45C1D5D33AB00101ECE /* PBXTargetDependency */, + ); + name = PMKUITests; + productName = PMKUITests; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKUITests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 63C9C4441D5D334700101ECE /* PMKTestsHost */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C9C4541D5D334800101ECE /* Build configuration list for PBXNativeTarget "PMKTestsHost" */; + buildPhases = ( + 63C9C4411D5D334700101ECE /* Sources */, + 63C9C4421D5D334700101ECE /* Frameworks */, + 63C9C4431D5D334700101ECE /* Resources */, + 63C9C45D1D5D33E700101ECE /* Embed Carthage Frameworks */, + 63C9C4621D5D341600101ECE /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C9C4611D5D341600101ECE /* PBXTargetDependency */, + ); + name = PMKTestsHost; + productName = PMKTestsHost; + productReference = 63C9C4451D5D334700101ECE /* PMKTestsHost.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 630B2DFF1D5D0AF500DC10E9 = { + LastSwiftMigration = 0900; + TestTargetID = 63C9C4441D5D334700101ECE; + }; + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + TestTargetID = 63C9C4441D5D334700101ECE; + }; + 63C9C4441D5D334700101ECE = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKUIKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKUIKit */, + 63C7FFF11D5C020D003BAE60 /* PMKUITests */, + 630B2DFF1D5D0AF500DC10E9 /* PMKUIUITests */, + 63C9C4441D5D334700101ECE /* PMKTestsHost */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 63C9C4431D5D334700101ECE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C9C4581D5D339B00101ECE /* Default-568h@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 6332EC8D1D5D085F00480270 /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; + 63C9C45D1D5D33E700101ECE /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 630B2E041D5D0AF500DC10E9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 630B2E161D5D0B3200DC10E9 /* TestUIImagePickerController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63A686811D88E93300D1C66B /* UIImagePickerController+Promise.swift in Sources */, + 637E2C861D5C2E0B0043E370 /* UIView+Promise.swift in Sources */, + 637E2C851D5C2E0B0043E370 /* UIView+AnyPromise.m in Sources */, + 632B573520324C4C00FCD5E1 /* UIViewPropertyAnimator+Promise.swift in Sources */, + 637E2C881D5C2E0B0043E370 /* UIViewController+AnyPromise.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 637E2C951D5C2E720043E370 /* TestUIImagePickerController.swift in Sources */, + 637E2C961D5C2E720043E370 /* TestUIViewController.m in Sources */, + 637E2C9B1D5C2F600043E370 /* infrastructure.swift in Sources */, + 6332142B1D83CD17009F67CE /* TestUIView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C9C4411D5D334700101ECE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C9C4571D5D339900101ECE /* app.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKUIKit */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; + 63C9C45A1D5D33A900101ECE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C9C4441D5D334700101ECE /* PMKTestsHost */; + targetProxy = 63C9C4591D5D33A900101ECE /* PBXContainerItemProxy */; + }; + 63C9C45C1D5D33AB00101ECE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C9C4441D5D334700101ECE /* PMKTestsHost */; + targetProxy = 63C9C45B1D5D33AB00101ECE /* PBXContainerItemProxy */; + }; + 63C9C4611D5D341600101ECE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKUIKit */; + targetProxy = 63C9C4601D5D341600101ECE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 630B2E111D5D0AF500DC10E9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_PACKAGE_TYPE = BNDL; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.ui.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + TEST_TARGET_NAME = PMKTestsHost; + }; + name = Debug; + }; + 630B2E121D5D0AF500DC10E9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_PACKAGE_TYPE = BNDL; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.ui.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + TEST_TARGET_NAME = PMKTestsHost; + }; + name = Release; + }; + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + BUNDLE_PACKAGE_TYPE = FMWK; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.0.3; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.UIKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + BUNDLE_PACKAGE_TYPE = FMWK; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.0.3; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.UIKit; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_PACKAGE_TYPE = BNDL; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PMKTestsHost.app/PMKTestsHost"; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_PACKAGE_TYPE = BNDL; + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PMKTestsHost.app/PMKTestsHost"; + }; + name = Release; + }; + 63C9C4551D5D334800101ECE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_PACKAGE_TYPE = APPL; + CODE_SIGN_ENTITLEMENTS = UITests/Entitlements.plist; + COPY_PHASE_STRIP = NO; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.host.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C9C4561D5D334800101ECE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_PACKAGE_TYPE = APPL; + CODE_SIGN_ENTITLEMENTS = UITests/Entitlements.plist; + COPY_PHASE_STRIP = NO; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.tests.host.UIKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 630B2E101D5D0AF500DC10E9 /* Build configuration list for PBXNativeTarget "PMKUIUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 630B2E111D5D0AF500DC10E9 /* Debug */, + 630B2E121D5D0AF500DC10E9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKUIKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKUIKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C9C4541D5D334800101ECE /* Build configuration list for PBXNativeTarget "PMKTestsHost" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C9C4551D5D334800101ECE /* Debug */, + 63C9C4561D5D334800101ECE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..07a6205 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/xcshareddata/xcschemes/PMKUIKit.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/xcshareddata/xcschemes/PMKUIKit.xcscheme new file mode 100644 index 0000000..91ddde7 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/PMKUIKit.xcodeproj/xcshareddata/xcschemes/PMKUIKit.xcscheme @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/README.markdown new file mode 100644 index 0000000..dafd4e6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/README.markdown @@ -0,0 +1,48 @@ +# PromiseKit UIKit Extensions ![Build Status] + +This project adds promises to Apple’s UIKit framework. + +This project supports Swift 3.0, 3.1, 3.2 and 4.0; iOS 9, 10 and 11; tvOS 10 and +11; CocoaPods and Carthage; Xcode 8.0, 8.1, 8.2, 8.3 and 9.0. + +## CocoaPods + +```ruby +pod "PromiseKit/UIKit", "~> 6.0" +``` + +The extensions are built into `PromiseKit.framework` thus `import PromiseKit` is +all that is needed. + +## Carthage + +```ruby +github "PromiseKit/UIKit" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKUIKit +``` + +```objc +// objc +@import PromiseKit; +@import PMKUIKit; +``` + +# `UIImagePickerController` + +Due to iOS 10 requiring an entry in your app’s `Info.plist` for any usage of `UIImagePickerController` (even if you don’t actually call it directly), we have removed UIImagePickerController from the default `UIKit` pod. To use it you must add an additional subspec: + +```ruby +pod "PromiseKit/UIImagePickerController" +``` + +Sorry, but there’s not an easier way. + + +[Build Status]: https://travis-ci.org/PromiseKit/UIKit.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h new file mode 100644 index 0000000..75cbf90 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/PMKUIKit.h @@ -0,0 +1,8 @@ +#import "UIView+AnyPromise.h" +#import "UIViewController+AnyPromise.h" + +typedef NS_OPTIONS(NSInteger, PMKAnimationOptions) { + PMKAnimationOptionsNone = 1 << 0, + PMKAnimationOptionsAppear = 1 << 1, + PMKAnimationOptionsDisappear = 1 << 2, +}; diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIImagePickerController+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIImagePickerController+Promise.swift new file mode 100644 index 0000000..d112c64 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIImagePickerController+Promise.swift @@ -0,0 +1,80 @@ +#if !PMKCocoaPods +import PromiseKit +#endif +import UIKit + +#if !os(tvOS) + +extension UIViewController { +#if swift(>=4.2) + /// Presents the UIImagePickerController, resolving with the user action. + public func promise(_ vc: UIImagePickerController, animate: PMKAnimationOptions = [.appear, .disappear], completion: (() -> Void)? = nil) -> Promise<[UIImagePickerController.InfoKey: Any]> { + let animated = animate.contains(.appear) + let proxy = UIImagePickerControllerProxy() + vc.delegate = proxy + present(vc, animated: animated, completion: completion) + return proxy.promise.ensure { + vc.presentingViewController?.dismiss(animated: animated, completion: nil) + } + } +#else + /// Presents the UIImagePickerController, resolving with the user action. + public func promise(_ vc: UIImagePickerController, animate: PMKAnimationOptions = [.appear, .disappear], completion: (() -> Void)? = nil) -> Promise<[String: Any]> { + let animated = animate.contains(.appear) + let proxy = UIImagePickerControllerProxy() + vc.delegate = proxy + present(vc, animated: animated, completion: completion) + return proxy.promise.ensure { + vc.presentingViewController?.dismiss(animated: animated, completion: nil) + } + } +#endif +} + +@objc private class UIImagePickerControllerProxy: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate { +#if swift(>=4.2) + let (promise, seal) = Promise<[UIImagePickerController.InfoKey: Any]>.pending() +#else + let (promise, seal) = Promise<[String: Any]>.pending() +#endif + var retainCycle: AnyObject? + + required override init() { + super.init() + retainCycle = self + } + +#if swift(>=4.2) + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { + seal.fulfill(info) + retainCycle = nil + } +#else + func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String: Any]) { + seal.fulfill(info) + retainCycle = nil + } +#endif + + func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { + seal.reject(UIImagePickerController.PMKError.cancelled) + retainCycle = nil + } +} + +extension UIImagePickerController { + /// Errors representing PromiseKit UIImagePickerController failures + public enum PMKError: CancellableError { + /// The user cancelled the UIImagePickerController. + case cancelled + /// - Returns: true + public var isCancelled: Bool { + switch self { + case .cancelled: + return true + } + } + } +} + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h new file mode 100644 index 0000000..0a19cd6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.h @@ -0,0 +1,80 @@ +#import +#import + +// Created by Masafumi Yoshida on 2014/07/11. +// Copyright (c) 2014年 DeNA. All rights reserved. + +/** + To import the `UIView` category: + + use_frameworks! + pod "PromiseKit/UIKit" + + Or `UIKit` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + @import PromiseKit; +*/ +@interface UIView (PromiseKit) + +/** + Animate changes to one or more views using the specified duration. + + @param duration The total duration of the animations, measured in + seconds. If you specify a negative value or 0, the changes are made + without animating them. + + @param animations A block object containing the changes to commit to the + views. + + @return A promise that fulfills with a boolean NSNumber indicating + whether or not the animations actually finished. +*/ ++ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; + +/** + Animate changes to one or more views using the specified duration, delay, + options, and completion handler. + + @param duration The total duration of the animations, measured in + seconds. If you specify a negative value or 0, the changes are made + without animating them. + + @param delay The amount of time (measured in seconds) to wait before + beginning the animations. Specify a value of 0 to begin the animations + immediately. + + @param options A mask of options indicating how you want to perform the + animations. For a list of valid constants, see UIViewAnimationOptions. + + @param animations A block object containing the changes to commit to the + views. + + @return A promise that fulfills with a boolean NSNumber indicating + whether or not the animations actually finished. +*/ ++ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; + +/** + Performs a view animation using a timing curve corresponding to the + motion of a physical spring. + + @return A promise that fulfills with a boolean NSNumber indicating + whether or not the animations actually finished. +*/ ++ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; + +/** + Creates an animation block object that can be used to set up + keyframe-based animations for the current view. + + @return A promise that fulfills with a boolean NSNumber indicating + whether or not the animations actually finished. +*/ ++ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options keyframeAnimations:(void (^)(void))animations NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m new file mode 100644 index 0000000..04ee940 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+AnyPromise.m @@ -0,0 +1,64 @@ +// +// UIView+PromiseKit_UIAnimation.m +// YahooDenaStudy +// +// Created by Masafumi Yoshida on 2014/07/11. +// Copyright (c) 2014年 DeNA. All rights reserved. +// + +#import +#import "UIView+AnyPromise.h" + + +#define CopyPasta \ + NSAssert([NSThread isMainThread], @"UIKit animation must be performed on the main thread"); \ + \ + if (![NSThread isMainThread]) { \ + id error = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"Animation was attempted on a background thread"}]; \ + return [AnyPromise promiseWithValue:error]; \ + } \ + \ + PMKResolver resolve = nil; \ + AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; + + +@implementation UIView (PromiseKit) + ++ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations { + return [self promiseWithDuration:duration delay:0 options:0 animations:animations]; +} + ++ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void(^)(void))animations +{ + CopyPasta; + + [UIView animateWithDuration:duration delay:delay options:options animations:animations completion:^(BOOL finished) { + resolve(@(finished)); + }]; + + return promise; +} + ++ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void(^)(void))animations +{ + CopyPasta; + + [UIView animateWithDuration:duration delay:delay usingSpringWithDamping:dampingRatio initialSpringVelocity:velocity options:options animations:animations completion:^(BOOL finished) { + resolve(@(finished)); + }]; + + return promise; +} + ++ (AnyPromise *)promiseWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options keyframeAnimations:(void(^)(void))animations +{ + CopyPasta; + + [UIView animateKeyframesWithDuration:duration delay:delay options:options animations:animations completion:^(BOOL finished) { + resolve(@(finished)); + }]; + + return promise; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift new file mode 100644 index 0000000..1bbb8c6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIView+Promise.swift @@ -0,0 +1,115 @@ +import UIKit.UIView +#if !PMKCocoaPods +import PromiseKit +#endif + +/** + To import the `UIView` category: + + use_frameworks! + pod "PromiseKit/UIKit" + + Or `UIKit` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + import PromiseKit +*/ +public extension UIView { +#if swift(>=4.2) +/** + Animate changes to one or more views using the specified duration, delay, + options, and completion handler. + + - Parameter duration: The total duration of the animations, measured in + seconds. If you specify a negative value or 0, the changes are made + without animating them. + + - Parameter delay: The amount of time (measured in seconds) to wait before + beginning the animations. Specify a value of 0 to begin the animations + immediately. + + - Parameter options: A mask of options indicating how you want to perform the + animations. For a list of valid constants, see UIViewAnimationOptions. + + - Parameter animations: A block object containing the changes to commit to the + views. + + - Returns: A promise that fulfills with a boolean NSNumber indicating + whether or not the animations actually finished. + */ + @discardableResult + static func animate(_: PMKNamespacer, duration: TimeInterval, delay: TimeInterval = 0, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) -> Guarantee { + return Guarantee { animate(withDuration: duration, delay: delay, options: options, animations: animations, completion: $0) } + } + + @discardableResult + static func animate(_: PMKNamespacer, duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping damping: CGFloat, initialSpringVelocity: CGFloat, options: UIView.AnimationOptions = [], animations: @escaping () -> Void) -> Guarantee { + return Guarantee { animate(withDuration: duration, delay: delay, usingSpringWithDamping: damping, initialSpringVelocity: initialSpringVelocity, options: options, animations: animations, completion: $0) } + } + + @discardableResult + static func transition(_: PMKNamespacer, with view: UIView, duration: TimeInterval, options: UIView.AnimationOptions = [], animations: (() -> Void)?) -> Guarantee { + return Guarantee { transition(with: view, duration: duration, options: options, animations: animations, completion: $0) } + } + + @discardableResult + static func transition(_: PMKNamespacer, from: UIView, to: UIView, duration: TimeInterval, options: UIView.AnimationOptions = []) -> Guarantee { + return Guarantee { transition(from: from, to: to, duration: duration, options: options, completion: $0) } + } + + @discardableResult + static func perform(_: PMKNamespacer, animation: UIView.SystemAnimation, on views: [UIView], options: UIView.AnimationOptions = [], animations: (() -> Void)?) -> Guarantee { + return Guarantee { perform(animation, on: views, options: options, animations: animations, completion: $0) } + } +#else + /** + Animate changes to one or more views using the specified duration, delay, + options, and completion handler. + + - Parameter duration: The total duration of the animations, measured in + seconds. If you specify a negative value or 0, the changes are made + without animating them. + + - Parameter delay: The amount of time (measured in seconds) to wait before + beginning the animations. Specify a value of 0 to begin the animations + immediately. + + - Parameter options: A mask of options indicating how you want to perform the + animations. For a list of valid constants, see UIViewAnimationOptions. + + - Parameter animations: A block object containing the changes to commit to the + views. + + - Returns: A promise that fulfills with a boolean NSNumber indicating + whether or not the animations actually finished. + */ + @discardableResult + static func animate(_: PMKNamespacer, duration: TimeInterval, delay: TimeInterval = 0, options: UIViewAnimationOptions = [], animations: @escaping () -> Void) -> Guarantee { + return Guarantee { animate(withDuration: duration, delay: delay, options: options, animations: animations, completion: $0) } + } + + @discardableResult + static func animate(_: PMKNamespacer, duration: TimeInterval, delay: TimeInterval, usingSpringWithDamping damping: CGFloat, initialSpringVelocity: CGFloat, options: UIViewAnimationOptions = [], animations: @escaping () -> Void) -> Guarantee { + return Guarantee { animate(withDuration: duration, delay: delay, usingSpringWithDamping: damping, initialSpringVelocity: initialSpringVelocity, options: options, animations: animations, completion: $0) } + } + + @discardableResult + static func transition(_: PMKNamespacer, with view: UIView, duration: TimeInterval, options: UIViewAnimationOptions = [], animations: (() -> Void)?) -> Guarantee { + return Guarantee { transition(with: view, duration: duration, options: options, animations: animations, completion: $0) } + } + + @discardableResult + static func transition(_: PMKNamespacer, from: UIView, to: UIView, duration: TimeInterval, options: UIViewAnimationOptions = []) -> Guarantee { + return Guarantee { transition(from: from, to: to, duration: duration, options: options, completion: $0) } + } + + @discardableResult + static func perform(_: PMKNamespacer, animation: UISystemAnimation, on views: [UIView], options: UIViewAnimationOptions = [], animations: (() -> Void)?) -> Guarantee { + return Guarantee { perform(animation, on: views, options: options, animations: animations, completion: $0) } + } +#endif +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h new file mode 100644 index 0000000..0e60ca9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.h @@ -0,0 +1,71 @@ +#import +#import + +/** + To import the `UIViewController` category: + + use_frameworks! + pod "PromiseKit/UIKit" + + Or `UIKit` is one of the categories imported by the umbrella pod: + + use_frameworks! + pod "PromiseKit" + + And then in your sources: + + @import PromiseKit; +*/ +@interface UIViewController (PromiseKit) + +/** + Presents a view controller modally. + + If the view controller is one of the following: + + - MFMailComposeViewController + - MFMessageComposeViewController + - UIImagePickerController + - SLComposeViewController + + Then PromiseKit presents the view controller returning a promise that is + resolved as per the documentation for those classes. Eg. if you present a + `UIImagePickerController` the view controller will be presented for you + and the returned promise will resolve with the media the user selected. + + [self promiseViewController:[MFMailComposeViewController new] animated:YES completion:nil].then(^{ + //… + }); + + Otherwise PromiseKit expects your view controller to implement a + `promise` property. This promise will be returned from this method and + presentation and dismissal of the presented view controller will be + managed for you. + + \@interface MyViewController: UIViewController + @property (readonly) AnyPromise *promise; + @end + + @implementation MyViewController { + PMKResolver resolve; + } + + - (void)viewDidLoad { + _promise = [[AnyPromise alloc] initWithResolver:&resolve]; + } + + - (void)later { + resolve(@"some fulfilled value"); + } + + @end + + [self promiseViewController:[MyViewController new] aniamted:YES completion:nil].then(^(id value){ + // value == @"some fulfilled value" + }); + + @return A promise that can be resolved by the presented view controller. +*/ +- (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))block NS_REFINED_FOR_SWIFT; + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m new file mode 100644 index 0000000..5231e55 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewController+AnyPromise.m @@ -0,0 +1,140 @@ +#import +#import "UIViewController+AnyPromise.h" +#import + +#if PMKImagePickerController +#import +#endif + +@interface PMKGenericDelegate : NSObject { +@public + PMKResolver resolve; +} ++ (instancetype)delegateWithPromise:(AnyPromise **)promise; +@end + +@interface UIViewController () +- (AnyPromise*) promise; +@end + +@implementation UIViewController (PromiseKit) + +- (AnyPromise *)promiseViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))block { + __kindof UIViewController *vc2present = vc; + AnyPromise *promise = nil; + + if ([vc isKindOfClass:NSClassFromString(@"MFMailComposeViewController")]) { + PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; + [vc setValue:delegate forKey:@"mailComposeDelegate"]; + } + else if ([vc isKindOfClass:NSClassFromString(@"MFMessageComposeViewController")]) { + PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; + [vc setValue:delegate forKey:@"messageComposeDelegate"]; + } +#ifdef PMKImagePickerController + else if ([vc isKindOfClass:[UIImagePickerController class]]) { + PMKGenericDelegate *delegate = [PMKGenericDelegate delegateWithPromise:&promise]; + [vc setValue:delegate forKey:@"delegate"]; + } +#endif + else if ([vc isKindOfClass:NSClassFromString(@"SLComposeViewController")]) { + PMKResolver resolve; + promise = [[AnyPromise alloc] initWithResolver:&resolve]; + [vc setValue:^(NSInteger result){ + if (result == 0) { + resolve([NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]); + } else { + resolve(@(result)); + } + } forKey:@"completionHandler"]; + } + else if ([vc isKindOfClass:[UINavigationController class]]) + vc = [(id)vc viewControllers].firstObject; + + if (!vc) { + id userInfo = @{NSLocalizedDescriptionKey: @"nil or effective nil passed to promiseViewController"}; + id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; + return [AnyPromise promiseWithValue:err]; + } + + if (!promise) { + if (![vc respondsToSelector:@selector(promise)]) { + id userInfo = @{NSLocalizedDescriptionKey: @"ViewController is not promisable"}; + id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; + return [AnyPromise promiseWithValue:err]; + } + + promise = [vc valueForKey:@"promise"]; + + if (![promise isKindOfClass:[AnyPromise class]]) { + id userInfo = @{NSLocalizedDescriptionKey: @"The promise property is nil or not of type AnyPromise"}; + id err = [NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:userInfo]; + return [AnyPromise promiseWithValue:err]; + } + } + + if (!promise.pending) + return promise; + + [self presentViewController:vc2present animated:animated completion:block]; + + promise.ensure(^{ + [vc2present.presentingViewController dismissViewControllerAnimated:animated completion:nil]; + }); + + return promise; +} + +@end + + + +@implementation PMKGenericDelegate { + id retainCycle; +} + ++ (instancetype)delegateWithPromise:(AnyPromise **)promise; { + PMKGenericDelegate *d = [PMKGenericDelegate new]; + d->retainCycle = d; + *promise = [[AnyPromise alloc] initWithResolver:&d->resolve]; + return d; +} + +- (void)mailComposeController:(id)controller didFinishWithResult:(int)result error:(NSError *)error { + if (error != nil) { + resolve(error); + } else if (result == 0) { + resolve([NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]); + } else { + resolve(@(result)); + } + retainCycle = nil; +} + +- (void)messageComposeViewController:(id)controller didFinishWithResult:(int)result { + if (result == 2) { + id userInfo = @{NSLocalizedDescriptionKey: @"The attempt to save or send the message was unsuccessful."}; + id error = [NSError errorWithDomain:PMKErrorDomain code:PMKOperationFailed userInfo:userInfo]; + resolve(error); + } else { + resolve(@(result)); + } + retainCycle = nil; +} + +#ifdef PMKImagePickerController + +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + id img = info[UIImagePickerControllerEditedImage] ?: info[UIImagePickerControllerOriginalImage]; + resolve(PMKManifold(img, info)); + retainCycle = nil; +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { + resolve([NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]); + retainCycle = nil; +} + +#endif + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewPropertyAnimator+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewPropertyAnimator+Promise.swift new file mode 100644 index 0000000..34ee140 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Sources/UIViewPropertyAnimator+Promise.swift @@ -0,0 +1,14 @@ +#if !PMKCocoaPods +import PromiseKit +#endif +import UIKit + +@available(iOS 10, tvOS 10, *) +public extension UIViewPropertyAnimator { + func startAnimation(_: PMKNamespacer) -> Guarantee { + return Guarantee { + addCompletion($0) + startAnimation() + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIImagePickerController.swift b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIImagePickerController.swift new file mode 100644 index 0000000..abefe68 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIImagePickerController.swift @@ -0,0 +1,34 @@ +import PromiseKit +import PMKUIKit +import XCTest +import UIKit + +#if os(iOS) + +class Test_UIImagePickerController_Swift: XCTestCase { + func test() { + class Mock: UIViewController { + var info = [String:AnyObject]() + + override func present(_ vc: UIViewController, animated flag: Bool, completion: (() -> Void)?) { + let ipc = vc as! UIImagePickerController + after(seconds: 0.05).done { + ipc.delegate?.imagePickerController?(ipc, didFinishPickingMediaWithInfo: self.info) + } + } + } + + let (originalImage, editedImage) = (UIImage(), UIImage()) + + let mockvc = Mock() + mockvc.info = [UIImagePickerControllerOriginalImage: originalImage, UIImagePickerControllerEditedImage: editedImage] + + let ex = expectation(description: "") + mockvc.promise(UIImagePickerController(), animate: []).done { _ in + ex.fulfill() + } + waitForExpectations(timeout: 10, handler: nil) + } +} + +#endif diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIView.swift b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIView.swift new file mode 100644 index 0000000..dd3b4fd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIView.swift @@ -0,0 +1,19 @@ +import PromiseKit +import PMKUIKit +import XCTest +import UIKit + +class UIViewTests: XCTestCase { + func test() { + let ex1 = expectation(description: "") + let ex2 = expectation(description: "") + + UIView.animate(.promise, duration: 0.1) { + ex1.fulfill() + }.done { _ in + ex2.fulfill() + } + + waitForExpectations(timeout: 1) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIViewController.m b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIViewController.m new file mode 100644 index 0000000..7426601 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/TestUIViewController.m @@ -0,0 +1,135 @@ +@import PromiseKit; +@import PMKUIKit; +@import XCTest; +@import UIKit; + + +@interface MyViewController: UIViewController +@property AnyPromise *promise; +@end +@implementation MyViewController +@end + + +@implementation UIViewControllerTests: XCTestCase { + UIViewController *rootvc; +} + +- (void)setUp { + rootvc = [UIApplication sharedApplication].keyWindow.rootViewController = [UIViewController new]; +} + +- (void)tearDown { + [UIApplication sharedApplication].keyWindow.rootViewController = nil; +} + +// view controller is presented and dismissed when promise is resolved +- (void)test1 { + XCTestExpectation *ex = [self expectationWithDescription:@""]; + + PMKResolver resolve; + + MyViewController *myvc = [MyViewController new]; + myvc.promise = [[AnyPromise alloc] initWithResolver:&resolve]; + [rootvc promiseViewController:myvc animated:NO completion:nil].then(^{ + // seems to take another tick for the dismissal to complete + }).then(^{ + [ex fulfill]; + }); + + XCTAssertNotNil(rootvc.presentedViewController); + + PMKAfter(1).then(^{ + resolve(@1); + }); + + [self waitForExpectationsWithTimeout:10 handler:nil]; + + XCTAssertNil(rootvc.presentedViewController); +} + +// view controller is not presented if promise is resolved +- (void)test2 { + MyViewController *myvc = [MyViewController new]; + myvc.promise = [AnyPromise promiseWithValue:nil]; + [rootvc promiseViewController:myvc animated:NO completion:nil]; + + XCTAssertNil(rootvc.presentedViewController); +} + +// promise property must be promise +- (void)test3 { + XCTestExpectation *ex = [self expectationWithDescription:@""]; + + MyViewController *myvc = [MyViewController new]; + myvc.promise = (id) @1; + [rootvc promiseViewController:myvc animated:NO completion:nil].catch(^(id err){ + [ex fulfill]; + }); + + XCTAssertNil(rootvc.presentedViewController); + + [self waitForExpectationsWithTimeout:10 handler:nil]; + + XCTAssertNil(rootvc.presentedViewController); +} + +// promise property must not be nil +- (void)test4 { + XCTestExpectation *ex = [self expectationWithDescription:@""]; + + MyViewController *myvc = [MyViewController new]; + [rootvc promiseViewController:myvc animated:NO completion:nil].catch(^(id err){ + [ex fulfill]; + }); + + XCTAssertNil(rootvc.presentedViewController); + + [self waitForExpectationsWithTimeout:10 handler:nil]; + + XCTAssertNil(rootvc.presentedViewController); +} + +// view controller must have a promise property +- (void)test5 { + XCTestExpectation *ex = [self expectationWithDescription:@""]; + + UIViewController *vc = [UIViewController new]; + [rootvc promiseViewController:vc animated:NO completion:nil].catch(^(id err){ + [ex fulfill]; + }); + + XCTAssertNil(rootvc.presentedViewController); + + [self waitForExpectationsWithTimeout:10 handler:nil]; + + XCTAssertNil(rootvc.presentedViewController); +} + +// promised nav controllers use their root vc’s promise property +- (void)test6 { + XCTestExpectation *ex = [self expectationWithDescription:@""]; + + PMKResolver resolve; + + MyViewController *myvc = [MyViewController new]; + UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:myvc]; + myvc.promise = [[AnyPromise alloc] initWithResolver:&resolve]; + [rootvc promiseViewController:nc animated:NO completion:nil].then(^(id obj){ + XCTAssertEqualObjects(@1, obj); + }).then(^{ + [ex fulfill]; + }); + + XCTAssertNotNil(rootvc.presentedViewController); + + PMKAfter(1).then(^{ + resolve(@1); + }); + + [self waitForExpectationsWithTimeout:10 handler:nil]; + + XCTAssertNil(rootvc.presentedViewController); +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/infrastructure.swift b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/infrastructure.swift new file mode 100644 index 0000000..6d38427 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/Tests/infrastructure.swift @@ -0,0 +1,16 @@ +import XCTest +import UIKit + +extension XCTestCase { + var rootvc: UIViewController { + return UIApplication.shared.keyWindow!.rootViewController! + } + + override open func setUp() { + UIApplication.shared.keyWindow!.rootViewController = UIViewController() + } + + override open func tearDown() { + UIApplication.shared.keyWindow!.rootViewController = nil + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/Default-568h@2x.png b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/Default-568h@2x.png new file mode 100644 index 0000000..42d3f42 Binary files /dev/null and b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/Default-568h@2x.png differ diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/Entitlements.plist b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/Entitlements.plist new file mode 100644 index 0000000..76a15bb --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/Entitlements.plist @@ -0,0 +1,12 @@ + + + + + com.apple.private.tcc.allow + + kTCCServiceAddressBook + kTCCServiceCalendar + kTCCServicePhotos + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/TestUIImagePickerController.swift b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/TestUIImagePickerController.swift new file mode 100644 index 0000000..43c7bf3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/TestUIImagePickerController.swift @@ -0,0 +1,61 @@ +import XCTest + +class UIImagePickerControllerTests: XCTestCase { + var button: XCUIElement { + // calling this ensures that any other ViewController has dismissed + // as a side-effect since otherwise the switch won't be found + return XCUIApplication().tables.buttons.element + } + + var value: Bool { + return button.isEnabled + } + + override func setUp() { + super.setUp() + continueAfterFailure = false + XCUIApplication().launch() + XCTAssertFalse(value) + } + +#if !os(tvOS) + // this test works locally but not on travis + // attempting to detect Travis and early-return did not work + func test_rejects_when_cancelled() { + let app = XCUIApplication() + let table = app.tables + table.cells.staticTexts["1"].tap() + table.cells.element(boundBy: 0).tap() + app.navigationBars.buttons["Cancel"].tap() + + XCTAssertTrue(value) + } + + // following two don't seem to work since Xcode 8.1 + // The UI-Testing infrastructure cannot “see” the image picking UI + // And… trying to re-record by hand fails. + + func test_fulfills_with_edited_image() { + let app = XCUIApplication() + app.tables.cells.staticTexts["2"].tap() + app.tables.children(matching: .cell).element(boundBy: 1).tap() + app.collectionViews.children(matching: .cell).element(boundBy: 0).tap() + + // XCUITesting fails to tap this button, hence this test disabled + app.buttons["Choose"].tap() + + XCTAssertTrue(value) + } + + func test_fulfills_with_image() { + let app = XCUIApplication() + let tablesQuery = app.tables + tablesQuery.staticTexts["3"].tap() + tablesQuery.children(matching: .cell).element(boundBy: 1).tap() + + app.collectionViews.children(matching: .cell).element(boundBy: 0).tap() + + XCTAssertTrue(value) + } +#endif +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/app.swift b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/app.swift new file mode 100644 index 0000000..f46e008 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/UIKit/UITests/app.swift @@ -0,0 +1,100 @@ +import PromiseKit +import PMKUIKit +import UIKit + +@UIApplicationMain +class App: UITableViewController, UIApplicationDelegate { + var window: UIWindow? = UIWindow(frame: UIScreen.main.bounds) + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool { + window!.rootViewController = self + window!.backgroundColor = UIColor.purple + window!.makeKeyAndVisible() + UIView.setAnimationsEnabled(false) + return true + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return Row.count + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = UITableViewCell() + cell.textLabel?.text = Row(indexPath)?.description + return cell + } + + let testSuceededButton = UIButton() + + override func viewDidLoad() { + testSuceededButton.setTitle("unused", for: .normal) + testSuceededButton.sizeToFit() + testSuceededButton.backgroundColor = UIColor.blue + testSuceededButton.isEnabled = false + + view.addSubview(testSuceededButton) + } + + override func viewDidLayoutSubviews() { + testSuceededButton.center = view.center + } + + private func success() { + self.testSuceededButton.isEnabled = true + } + +#if !os(tvOS) + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + switch Row(indexPath)! { + case .ImagePickerCancel: + let p = promise(UIImagePickerController()) + p.catch(policy: .allErrors) { error in + guard (error as! CancellableError).isCancelled else { abort() } + self.success() + } + p.catch { error in + abort() + } + case .ImagePickerEditImage: + let picker = UIImagePickerController() + picker.allowsEditing = true + _ = promise(picker).done { _ in + self.success() + } + case .ImagePickerPickImage: + _ = promise(UIImagePickerController()).done { image in + self.success() + } + } + } +#endif +} + +enum Row: Int { + case ImagePickerCancel + case ImagePickerEditImage + case ImagePickerPickImage + + init?(_ indexPath: IndexPath) { + guard let row = Row(rawValue: indexPath.row) else { + return nil + } + self = row + } + + var indexPath: IndexPath { + return IndexPath(row: rawValue, section: 0) + } + + var description: String { + return (rawValue + 1).description + } + + static var count: Int { + var x = 0 + while Row(rawValue: x) != nil { + x += 1 + } + return x + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/.gitignore b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/.gitignore new file mode 100644 index 0000000..bec9c17 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/.gitignore @@ -0,0 +1,5 @@ +*.xcodeproj/**/xcuserdata/ +*.xcscmblueprint +/Carthage +/.build +.DS_Store \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/.travis.yml b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/.travis.yml new file mode 100644 index 0000000..3fe302b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/.travis.yml @@ -0,0 +1,39 @@ +os: osx +language: objective-c +matrix: + include: + - {osx_image: xcode8.3, env: 'PLAT=iOS SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} + - {osx_image: xcode8.3, env: 'PLAT=watchOS SWFT=3.1 DST="OS=3.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=3.2 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=3.3 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} + - {osx_image: xcode9.2, env: 'PLAT=watchOS SWFT=4.0 DST="OS=4.2,name=Apple Watch - 38mm"'} + + - {osx_image: xcode9.3, env: 'PLAT=iOS SWFT=4.1 DST="OS=9.3,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=10.3.1,name=iPhone 5s"'} + - {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} + - {osx_image: xcode9.3, env: 'PLAT=watchOS SWFT=4.1 DST="OS=2.2,name=Apple Watch - 38mm"'} + - {osx_image: xcode9.3, env: 'PLAT=watchOS SWFT=4.1 DST="OS=3.2,name=Apple Watch - 38mm"'} + - {osx_image: xcode9.4, env: 'PLAT=watchOS SWFT=4.1 DST="OS=4.3,name=Apple Watch - 38mm"'} + + - {osx_image: xcode10, env: 'PLAT=iOS SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} + - {osx_image: xcode10, env: 'PLAT=watchOS SWFT=4.2 DST="OS=5.0,name=Apple Watch Series 3 - 42mm"'} +cache: + directories: + - Carthage +before_install: + - carthage bootstrap --cache-builds --no-use-binaries --platform $PLAT --verbose +install: + - xcodebuild -scheme PMKWatchConnectivity -target PMKWatchConnectivity -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build + - if [ "$TEST" == "1" ]; then + xcodebuild -scheme PMKWatchConnectivity -target PMKWCTests -quiet -destination "$DST" build; + fi +script: + - if [ "$TEST" == "1" ]; then + xcodebuild -scheme PMKWatchConnectivity -quiet -destination "$DST" test; + fi diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Cartfile b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Cartfile new file mode 100644 index 0000000..2bfea98 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Cartfile @@ -0,0 +1 @@ +github "mxcl/PromiseKit" ~> 6.0 diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Cartfile.resolved b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Cartfile.resolved new file mode 100644 index 0000000..a1be206 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Cartfile.resolved @@ -0,0 +1 @@ +github "mxcl/PromiseKit" "6.3.3" diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Carthage.xcconfig b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Carthage.xcconfig new file mode 100644 index 0000000..c8b9956 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Carthage.xcconfig @@ -0,0 +1,7 @@ +// Created by Kevin Ballard on 12/14/15. +// Copyright © 2015 Postmates. All rights reserved. + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Info.plist b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e9f6916 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.pbxproj @@ -0,0 +1,447 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6384FB811D5D4F6D00453755 /* WCSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6384FB801D5D4F6D00453755 /* WCSession+Promise.swift */; }; + 6384FB831D5D4F8B00453755 /* TestWatchConnectivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6384FB821D5D4F8B00453755 /* TestWatchConnectivity.swift */; }; + 63C7FFF71D5C020D003BAE60 /* PMKWatchConnectivity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C7FFA71D5BEE09003BAE60 /* PMKWatchConnectivity.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 63C7FF9E1D5BEE09003BAE60 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63C7FFA61D5BEE09003BAE60; + remoteInfo = PMKWatchConnectivity; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6384FB801D5D4F6D00453755 /* WCSession+Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "WCSession+Promise.swift"; path = "Sources/WCSession+Promise.swift"; sourceTree = SOURCE_ROOT; }; + 6384FB821D5D4F8B00453755 /* TestWatchConnectivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestWatchConnectivity.swift; path = Tests/TestWatchConnectivity.swift; sourceTree = SOURCE_ROOT; }; + 63C700091D5C0253003BAE60 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 63C7FFA71D5BEE09003BAE60 /* PMKWatchConnectivity.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PMKWatchConnectivity.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63C7FFF21D5C020D003BAE60 /* PMKWCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKWCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 63CCF8121D5C0C4E00503216 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 63C7FFA31D5BEE09003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEF1D5C020D003BAE60 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 63C7FFF71D5C020D003BAE60 /* PMKWatchConnectivity.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 63C7FF9D1D5BEE09003BAE60 = { + isa = PBXGroup; + children = ( + 63C700091D5C0253003BAE60 /* Info.plist */, + 63CCF8121D5C0C4E00503216 /* Cartfile */, + 63CCF8171D5C11B500503216 /* Carthage.xcconfig */, + 63C7FFA91D5BEE09003BAE60 /* Sources */, + 63C7FFF31D5C020D003BAE60 /* Tests */, + 63C7FFA81D5BEE09003BAE60 /* Products */, + ); + sourceTree = ""; + }; + 63C7FFA81D5BEE09003BAE60 /* Products */ = { + isa = PBXGroup; + children = ( + 63C7FFA71D5BEE09003BAE60 /* PMKWatchConnectivity.framework */, + 63C7FFF21D5C020D003BAE60 /* PMKWCTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63C7FFA91D5BEE09003BAE60 /* Sources */ = { + isa = PBXGroup; + children = ( + 6384FB801D5D4F6D00453755 /* WCSession+Promise.swift */, + ); + path = Sources; + sourceTree = SOURCE_ROOT; + }; + 63C7FFF31D5C020D003BAE60 /* Tests */ = { + isa = PBXGroup; + children = ( + 6384FB821D5D4F8B00453755 /* TestWatchConnectivity.swift */, + ); + path = Tests; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63C7FFA41D5BEE09003BAE60 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 63C7FFA61D5BEE09003BAE60 /* PMKWatchConnectivity */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKWatchConnectivity" */; + buildPhases = ( + 63C7FFA21D5BEE09003BAE60 /* Sources */, + 63C7FFA31D5BEE09003BAE60 /* Frameworks */, + 63C7FFA41D5BEE09003BAE60 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PMKWatchConnectivity; + productName = "PMK+UIKit"; + productReference = 63C7FFA71D5BEE09003BAE60 /* PMKWatchConnectivity.framework */; + productType = "com.apple.product-type.framework"; + }; + 63C7FFF11D5C020D003BAE60 /* PMKWCTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKWCTests" */; + buildPhases = ( + 63C7FFEE1D5C020D003BAE60 /* Sources */, + 63C7FFEF1D5C020D003BAE60 /* Frameworks */, + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */, + ); + name = PMKWCTests; + productName = PMKTests/NS; + productReference = 63C7FFF21D5C020D003BAE60 /* PMKWCTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 63C7FF9E1D5BEE09003BAE60 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Max Howell"; + TargetAttributes = { + 63C7FFA61D5BEE09003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + 63C7FFF11D5C020D003BAE60 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0900; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKWatchConnectivity" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 63C7FF9D1D5BEE09003BAE60; + productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63C7FFA61D5BEE09003BAE60 /* PMKWatchConnectivity */, + 63C7FFF11D5C020D003BAE60 /* PMKWCTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 639447051D5D011300DDAE3C /* Embed Carthage Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + PromiseKit, + ); + name = "Embed Carthage Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 63C7FFA21D5BEE09003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6384FB811D5D4F6D00453755 /* WCSession+Promise.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63C7FFEE1D5C020D003BAE60 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6384FB831D5D4F8B00453755 /* TestWatchConnectivity.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 63C7FFF91D5C020D003BAE60 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63C7FFA61D5BEE09003BAE60 /* PMKWatchConnectivity */; + targetProxy = 63C7FFF81D5C020D003BAE60 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 63C7FFAD1D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 63C7FFAE1D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 63CCF8171D5C11B500503216 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchsimulator watchos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63C7FFB01D5BEE09003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 63C7FFB11D5BEE09003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_MODULE_NAME = "${TARGET_NAME}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 63C7FFFB1D5C020D003BAE60 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 63C7FFFC1D5C020D003BAE60 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKWatchConnectivity" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFAD1D5BEE09003BAE60 /* Debug */, + 63C7FFAE1D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFAF1D5BEE09003BAE60 /* Build configuration list for PBXNativeTarget "PMKWatchConnectivity" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFB01D5BEE09003BAE60 /* Debug */, + 63C7FFB11D5BEE09003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63C7FFFA1D5C020D003BAE60 /* Build configuration list for PBXNativeTarget "PMKWCTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63C7FFFB1D5C020D003BAE60 /* Debug */, + 63C7FFFC1D5C020D003BAE60 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 63C7FF9E1D5BEE09003BAE60 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b49fefe --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/xcshareddata/xcschemes/PMKWatchConnectivity.xcscheme b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/xcshareddata/xcschemes/PMKWatchConnectivity.xcscheme new file mode 100644 index 0000000..2b4c6a6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/PMKWatchConnectivity.xcodeproj/xcshareddata/xcschemes/PMKWatchConnectivity.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/README.markdown b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/README.markdown new file mode 100644 index 0000000..069026f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/README.markdown @@ -0,0 +1,34 @@ +# PromiseKit WatchConnectivity Extensions ![Build Status] + +This project adds promises to Apple’s WatchConnectivity framework. + +## CocoaPods + +```ruby +pod "PromiseKit/WatchConnectivity" ~> 6.0 +``` + +The extensions are built into `PromiseKit.framework` thus nothing else is needed. + +## Carthage + +```ruby +github "PromiseKit/WatchConnectivity" ~> 3.0 +``` + +The extensions are built into their own framework: + +```swift +// swift +import PromiseKit +import PMKWatchConnectivity +``` + +```objc +// objc +@import PromiseKit; +@import PMKWatchConnectivity; +``` + + +[Build Status]: https://travis-ci.org/PromiseKit/WatchConnectivity.svg?branch=master diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Sources/WCSession+Promise.swift b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Sources/WCSession+Promise.swift new file mode 100644 index 0000000..934d51b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Sources/WCSession+Promise.swift @@ -0,0 +1,21 @@ +import WatchConnectivity +import Foundation +#if !PMKCocoaPods +import PromiseKit +#endif + + +@available(iOS 9.0, *) +@available(iOSApplicationExtension 9.0, *) +extension WCSession { + + /// Sends a message immediately to the paired and active device and optionally handles a response. + public func sendMessage(_ message: [String: Any]) -> Promise<[String: Any]> { + return Promise { sendMessage(message, replyHandler: $0.fulfill, errorHandler: $0.reject) } + } + + /// Sends a data object immediately to the paired and active device and optionally handles a response. + public func sendMessageData(_ data: Data) -> Promise { + return Promise { sendMessageData(data, replyHandler: $0.fulfill, errorHandler: $0.reject) } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Tests/TestWatchConnectivity.swift b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Tests/TestWatchConnectivity.swift new file mode 100644 index 0000000..d19635e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Extensions/WatchConnectivity/Tests/TestWatchConnectivity.swift @@ -0,0 +1,52 @@ +import PMKWatchConnectivity +import WatchConnectivity +import PromiseKit +import XCTest + +class WatchConnectivityTests: XCTestCase { + class MockSession: WCSession { + + var fail = false + + override func sendMessage(_ message: [String : Any], replyHandler: (([String : Any]) -> Void)?, errorHandler: ((Error) -> Void)?) { + if fail { + errorHandler?(NSError(domain: "Test", code: 1, userInfo: [:])) + } else { + replyHandler?(["response": "Success"]) + } + } + } + + func testSuccess() { + + let ex = expectation(description: "Success callback") + let session = MockSession.default as! MockSession + session.fail = false + session.sendMessage(["message": "test"]).done { response in + XCTAssertEqual(response as! [String: String], ["response": "Success"]) + ex.fulfill() + }.catch { _ in + XCTFail("Should not fail") + } + waitForExpectations(timeout: 1, handler: nil) + } + + func testFailure() { + class MockFailSession: WCSession { + override func sendMessage(_ message: [String : Any], replyHandler: (([String : Any]) -> Void)?, errorHandler: ((Error) -> Void)?) { + errorHandler?(NSError(domain: "Test", code: 1, userInfo: [:])) + } + } + + let ex = expectation(description: "Error callback") + let session = MockSession.default as! MockSession + session.fail = true + session.sendMessage(["message": "test"]).done { response in + XCTFail("Should not succeed") + }.catch { error in + XCTAssertEqual((error as NSError).domain, "Test") + ex.fulfill() + } + waitForExpectations(timeout: 1, handler: nil) + } +} diff --git a/Carthage/Checkouts/PromiseKit/LICENSE b/Carthage/Checkouts/PromiseKit/LICENSE new file mode 100644 index 0000000..50f758c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/LICENSE @@ -0,0 +1,20 @@ +Copyright 2016-present, Max Howell; mxcl@me.com + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Carthage/Checkouts/PromiseKit/Package.swift b/Carthage/Checkouts/PromiseKit/Package.swift new file mode 100644 index 0000000..76b5160 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Package.swift @@ -0,0 +1,30 @@ +// swift-tools-version:4.0 + +import PackageDescription + +let pkg = Package(name: "PromiseKit") +pkg.products = [ + .library(name: "PromiseKit", targets: ["PromiseKit"]), +] + +let pmk: Target = .target(name: "PromiseKit") +pmk.path = "Sources" +pmk.exclude = [ + "AnyPromise.swift", + "AnyPromise.m", + "PMKCallVariadicBlock.m", + "dispatch_promise.m", + "join.m", + "when.m", + "NSMethodSignatureForBlock.m", + "after.m", + "hang.m", + "race.m", + "Deprecations.swift" +] +pkg.swiftLanguageVersions = [3, 4] +pkg.targets = [ + pmk, + .testTarget(name: "A+", dependencies: ["PromiseKit"]), + .testTarget(name: "CorePromise", dependencies: ["PromiseKit"], path: "Tests/CorePromise"), +] diff --git a/Carthage/Checkouts/PromiseKit/Package@swift-4.2.swift b/Carthage/Checkouts/PromiseKit/Package@swift-4.2.swift new file mode 100644 index 0000000..7edd550 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Package@swift-4.2.swift @@ -0,0 +1,30 @@ +// swift-tools-version:4.2 + +import PackageDescription + +let pkg = Package(name: "PromiseKit") +pkg.products = [ + .library(name: "PromiseKit", targets: ["PromiseKit"]), +] + +let pmk: Target = .target(name: "PromiseKit") +pmk.path = "Sources" +pmk.exclude = [ + "AnyPromise.swift", + "AnyPromise.m", + "PMKCallVariadicBlock.m", + "dispatch_promise.m", + "join.m", + "when.m", + "NSMethodSignatureForBlock.m", + "after.m", + "hang.m", + "race.m", + "Deprecations.swift" +] +pkg.swiftLanguageVersions = [.v3, .v4, .v4_2] +pkg.targets = [ + pmk, + .testTarget(name: "A+", dependencies: ["PromiseKit"]), + .testTarget(name: "CorePromise", dependencies: ["PromiseKit"], path: "Tests/CorePromise"), +] diff --git a/Carthage/Checkouts/PromiseKit/PromiseKit.playground/Contents.swift b/Carthage/Checkouts/PromiseKit/PromiseKit.playground/Contents.swift new file mode 100644 index 0000000..3ade47e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/PromiseKit.playground/Contents.swift @@ -0,0 +1,27 @@ +import PlaygroundSupport + +// Is this erroring? If so open the `.xcodeproj` and build the +// framework for a macOS target (usually labeled: “My Mac”). +// Then select `PromiseKit.playground` from inside Xcode. +import PromiseKit + + +func promise3() -> Promise { + return after(.seconds(1)).map{ 3 } +} + +firstly { + Promise.value(1) +}.map { _ in + 2 +}.then { _ in + promise3() +}.done { + print($0) // => 3 +}.catch { error in + // only happens for errors +}.finally { + PlaygroundPage.current.finishExecution() +} + +PlaygroundPage.current.needsIndefiniteExecution = true diff --git a/Carthage/Checkouts/PromiseKit/PromiseKit.playground/contents.xcplayground b/Carthage/Checkouts/PromiseKit/PromiseKit.playground/contents.xcplayground new file mode 100644 index 0000000..e6f5039 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/PromiseKit.playground/contents.xcplayground @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Carthage/Checkouts/PromiseKit/PromiseKit.playground/playground.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/PromiseKit.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/PromiseKit.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.pbxproj b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3bb9d21 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.pbxproj @@ -0,0 +1,1225 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0C42F31B1FCF86320051309C /* HangTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C42F3191FCF86240051309C /* HangTests.swift */; }; + 0CC3AF2B1FCF84F7000E98C9 /* hang.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CC3AF2A1FCF84F7000E98C9 /* hang.swift */; }; + 49A5584D1DC5185900E4D01B /* ResolverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A5584B1DC5172F00E4D01B /* ResolverTests.swift */; }; + 630A8056203CEF6800D25F23 /* AnyPromiseTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 630A8051203CEF6800D25F23 /* AnyPromiseTests.m */; settings = {COMPILER_FLAGS = "-fobjc-arc-exceptions"; }; }; + 630A8057203CEF6800D25F23 /* PMKManifoldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 630A8052203CEF6800D25F23 /* PMKManifoldTests.m */; }; + 630A8058203CEF6800D25F23 /* JoinTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 630A8053203CEF6800D25F23 /* JoinTests.m */; }; + 630A8059203CEF6800D25F23 /* HangTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 630A8054203CEF6800D25F23 /* HangTests.m */; }; + 630A805A203CEF6800D25F23 /* WhenTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 630A8055203CEF6800D25F23 /* WhenTests.m */; }; + 630A805B203CF67800D25F23 /* DefaultDispatchQueueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D641B1D59635300BC0AF5 /* DefaultDispatchQueueTests.swift */; }; + 631411381D59795700E24B9E /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B0AC571D595E1B00FA21D9 /* PromiseKit.framework */; }; + 631411431D59797100E24B9E /* BridgingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6314113E1D59797100E24B9E /* BridgingTests.m */; }; + 631411441D59797100E24B9E /* BridgingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6314113F1D59797100E24B9E /* BridgingTests.swift */; }; + 631411451D59797100E24B9E /* Infrastructure.m in Sources */ = {isa = PBXBuildFile; fileRef = 631411411D59797100E24B9E /* Infrastructure.m */; }; + 631411461D59797100E24B9E /* Infrastructure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631411421D59797100E24B9E /* Infrastructure.swift */; }; + 631751A41D59766500A9DDDC /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B0AC571D595E1B00FA21D9 /* PromiseKit.framework */; }; + 631751B71D59768200A9DDDC /* 0.0.0.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751AB1D59768200A9DDDC /* 0.0.0.swift */; }; + 631751B81D59768200A9DDDC /* 2.1.2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751AC1D59768200A9DDDC /* 2.1.2.swift */; }; + 631751B91D59768200A9DDDC /* 2.1.3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751AD1D59768200A9DDDC /* 2.1.3.swift */; }; + 631751BA1D59768200A9DDDC /* 2.2.2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751AE1D59768200A9DDDC /* 2.2.2.swift */; }; + 631751BB1D59768200A9DDDC /* 2.2.3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751AF1D59768200A9DDDC /* 2.2.3.swift */; }; + 631751BC1D59768200A9DDDC /* 2.2.4.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751B01D59768200A9DDDC /* 2.2.4.swift */; }; + 631751BD1D59768200A9DDDC /* 2.2.6.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751B11D59768200A9DDDC /* 2.2.6.swift */; }; + 631751BE1D59768200A9DDDC /* 2.2.7.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751B21D59768200A9DDDC /* 2.2.7.swift */; }; + 631751BF1D59768200A9DDDC /* 2.3.1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751B31D59768200A9DDDC /* 2.3.1.swift */; }; + 631751C01D59768200A9DDDC /* 2.3.2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751B41D59768200A9DDDC /* 2.3.2.swift */; }; + 631751C11D59768200A9DDDC /* 2.3.4.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631751B51D59768200A9DDDC /* 2.3.4.swift */; }; + 632FBBE31F33B273008F8FBB /* Catchable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632FBBE21F33B273008F8FBB /* Catchable.swift */; }; + 632FBBE51F33B338008F8FBB /* CatchableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 632FBBE41F33B338008F8FBB /* CatchableTests.swift */; }; + 633027E6203CC0060037E136 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B0AC571D595E1B00FA21D9 /* PromiseKit.framework */; }; + 6330B5E11F2E991200D60528 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6330B5E01F2E991200D60528 /* Configuration.swift */; }; + 634AAD2B1EAE517C00B17855 /* fwd.h in Headers */ = {isa = PBXBuildFile; fileRef = 634AAD2A1EAE517C00B17855 /* fwd.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 635D641D1D59635300BC0AF5 /* PromiseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D64081D59635300BC0AF5 /* PromiseTests.swift */; }; + 635D641E1D59635300BC0AF5 /* CancellableErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D64091D59635300BC0AF5 /* CancellableErrorTests.swift */; }; + 635D64221D59635300BC0AF5 /* ZalgoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D640D1D59635300BC0AF5 /* ZalgoTests.swift */; }; + 635D64231D59635300BC0AF5 /* AfterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D640E1D59635300BC0AF5 /* AfterTests.swift */; }; + 635D64261D59635300BC0AF5 /* WhenResolvedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D64111D59635300BC0AF5 /* WhenResolvedTests.swift */; }; + 635D64271D59635300BC0AF5 /* RaceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D64121D59635300BC0AF5 /* RaceTests.swift */; }; + 635D64281D59635300BC0AF5 /* WhenConcurrentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D64131D59635300BC0AF5 /* WhenConcurrentTests.swift */; }; + 635D642A1D59635300BC0AF5 /* WhenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D64151D59635300BC0AF5 /* WhenTests.swift */; }; + 635D642B1D59635300BC0AF5 /* StressTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D64161D59635300BC0AF5 /* StressTests.swift */; }; + 635D642C1D59635300BC0AF5 /* RegressionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635D64171D59635300BC0AF5 /* RegressionTests.swift */; }; + 635D64301D596E8500BC0AF5 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B0AC571D595E1B00FA21D9 /* PromiseKit.framework */; }; + 636A291A1F1C156B001229C2 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 636A29191F1C156B001229C2 /* Promise.swift */; }; + 636A291F1F1C16FF001229C2 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = 636A291E1F1C16FF001229C2 /* Box.swift */; }; + 636A29211F1C1716001229C2 /* Thenable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 636A29201F1C1716001229C2 /* Thenable.swift */; }; + 636A29231F1C17A6001229C2 /* Guarantee.swift in Sources */ = {isa = PBXBuildFile; fileRef = 636A29221F1C17A6001229C2 /* Guarantee.swift */; }; + 636A29251F1C3089001229C2 /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 636A29241F1C3089001229C2 /* race.swift */; }; + 636A29271F1C3927001229C2 /* Resolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 636A29261F1C3927001229C2 /* Resolver.swift */; }; + 639BF757203DF03100FA577B /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639BF755203DF02C00FA577B /* Utilities.swift */; }; + 63B0AC7F1D595E6300FA21D9 /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC611D595E6300FA21D9 /* after.m */; }; + 63B0AC801D595E6300FA21D9 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC621D595E6300FA21D9 /* after.swift */; }; + 63B0AC811D595E6300FA21D9 /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 63B0AC631D595E6300FA21D9 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63B0AC821D595E6300FA21D9 /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC641D595E6300FA21D9 /* AnyPromise.m */; }; + 63B0AC831D595E6300FA21D9 /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC651D595E6300FA21D9 /* AnyPromise.swift */; }; + 63B0AC841D595E6300FA21D9 /* AnyPromise+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 63B0AC661D595E6300FA21D9 /* AnyPromise+Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 63B0AC851D595E6300FA21D9 /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC671D595E6300FA21D9 /* dispatch_promise.m */; }; + 63B0AC871D595E6300FA21D9 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC691D595E6300FA21D9 /* Error.swift */; }; + 63B0AC891D595E6300FA21D9 /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC6B1D595E6300FA21D9 /* hang.m */; }; + 63B0AC8B1D595E6300FA21D9 /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC6D1D595E6300FA21D9 /* join.m */; }; + 63B0AC931D595E6300FA21D9 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 63B0AC761D595E6300FA21D9 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 63B0AC991D595E6300FA21D9 /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC7C1D595E6300FA21D9 /* when.m */; }; + 63B0AC9A1D595E6300FA21D9 /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B0AC7D1D595E6300FA21D9 /* when.swift */; }; + 63B18AEC1F2D205C00B79E37 /* CustomStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B18AEB1F2D205C00B79E37 /* CustomStringConvertible.swift */; }; + 63B7C94B203E2B8200FBEC00 /* AnyPromiseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B7C94A203E2B8200FBEC00 /* AnyPromiseTests.swift */; }; + 63B912AA1F1D7B1300D49110 /* firstly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63B912A91F1D7B1300D49110 /* firstly.swift */; }; + 63CF6D7A203CC66000EC8927 /* ErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63CF6D79203CC66000EC8927 /* ErrorTests.swift */; }; + 63CF6D7C203CCDAB00EC8927 /* GuaranteeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63CF6D7B203CCDAB00EC8927 /* GuaranteeTests.swift */; }; + 63CF6D7E203CD12700EC8927 /* DeprecationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63648C94203CB97400EBA011 /* DeprecationTests.swift */; }; + 63CF6D80203CD19200EC8927 /* ThenableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63CF6D7F203CD19200EC8927 /* ThenableTests.swift */; }; + 63D9B2EF203385FD0075C00B /* race.m in Sources */ = {isa = PBXBuildFile; fileRef = 63D9B2EE203385FD0075C00B /* race.m */; }; + 63D9B2F120338D5D0075C00B /* Deprecations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D9B2F020338D5D0075C00B /* Deprecations.swift */; }; + C013F7382048E3B6006B57B1 /* MockNodeEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = C013F7372048E3B6006B57B1 /* MockNodeEnvironment.swift */; }; + C013F73A2049076A006B57B1 /* JSPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = C013F7392049076A006B57B1 /* JSPromise.swift */; }; + C013F73C20494291006B57B1 /* JSAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C013F73B20494291006B57B1 /* JSAdapter.swift */; }; + C013F740204E5064006B57B1 /* JSUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = C013F73F204E5063006B57B1 /* JSUtils.swift */; }; + C0244E5E2047A6CB00ACB4AC /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B0AC571D595E1B00FA21D9 /* PromiseKit.framework */; }; + C0244E692047AC9F00ACB4AC /* AllTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0244E682047AC9F00ACB4AC /* AllTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 631411341D59795700E24B9E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6399A3721D595D9100D65233 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63B0AC561D595E1B00FA21D9; + remoteInfo = PromiseKit; + }; + 6317518D1D59766500A9DDDC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6399A3721D595D9100D65233 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63B0AC561D595E1B00FA21D9; + remoteInfo = PromiseKit; + }; + 633027E2203CC0060037E136 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6399A3721D595D9100D65233 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63B0AC561D595E1B00FA21D9; + remoteInfo = PromiseKit; + }; + 635D64041D5962F900BC0AF5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6399A3721D595D9100D65233 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63B0AC561D595E1B00FA21D9; + remoteInfo = PromiseKit; + }; + C0244E502047A6CB00ACB4AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6399A3721D595D9100D65233 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 63B0AC561D595E1B00FA21D9; + remoteInfo = PromiseKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + C0244E6E2047AF0B00ACB4AC /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 7; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0C42F3191FCF86240051309C /* HangTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HangTests.swift; sourceTree = ""; }; + 0CC3AF2A1FCF84F7000E98C9 /* hang.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = hang.swift; path = Sources/hang.swift; sourceTree = ""; }; + 49A5584B1DC5172F00E4D01B /* ResolverTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResolverTests.swift; sourceTree = ""; }; + 630019221D596292003B4E30 /* PMKCoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKCoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 630A8051203CEF6800D25F23 /* AnyPromiseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnyPromiseTests.m; sourceTree = ""; }; + 630A8052203CEF6800D25F23 /* PMKManifoldTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PMKManifoldTests.m; sourceTree = ""; }; + 630A8053203CEF6800D25F23 /* JoinTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JoinTests.m; sourceTree = ""; }; + 630A8054203CEF6800D25F23 /* HangTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HangTests.m; sourceTree = ""; }; + 630A8055203CEF6800D25F23 /* WhenTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WhenTests.m; sourceTree = ""; }; + 6314113C1D59795700E24B9E /* PMKBridgeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKBridgeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6314113E1D59797100E24B9E /* BridgingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BridgingTests.m; sourceTree = ""; }; + 6314113F1D59797100E24B9E /* BridgingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BridgingTests.swift; sourceTree = ""; }; + 631411401D59797100E24B9E /* Infrastructure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Infrastructure.h; sourceTree = ""; }; + 631411411D59797100E24B9E /* Infrastructure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Infrastructure.m; sourceTree = ""; }; + 631411421D59797100E24B9E /* Infrastructure.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Infrastructure.swift; sourceTree = ""; }; + 631751A81D59766500A9DDDC /* PMKA+Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PMKA+Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 631751AB1D59768200A9DDDC /* 0.0.0.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 0.0.0.swift; sourceTree = ""; }; + 631751AC1D59768200A9DDDC /* 2.1.2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.1.2.swift; sourceTree = ""; }; + 631751AD1D59768200A9DDDC /* 2.1.3.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.1.3.swift; sourceTree = ""; }; + 631751AE1D59768200A9DDDC /* 2.2.2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.2.2.swift; sourceTree = ""; }; + 631751AF1D59768200A9DDDC /* 2.2.3.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.2.3.swift; sourceTree = ""; }; + 631751B01D59768200A9DDDC /* 2.2.4.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.2.4.swift; sourceTree = ""; }; + 631751B11D59768200A9DDDC /* 2.2.6.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.2.6.swift; sourceTree = ""; }; + 631751B21D59768200A9DDDC /* 2.2.7.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.2.7.swift; sourceTree = ""; }; + 631751B31D59768200A9DDDC /* 2.3.1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.3.1.swift; sourceTree = ""; }; + 631751B41D59768200A9DDDC /* 2.3.2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.3.2.swift; sourceTree = ""; }; + 631751B51D59768200A9DDDC /* 2.3.4.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = 2.3.4.swift; sourceTree = ""; }; + 631751B61D59768200A9DDDC /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 632FBBE21F33B273008F8FBB /* Catchable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Catchable.swift; path = Sources/Catchable.swift; sourceTree = ""; }; + 632FBBE41F33B338008F8FBB /* CatchableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CatchableTests.swift; sourceTree = ""; }; + 633027EA203CC0060037E136 /* PMKDeprecatedTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PMKDeprecatedTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6330B5E01F2E991200D60528 /* Configuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = Sources/Configuration.swift; sourceTree = ""; }; + 634AAD2A1EAE517C00B17855 /* fwd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fwd.h; path = Sources/fwd.h; sourceTree = ""; }; + 635893921D5BE4E000F14B55 /* PromiseKit.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = PromiseKit.playground; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + 635893941D5BE4F900F14B55 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + 635893951D5BE4F900F14B55 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; + 635893961D5BE4F900F14B55 /* PromiseKit.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = PromiseKit.podspec; path = .github/PromiseKit.podspec; sourceTree = ""; }; + 635893971D5BE4F900F14B55 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 635D64081D59635300BC0AF5 /* PromiseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PromiseTests.swift; sourceTree = ""; }; + 635D64091D59635300BC0AF5 /* CancellableErrorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CancellableErrorTests.swift; sourceTree = ""; }; + 635D640D1D59635300BC0AF5 /* ZalgoTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZalgoTests.swift; sourceTree = ""; }; + 635D640E1D59635300BC0AF5 /* AfterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AfterTests.swift; sourceTree = ""; }; + 635D64111D59635300BC0AF5 /* WhenResolvedTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WhenResolvedTests.swift; sourceTree = ""; }; + 635D64121D59635300BC0AF5 /* RaceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RaceTests.swift; sourceTree = ""; }; + 635D64131D59635300BC0AF5 /* WhenConcurrentTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WhenConcurrentTests.swift; sourceTree = ""; }; + 635D64151D59635300BC0AF5 /* WhenTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WhenTests.swift; sourceTree = ""; }; + 635D64161D59635300BC0AF5 /* StressTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StressTests.swift; sourceTree = ""; }; + 635D64171D59635300BC0AF5 /* RegressionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegressionTests.swift; sourceTree = ""; }; + 635D641B1D59635300BC0AF5 /* DefaultDispatchQueueTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultDispatchQueueTests.swift; sourceTree = ""; }; + 63648C94203CB97400EBA011 /* DeprecationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = DeprecationTests.swift; path = Tests/DeprecationTests.swift; sourceTree = ""; }; + 636A29191F1C156B001229C2 /* Promise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; + 636A291E1F1C16FF001229C2 /* Box.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Box.swift; path = Sources/Box.swift; sourceTree = ""; }; + 636A29201F1C1716001229C2 /* Thenable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Thenable.swift; path = Sources/Thenable.swift; sourceTree = ""; }; + 636A29221F1C17A6001229C2 /* Guarantee.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Guarantee.swift; path = Sources/Guarantee.swift; sourceTree = ""; }; + 636A29241F1C3089001229C2 /* race.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; + 636A29261F1C3927001229C2 /* Resolver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Resolver.swift; path = Sources/Resolver.swift; sourceTree = ""; }; + 639BF755203DF02C00FA577B /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; + 63B0AC571D595E1B00FA21D9 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 63B0AC611D595E6300FA21D9 /* after.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; + 63B0AC621D595E6300FA21D9 /* after.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; + 63B0AC631D595E6300FA21D9 /* AnyPromise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; + 63B0AC641D595E6300FA21D9 /* AnyPromise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; + 63B0AC651D595E6300FA21D9 /* AnyPromise.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; + 63B0AC661D595E6300FA21D9 /* AnyPromise+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AnyPromise+Private.h"; path = "Sources/AnyPromise+Private.h"; sourceTree = ""; }; + 63B0AC671D595E6300FA21D9 /* dispatch_promise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; + 63B0AC691D595E6300FA21D9 /* Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; + 63B0AC6B1D595E6300FA21D9 /* hang.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; + 63B0AC6C1D595E6300FA21D9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Sources/Info.plist; sourceTree = ""; }; + 63B0AC6D1D595E6300FA21D9 /* join.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; + 63B0AC6F1D595E6300FA21D9 /* NSMethodSignatureForBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSMethodSignatureForBlock.m; path = Sources/NSMethodSignatureForBlock.m; sourceTree = ""; }; + 63B0AC711D595E6300FA21D9 /* PMKCallVariadicBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PMKCallVariadicBlock.m; path = Sources/PMKCallVariadicBlock.m; sourceTree = ""; }; + 63B0AC761D595E6300FA21D9 /* PromiseKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; }; + 63B0AC7C1D595E6300FA21D9 /* when.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; + 63B0AC7D1D595E6300FA21D9 /* when.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; + 63B18AEB1F2D205C00B79E37 /* CustomStringConvertible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CustomStringConvertible.swift; path = Sources/CustomStringConvertible.swift; sourceTree = ""; }; + 63B7C94A203E2B8200FBEC00 /* AnyPromiseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnyPromiseTests.swift; sourceTree = ""; }; + 63B912A91F1D7B1300D49110 /* firstly.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = firstly.swift; path = Sources/firstly.swift; sourceTree = ""; }; + 63CF6D79203CC66000EC8927 /* ErrorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorTests.swift; sourceTree = ""; }; + 63CF6D7B203CCDAB00EC8927 /* GuaranteeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuaranteeTests.swift; sourceTree = ""; }; + 63CF6D7F203CD19200EC8927 /* ThenableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThenableTests.swift; sourceTree = ""; }; + 63D9B2EE203385FD0075C00B /* race.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = race.m; path = Sources/race.m; sourceTree = ""; }; + 63D9B2F020338D5D0075C00B /* Deprecations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Deprecations.swift; path = Sources/Deprecations.swift; sourceTree = ""; }; + C013F7372048E3B6006B57B1 /* MockNodeEnvironment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MockNodeEnvironment.swift; path = "Tests/JS-A+/MockNodeEnvironment.swift"; sourceTree = ""; }; + C013F7392049076A006B57B1 /* JSPromise.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = JSPromise.swift; path = "Tests/JS-A+/JSPromise.swift"; sourceTree = ""; }; + C013F73B20494291006B57B1 /* JSAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = JSAdapter.swift; path = "Tests/JS-A+/JSAdapter.swift"; sourceTree = ""; }; + C013F73F204E5063006B57B1 /* JSUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = JSUtils.swift; path = "Tests/JS-A+/JSUtils.swift"; sourceTree = ""; }; + C0244E622047A6CB00ACB4AC /* PMKJSA+Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PMKJSA+Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + C0244E682047AC9F00ACB4AC /* AllTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AllTests.swift; path = "Tests/JS-A+/AllTests.swift"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 630019181D596292003B4E30 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 635D64301D596E8500BC0AF5 /* PromiseKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 631411371D59795700E24B9E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 631411381D59795700E24B9E /* PromiseKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 631751A31D59766500A9DDDC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 631751A41D59766500A9DDDC /* PromiseKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 633027E5203CC0060037E136 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 633027E6203CC0060037E136 /* PromiseKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63B0AC531D595E1B00FA21D9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C0244E5D2047A6CB00ACB4AC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C0244E5E2047A6CB00ACB4AC /* PromiseKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 630A8050203CEF6800D25F23 /* CoreObjC */ = { + isa = PBXGroup; + children = ( + 630A8051203CEF6800D25F23 /* AnyPromiseTests.m */, + 63B7C94A203E2B8200FBEC00 /* AnyPromiseTests.swift */, + 630A8052203CEF6800D25F23 /* PMKManifoldTests.m */, + 630A8053203CEF6800D25F23 /* JoinTests.m */, + 630A8054203CEF6800D25F23 /* HangTests.m */, + 630A8055203CEF6800D25F23 /* WhenTests.m */, + ); + name = CoreObjC; + path = Tests/CoreObjC; + sourceTree = ""; + }; + 630B60BF1F2F739E00A1AEFE /* Features */ = { + isa = PBXGroup; + children = ( + 63B0AC611D595E6300FA21D9 /* after.m */, + 63B0AC6B1D595E6300FA21D9 /* hang.m */, + 63B0AC6D1D595E6300FA21D9 /* join.m */, + 63B0AC7C1D595E6300FA21D9 /* when.m */, + 63D9B2EE203385FD0075C00B /* race.m */, + ); + name = Features; + sourceTree = ""; + }; + 630B60C01F2F73B000A1AEFE /* Headers */ = { + isa = PBXGroup; + children = ( + 634AAD2A1EAE517C00B17855 /* fwd.h */, + 63B0AC631D595E6300FA21D9 /* AnyPromise.h */, + ); + name = Headers; + sourceTree = ""; + }; + 6314113D1D59797100E24B9E /* Bridging */ = { + isa = PBXGroup; + children = ( + 6314113E1D59797100E24B9E /* BridgingTests.m */, + 6314113F1D59797100E24B9E /* BridgingTests.swift */, + 631411401D59797100E24B9E /* Infrastructure.h */, + 631411411D59797100E24B9E /* Infrastructure.m */, + 631411421D59797100E24B9E /* Infrastructure.swift */, + ); + name = Bridging; + path = Tests/Bridging; + sourceTree = ""; + }; + 6317518A1D59765700A9DDDC /* Core */ = { + isa = PBXGroup; + children = ( + 63CF6D7F203CD19200EC8927 /* ThenableTests.swift */, + 632FBBE41F33B338008F8FBB /* CatchableTests.swift */, + 635D64081D59635300BC0AF5 /* PromiseTests.swift */, + 49A5584B1DC5172F00E4D01B /* ResolverTests.swift */, + 63CF6D7B203CCDAB00EC8927 /* GuaranteeTests.swift */, + 635D64091D59635300BC0AF5 /* CancellableErrorTests.swift */, + 63CF6D79203CC66000EC8927 /* ErrorTests.swift */, + 635D64151D59635300BC0AF5 /* WhenTests.swift */, + 635D64131D59635300BC0AF5 /* WhenConcurrentTests.swift */, + 635D64111D59635300BC0AF5 /* WhenResolvedTests.swift */, + 635D640E1D59635300BC0AF5 /* AfterTests.swift */, + 0C42F3191FCF86240051309C /* HangTests.swift */, + 635D64121D59635300BC0AF5 /* RaceTests.swift */, + 635D641B1D59635300BC0AF5 /* DefaultDispatchQueueTests.swift */, + 635D64171D59635300BC0AF5 /* RegressionTests.swift */, + 635D64161D59635300BC0AF5 /* StressTests.swift */, + 635D640D1D59635300BC0AF5 /* ZalgoTests.swift */, + 639BF755203DF02C00FA577B /* Utilities.swift */, + ); + name = Core; + path = Tests/CorePromise; + sourceTree = ""; + }; + 631751AA1D59768200A9DDDC /* A+ */ = { + isa = PBXGroup; + children = ( + 631751AB1D59768200A9DDDC /* 0.0.0.swift */, + 631751AC1D59768200A9DDDC /* 2.1.2.swift */, + 631751AD1D59768200A9DDDC /* 2.1.3.swift */, + 631751AE1D59768200A9DDDC /* 2.2.2.swift */, + 631751AF1D59768200A9DDDC /* 2.2.3.swift */, + 631751B01D59768200A9DDDC /* 2.2.4.swift */, + 631751B11D59768200A9DDDC /* 2.2.6.swift */, + 631751B21D59768200A9DDDC /* 2.2.7.swift */, + 631751B31D59768200A9DDDC /* 2.3.1.swift */, + 631751B41D59768200A9DDDC /* 2.3.2.swift */, + 631751B51D59768200A9DDDC /* 2.3.4.swift */, + 631751B61D59768200A9DDDC /* README.md */, + ); + name = "A+"; + path = "Tests/A+"; + sourceTree = ""; + }; + 635893991D5BE51700F14B55 /* … */ = { + isa = PBXGroup; + children = ( + 63B0AC581D595E1B00FA21D9 /* Products */, + 63B0AC6C1D595E6300FA21D9 /* Info.plist */, + 635893941D5BE4F900F14B55 /* LICENSE */, + 635893951D5BE4F900F14B55 /* Package.swift */, + 635893961D5BE4F900F14B55 /* PromiseKit.podspec */, + ); + name = "…"; + sourceTree = ""; + }; + 635D64061D59630200BC0AF5 /* Tests */ = { + isa = PBXGroup; + children = ( + C0244E6B2047ACAF00ACB4AC /* JS/A+ */, + 631751AA1D59768200A9DDDC /* A+ */, + 6314113D1D59797100E24B9E /* Bridging */, + 6317518A1D59765700A9DDDC /* Core */, + 630A8050203CEF6800D25F23 /* CoreObjC */, + 63648C94203CB97400EBA011 /* DeprecationTests.swift */, + ); + name = Tests; + sourceTree = ""; + }; + 6399A3711D595D9100D65233 = { + isa = PBXGroup; + children = ( + 635893971D5BE4F900F14B55 /* README.md */, + 635893921D5BE4E000F14B55 /* PromiseKit.playground */, + 63B0AC761D595E6300FA21D9 /* PromiseKit.h */, + 63B0AC601D595E4C00FA21D9 /* Sources.swift */, + 63B912AB1F1E657400D49110 /* Sources.objc */, + 635D64061D59630200BC0AF5 /* Tests */, + 635893991D5BE51700F14B55 /* … */, + ); + sourceTree = ""; + }; + 63B0AC581D595E1B00FA21D9 /* Products */ = { + isa = PBXGroup; + children = ( + 63B0AC571D595E1B00FA21D9 /* PromiseKit.framework */, + 630019221D596292003B4E30 /* PMKCoreTests.xctest */, + 631751A81D59766500A9DDDC /* PMKA+Tests.xctest */, + 6314113C1D59795700E24B9E /* PMKBridgeTests.xctest */, + 633027EA203CC0060037E136 /* PMKDeprecatedTests.xctest */, + C0244E622047A6CB00ACB4AC /* PMKJSA+Tests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 63B0AC601D595E4C00FA21D9 /* Sources.swift */ = { + isa = PBXGroup; + children = ( + 636A29191F1C156B001229C2 /* Promise.swift */, + 636A29221F1C17A6001229C2 /* Guarantee.swift */, + 636A29201F1C1716001229C2 /* Thenable.swift */, + 632FBBE21F33B273008F8FBB /* Catchable.swift */, + 63B912AC1F1E663E00D49110 /* Features */, + 63B0AC691D595E6300FA21D9 /* Error.swift */, + 636A29261F1C3927001229C2 /* Resolver.swift */, + 636A291E1F1C16FF001229C2 /* Box.swift */, + 6330B5E01F2E991200D60528 /* Configuration.swift */, + 63B18AEB1F2D205C00B79E37 /* CustomStringConvertible.swift */, + 63D9B2F020338D5D0075C00B /* Deprecations.swift */, + ); + name = Sources.swift; + sourceTree = ""; + }; + 63B0AC9D1D595E6E00FA21D9 /* Internal Utilities */ = { + isa = PBXGroup; + children = ( + 63B0AC661D595E6300FA21D9 /* AnyPromise+Private.h */, + 63B0AC6F1D595E6300FA21D9 /* NSMethodSignatureForBlock.m */, + 63B0AC711D595E6300FA21D9 /* PMKCallVariadicBlock.m */, + ); + name = "Internal Utilities"; + sourceTree = ""; + }; + 63B912AB1F1E657400D49110 /* Sources.objc */ = { + isa = PBXGroup; + children = ( + 63B0AC641D595E6300FA21D9 /* AnyPromise.m */, + 63B0AC651D595E6300FA21D9 /* AnyPromise.swift */, + 63B0AC671D595E6300FA21D9 /* dispatch_promise.m */, + 630B60C01F2F73B000A1AEFE /* Headers */, + 630B60BF1F2F739E00A1AEFE /* Features */, + 63B0AC9D1D595E6E00FA21D9 /* Internal Utilities */, + ); + name = Sources.objc; + sourceTree = ""; + }; + 63B912AC1F1E663E00D49110 /* Features */ = { + isa = PBXGroup; + children = ( + 0CC3AF2A1FCF84F7000E98C9 /* hang.swift */, + 63B0AC621D595E6300FA21D9 /* after.swift */, + 63B912A91F1D7B1300D49110 /* firstly.swift */, + 636A29241F1C3089001229C2 /* race.swift */, + 63B0AC7D1D595E6300FA21D9 /* when.swift */, + ); + name = Features; + sourceTree = ""; + }; + C0244E6B2047ACAF00ACB4AC /* JS/A+ */ = { + isa = PBXGroup; + children = ( + C0244E682047AC9F00ACB4AC /* AllTests.swift */, + C013F7372048E3B6006B57B1 /* MockNodeEnvironment.swift */, + C013F7392049076A006B57B1 /* JSPromise.swift */, + C013F73B20494291006B57B1 /* JSAdapter.swift */, + C013F73F204E5063006B57B1 /* JSUtils.swift */, + ); + name = "JS/A+"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 63B0AC541D595E1B00FA21D9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 63B0AC931D595E6300FA21D9 /* PromiseKit.h in Headers */, + 634AAD2B1EAE517C00B17855 /* fwd.h in Headers */, + 63B0AC811D595E6300FA21D9 /* AnyPromise.h in Headers */, + 63B0AC841D595E6300FA21D9 /* AnyPromise+Private.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 630019011D596292003B4E30 /* PMKCoreTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6300191F1D596292003B4E30 /* Build configuration list for PBXNativeTarget "PMKCoreTests" */; + buildPhases = ( + 630019021D596292003B4E30 /* Sources */, + 630019181D596292003B4E30 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 635D64051D5962F900BC0AF5 /* PBXTargetDependency */, + ); + name = PMKCoreTests; + productName = PromiseKit; + productReference = 630019221D596292003B4E30 /* PMKCoreTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 631411321D59795700E24B9E /* PMKBridgeTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 631411391D59795700E24B9E /* Build configuration list for PBXNativeTarget "PMKBridgeTests" */; + buildPhases = ( + 631411351D59795700E24B9E /* Sources */, + 631411371D59795700E24B9E /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 631411331D59795700E24B9E /* PBXTargetDependency */, + ); + name = PMKBridgeTests; + productName = PromiseKit; + productReference = 6314113C1D59795700E24B9E /* PMKBridgeTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 6317518B1D59766500A9DDDC /* PMKA+Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 631751A51D59766500A9DDDC /* Build configuration list for PBXNativeTarget "PMKA+Tests" */; + buildPhases = ( + 6317518E1D59766500A9DDDC /* Sources */, + 631751A31D59766500A9DDDC /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 6317518C1D59766500A9DDDC /* PBXTargetDependency */, + ); + name = "PMKA+Tests"; + productName = PromiseKit; + productReference = 631751A81D59766500A9DDDC /* PMKA+Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 633027E0203CC0060037E136 /* PMKDeprecatedTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 633027E7203CC0060037E136 /* Build configuration list for PBXNativeTarget "PMKDeprecatedTests" */; + buildPhases = ( + 633027E3203CC0060037E136 /* Sources */, + 633027E5203CC0060037E136 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 633027E1203CC0060037E136 /* PBXTargetDependency */, + ); + name = PMKDeprecatedTests; + productName = PromiseKit; + productReference = 633027EA203CC0060037E136 /* PMKDeprecatedTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 63B0AC561D595E1B00FA21D9 /* PromiseKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 63B0AC5F1D595E1B00FA21D9 /* Build configuration list for PBXNativeTarget "PromiseKit" */; + buildPhases = ( + 63B0AC521D595E1B00FA21D9 /* Sources */, + 63B0AC531D595E1B00FA21D9 /* Frameworks */, + 63B0AC541D595E1B00FA21D9 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PromiseKit; + productName = PromiseKit; + productReference = 63B0AC571D595E1B00FA21D9 /* PromiseKit.framework */; + productType = "com.apple.product-type.framework"; + }; + C0244E4E2047A6CB00ACB4AC /* PMKJSA+Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = C0244E5F2047A6CB00ACB4AC /* Build configuration list for PBXNativeTarget "PMKJSA+Tests" */; + buildPhases = ( + C0244E512047A6CB00ACB4AC /* Sources */, + C0244E5D2047A6CB00ACB4AC /* Frameworks */, + C0244E6E2047AF0B00ACB4AC /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + C0244E4F2047A6CB00ACB4AC /* PBXTargetDependency */, + ); + name = "PMKJSA+Tests"; + productName = PromiseKit; + productReference = C0244E622047A6CB00ACB4AC /* PMKJSA+Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6399A3721D595D9100D65233 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0930; + TargetAttributes = { + 630019011D596292003B4E30 = { + LastSwiftMigration = 0920; + }; + 631411321D59795700E24B9E = { + LastSwiftMigration = 0920; + }; + 6317518B1D59766500A9DDDC = { + LastSwiftMigration = 0920; + }; + 633027E0203CC0060037E136 = { + LastSwiftMigration = 0920; + }; + 63B0AC561D595E1B00FA21D9 = { + CreatedOnToolsVersion = 8.0; + LastSwiftMigration = 0920; + ProvisioningStyle = Automatic; + }; + C0244E4E2047A6CB00ACB4AC = { + LastSwiftMigration = 0920; + }; + }; + }; + buildConfigurationList = 6399A3751D595D9100D65233 /* Build configuration list for PBXProject "PromiseKit" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 6399A3711D595D9100D65233; + productRefGroup = 63B0AC581D595E1B00FA21D9 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 63B0AC561D595E1B00FA21D9 /* PromiseKit */, + 6317518B1D59766500A9DDDC /* PMKA+Tests */, + 631411321D59795700E24B9E /* PMKBridgeTests */, + 630019011D596292003B4E30 /* PMKCoreTests */, + 633027E0203CC0060037E136 /* PMKDeprecatedTests */, + C0244E4E2047A6CB00ACB4AC /* PMKJSA+Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 630019021D596292003B4E30 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0C42F31B1FCF86320051309C /* HangTests.swift in Sources */, + 635D641E1D59635300BC0AF5 /* CancellableErrorTests.swift in Sources */, + 630A8056203CEF6800D25F23 /* AnyPromiseTests.m in Sources */, + 635D64221D59635300BC0AF5 /* ZalgoTests.swift in Sources */, + 635D64271D59635300BC0AF5 /* RaceTests.swift in Sources */, + 632FBBE51F33B338008F8FBB /* CatchableTests.swift in Sources */, + 63CF6D80203CD19200EC8927 /* ThenableTests.swift in Sources */, + 635D642B1D59635300BC0AF5 /* StressTests.swift in Sources */, + 630A805A203CEF6800D25F23 /* WhenTests.m in Sources */, + 630A805B203CF67800D25F23 /* DefaultDispatchQueueTests.swift in Sources */, + 635D641D1D59635300BC0AF5 /* PromiseTests.swift in Sources */, + 63CF6D7C203CCDAB00EC8927 /* GuaranteeTests.swift in Sources */, + 639BF757203DF03100FA577B /* Utilities.swift in Sources */, + 635D64261D59635300BC0AF5 /* WhenResolvedTests.swift in Sources */, + 635D64231D59635300BC0AF5 /* AfterTests.swift in Sources */, + 63CF6D7A203CC66000EC8927 /* ErrorTests.swift in Sources */, + 49A5584D1DC5185900E4D01B /* ResolverTests.swift in Sources */, + 630A8057203CEF6800D25F23 /* PMKManifoldTests.m in Sources */, + 63B7C94B203E2B8200FBEC00 /* AnyPromiseTests.swift in Sources */, + 630A8059203CEF6800D25F23 /* HangTests.m in Sources */, + 635D642A1D59635300BC0AF5 /* WhenTests.swift in Sources */, + 630A8058203CEF6800D25F23 /* JoinTests.m in Sources */, + 635D64281D59635300BC0AF5 /* WhenConcurrentTests.swift in Sources */, + 635D642C1D59635300BC0AF5 /* RegressionTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 631411351D59795700E24B9E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 631411461D59797100E24B9E /* Infrastructure.swift in Sources */, + 631411431D59797100E24B9E /* BridgingTests.m in Sources */, + 631411441D59797100E24B9E /* BridgingTests.swift in Sources */, + 631411451D59797100E24B9E /* Infrastructure.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6317518E1D59766500A9DDDC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 631751C11D59768200A9DDDC /* 2.3.4.swift in Sources */, + 631751BA1D59768200A9DDDC /* 2.2.2.swift in Sources */, + 631751BF1D59768200A9DDDC /* 2.3.1.swift in Sources */, + 631751B91D59768200A9DDDC /* 2.1.3.swift in Sources */, + 631751BD1D59768200A9DDDC /* 2.2.6.swift in Sources */, + 631751B71D59768200A9DDDC /* 0.0.0.swift in Sources */, + 631751C01D59768200A9DDDC /* 2.3.2.swift in Sources */, + 631751B81D59768200A9DDDC /* 2.1.2.swift in Sources */, + 631751BE1D59768200A9DDDC /* 2.2.7.swift in Sources */, + 631751BC1D59768200A9DDDC /* 2.2.4.swift in Sources */, + 631751BB1D59768200A9DDDC /* 2.2.3.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 633027E3203CC0060037E136 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 63CF6D7E203CD12700EC8927 /* DeprecationTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63B0AC521D595E1B00FA21D9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 636A29251F1C3089001229C2 /* race.swift in Sources */, + 63B0AC9A1D595E6300FA21D9 /* when.swift in Sources */, + 636A29271F1C3927001229C2 /* Resolver.swift in Sources */, + 63B0AC991D595E6300FA21D9 /* when.m in Sources */, + 63D9B2EF203385FD0075C00B /* race.m in Sources */, + 63B0AC801D595E6300FA21D9 /* after.swift in Sources */, + 63B18AEC1F2D205C00B79E37 /* CustomStringConvertible.swift in Sources */, + 6330B5E11F2E991200D60528 /* Configuration.swift in Sources */, + 63B912AA1F1D7B1300D49110 /* firstly.swift in Sources */, + 636A29211F1C1716001229C2 /* Thenable.swift in Sources */, + 632FBBE31F33B273008F8FBB /* Catchable.swift in Sources */, + 63B0AC851D595E6300FA21D9 /* dispatch_promise.m in Sources */, + 636A291F1F1C16FF001229C2 /* Box.swift in Sources */, + 63B0AC821D595E6300FA21D9 /* AnyPromise.m in Sources */, + 636A29231F1C17A6001229C2 /* Guarantee.swift in Sources */, + 636A291A1F1C156B001229C2 /* Promise.swift in Sources */, + 63B0AC8B1D595E6300FA21D9 /* join.m in Sources */, + 63B0AC891D595E6300FA21D9 /* hang.m in Sources */, + 63B0AC831D595E6300FA21D9 /* AnyPromise.swift in Sources */, + 63D9B2F120338D5D0075C00B /* Deprecations.swift in Sources */, + 63B0AC871D595E6300FA21D9 /* Error.swift in Sources */, + 0CC3AF2B1FCF84F7000E98C9 /* hang.swift in Sources */, + 63B0AC7F1D595E6300FA21D9 /* after.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C0244E512047A6CB00ACB4AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C013F73C20494291006B57B1 /* JSAdapter.swift in Sources */, + C0244E692047AC9F00ACB4AC /* AllTests.swift in Sources */, + C013F740204E5064006B57B1 /* JSUtils.swift in Sources */, + C013F73A2049076A006B57B1 /* JSPromise.swift in Sources */, + C013F7382048E3B6006B57B1 /* MockNodeEnvironment.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 631411331D59795700E24B9E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63B0AC561D595E1B00FA21D9 /* PromiseKit */; + targetProxy = 631411341D59795700E24B9E /* PBXContainerItemProxy */; + }; + 6317518C1D59766500A9DDDC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63B0AC561D595E1B00FA21D9 /* PromiseKit */; + targetProxy = 6317518D1D59766500A9DDDC /* PBXContainerItemProxy */; + }; + 633027E1203CC0060037E136 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63B0AC561D595E1B00FA21D9 /* PromiseKit */; + targetProxy = 633027E2203CC0060037E136 /* PBXContainerItemProxy */; + }; + 635D64051D5962F900BC0AF5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63B0AC561D595E1B00FA21D9 /* PromiseKit */; + targetProxy = 635D64041D5962F900BC0AF5 /* PBXContainerItemProxy */; + }; + C0244E4F2047A6CB00ACB4AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 63B0AC561D595E1B00FA21D9 /* PromiseKit */; + targetProxy = C0244E502047A6CB00ACB4AC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 630019201D596292003B4E30 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.12; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 4.0; + TVOS_DEPLOYMENT_TARGET = 10.0; + }; + name = Debug; + }; + 630019211D596292003B4E30 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.12; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 4.0; + TVOS_DEPLOYMENT_TARGET = 10.0; + }; + name = Release; + }; + 6314113A1D59795700E24B9E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_OBJC_BRIDGING_HEADER = Tests/Bridging/Infrastructure.h; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 6314113B1D59795700E24B9E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_OBJC_BRIDGING_HEADER = Tests/Bridging/Infrastructure.h; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; + 631751A61D59766500A9DDDC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 631751A71D59766500A9DDDC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; + 633027E8203CC0060037E136 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + 633027E9203CC0060037E136 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_SUPPRESS_WARNINGS = YES; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; + 6399A3761D595D9100D65233 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 6.5.2; + DEBUG_INFORMATION_FORMAT = dwarf; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_DYLIB_INSTALL_NAME = "@rpath"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit; + PRODUCT_BUNDLE_PACKAGE_TYPE = BNDL; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "macosx appletvsimulator appletvos watchsimulator iphonesimulator watchos iphoneos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 6399A3771D595D9100D65233 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 6.5.2; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_DYLIB_INSTALL_NAME = "@rpath"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_BUNDLE_IDENTIFIER = org.promisekit; + PRODUCT_BUNDLE_PACKAGE_TYPE = BNDL; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "macosx appletvsimulator appletvos watchsimulator iphonesimulator watchos iphoneos"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 63B0AC5D1D595E1B00FA21D9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES; + CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + DEFINES_MODULE = YES; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_TESTABILITY = YES; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + }; + name = Debug; + }; + 63B0AC5E1D595E1B00FA21D9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + BITCODE_GENERATION_MODE = bitcode; + CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES; + CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + DEFINES_MODULE = YES; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_PARAMETER = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_PACKAGE_TYPE = FMWK; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + }; + name = Release; + }; + C0244E602047A6CB00ACB4AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + }; + name = Debug; + }; + C0244E612047A6CB00ACB4AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ENABLE_MODULES = YES; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks @loader_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 4.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6300191F1D596292003B4E30 /* Build configuration list for PBXNativeTarget "PMKCoreTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 630019201D596292003B4E30 /* Debug */, + 630019211D596292003B4E30 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 631411391D59795700E24B9E /* Build configuration list for PBXNativeTarget "PMKBridgeTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6314113A1D59795700E24B9E /* Debug */, + 6314113B1D59795700E24B9E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 631751A51D59766500A9DDDC /* Build configuration list for PBXNativeTarget "PMKA+Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 631751A61D59766500A9DDDC /* Debug */, + 631751A71D59766500A9DDDC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 633027E7203CC0060037E136 /* Build configuration list for PBXNativeTarget "PMKDeprecatedTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 633027E8203CC0060037E136 /* Debug */, + 633027E9203CC0060037E136 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6399A3751D595D9100D65233 /* Build configuration list for PBXProject "PromiseKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6399A3761D595D9100D65233 /* Debug */, + 6399A3771D595D9100D65233 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 63B0AC5F1D595E1B00FA21D9 /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 63B0AC5D1D595E1B00FA21D9 /* Debug */, + 63B0AC5E1D595E1B00FA21D9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C0244E5F2047A6CB00ACB4AC /* Build configuration list for PBXNativeTarget "PMKJSA+Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C0244E602047A6CB00ACB4AC /* Debug */, + C0244E612047A6CB00ACB4AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6399A3721D595D9100D65233 /* Project object */; +} diff --git a/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0a89509 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/xcshareddata/xcschemes/PromiseKit.xcscheme b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/xcshareddata/xcschemes/PromiseKit.xcscheme new file mode 100644 index 0000000..d233c2c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/PromiseKit.xcodeproj/xcshareddata/xcschemes/PromiseKit.xcscheme @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Carthage/Checkouts/PromiseKit/README.md b/Carthage/Checkouts/PromiseKit/README.md new file mode 100644 index 0000000..78f555f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/README.md @@ -0,0 +1,174 @@ +![PromiseKit](http://promisekit.org/public/img/logo-tight.png) + +![badge-pod] ![badge-languages] ![badge-pms] ![badge-platforms] [![Build Status](https://travis-ci.org/mxcl/PromiseKit.svg?branch=master)](https://travis-ci.org/mxcl/PromiseKit) + +--- + +Promises simplify asynchronous programming, freeing you up to focus on the more +important things. They are easy to learn, easy to master and result in clearer, +more readable code. Your co-workers will thank you. + +```swift +UIApplication.shared.isNetworkActivityIndicatorVisible = true + +let fetchImage = URLSession.shared.dataTask(.promise, with: url).compactMap{ UIImage(data: $0.data) } +let fetchLocation = CLLocationManager.requestLocation().lastValue + +firstly { + when(fulfilled: fetchImage, fetchLocation) +}.done { image, location in + self.imageView.image = image + self.label.text = "\(location)" +}.ensure { + UIApplication.shared.isNetworkActivityIndicatorVisible = false +}.catch { error in + self.show(UIAlertController(for: error), sender: self) +} +``` + +PromiseKit is a thoughtful and complete implementation of promises for any +platform that has a `swiftc`. It has *excellent* Objective-C bridging and +*delightful* specializations for iOS, macOS, tvOS and watchOS. It is a top-100 +pod used in many of the most popular apps in the world. + +[![codecov](https://codecov.io/gh/mxcl/PromiseKit/branch/master/graph/badge.svg)](https://codecov.io/gh/mxcl/PromiseKit) + +# PromiseKit 6 Released + +PromiseKit 6 has been released; [read the release notes and migration guide][PMK6]. + +# Quick Start + +In your [Podfile]: + +```ruby +use_frameworks! + +target "Change Me!" do + pod "PromiseKit", "~> 6.0" +end +``` + +> The above gives an Xcode warning? See our [Installation Guide]. + +PromiseKit 6, 5 and 4 support Xcode 8.3, 9.x and 10.0; Swift 3.1, +3.2, 3.3, 3.4, 4.0, 4.1 and 4.2; iOS, macOS, tvOS, watchOS, Linux and Android; CocoaPods, +Carthage and SwiftPM; ([CI Matrix](https://travis-ci.org/mxcl/PromiseKit)). + +For Carthage, SwiftPM, etc., or for instructions when using older Swifts or +Xcodes, see our [Installation Guide]. We +recommend [Carthage](https://github.com/Carthage/Carthage). + +# Documentation + +* Handbook + * [Getting Started](Documentation/GettingStarted.md) + * [Promises: Common Patterns](Documentation/CommonPatterns.md) + * [Frequently Asked Questions](Documentation/FAQ.md) +* Manual + * [Installation Guide](Documentation/Installation.md) + * [Objective-C Guide](Documentation/ObjectiveC.md) + * [Troubleshooting](Documentation/Troubleshooting.md) (e.g., solutions to common compile errors) + * [Appendix](Documentation/Appendix.md) +* [API Reference](https://promisekit.org/reference/) + +# Extensions + +Promises are only as useful as the asynchronous tasks they represent. Thus, we +have converted (almost) all of Apple’s APIs to promises. The default CocoaPod +provides Promises and the extensions for Foundation and UIKit. The other +extensions are available by specifying additional subspecs in your `Podfile`, +e.g.: + +```ruby +pod "PromiseKit/MapKit" # MKDirections().calculate().then { /*…*/ } +pod "PromiseKit/CoreLocation" # CLLocationManager.requestLocation().then { /*…*/ } +``` + +All our extensions are separate repositories at the [PromiseKit organization]. + +## I don't want the extensions! + +Then don’t have them: + +```ruby +pod "PromiseKit/CorePromise", "~> 6.0" +``` + +> *Note:* Carthage installations come with no extensions by default. + +## Choose Your Networking Library + +Promise chains commonly start with a network operation. Thus, we offer +extensions for `URLSession`: + +```swift +// pod 'PromiseKit/Foundation' # https://github.com/PromiseKit/Foundation + +firstly { + URLSession.shared.dataTask(.promise, with: try makeUrlRequest()).validate() + // ^^ we provide `.validate()` so that eg. 404s get converted to errors +}.map { + try JSONDecoder().decode(Foo.self, with: $0.data) +}.done { foo in + //… +}.catch { error in + //… +} + +func makeUrlRequest() throws -> URLRequest { + var rq = URLRequest(url: url) + rq.httpMethod = "POST" + rq.addValue("application/json", forHTTPHeaderField: "Content-Type") + rq.addValue("application/json", forHTTPHeaderField: "Accept") + rq.httpBody = try JSONEncoder().encode(obj) + return rq +} +``` + +And [Alamofire]: + +```swift +// pod 'PromiseKit/Alamofire' # https://github.com/PromiseKit/Alamofire- + +firstly { + Alamofire + .request("http://example.com", method: .post, parameters: params) + .responseDecodable(Foo.self) +}.done { foo in + //… +}.catch { error in + //… +} +``` + +Nowadays, considering that: + +* We almost always POST JSON +* We now have `JSONDecoder` +* PromiseKit now has `map` and other functional primitives +* PromiseKit (like Alamofire, but not raw-URLSession) also defaults to having callbacks go to the main thread + +We recommend vanilla `URLSession`. It uses fewer black boxes and sticks closer to the +metal. Alamofire was essential until the three bulletpoints above became true, +but nowadays it isn’t really necessary. + +# Support + +Please check our [Troubleshooting Guide](Documentation/Troubleshooting.md), and +if after that you still have a question, ask at our [Gitter chat channel] or on [our bug tracker]. + + +[badge-pod]: https://img.shields.io/cocoapods/v/PromiseKit.svg?label=version +[badge-pms]: https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage%20%7C%20SwiftPM-green.svg +[badge-languages]: https://img.shields.io/badge/languages-Swift%20%7C%20ObjC-orange.svg +[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-lightgrey.svg +[badge-mit]: https://img.shields.io/badge/license-MIT-blue.svg +[OMGHTTPURLRQ]: https://github.com/PromiseKit/OMGHTTPURLRQ +[Alamofire]: http://github.com/PromiseKit/Alamofire- +[PromiseKit organization]: https://github.com/PromiseKit +[Gitter chat channel]: https://gitter.im/mxcl/PromiseKit +[our bug tracker]: https://github.com/mxcl/PromiseKit/issues/new +[Podfile]: https://guides.cocoapods.org/syntax/podfile.html +[PMK6]: http://promisekit.org/news/2018/02/PromiseKit-6.0-Released/ +[Installation Guide]: Documentation/Installation.md diff --git a/Carthage/Checkouts/PromiseKit/Sources/AnyPromise+Private.h b/Carthage/Checkouts/PromiseKit/Sources/AnyPromise+Private.h new file mode 100644 index 0000000..cd28c41 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/AnyPromise+Private.h @@ -0,0 +1,32 @@ +@import Foundation.NSError; +@import Foundation.NSPointerArray; + +#if TARGET_OS_IPHONE + #define NSPointerArrayMake(N) ({ \ + NSPointerArray *aa = [NSPointerArray strongObjectsPointerArray]; \ + aa.count = N; \ + aa; \ + }) +#else + static inline NSPointerArray * __nonnull NSPointerArrayMake(NSUInteger count) { + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSPointerArray *aa = [[NSPointerArray class] respondsToSelector:@selector(strongObjectsPointerArray)] + ? [NSPointerArray strongObjectsPointerArray] + : [NSPointerArray pointerArrayWithStrongObjects]; + #pragma clang diagnostic pop + aa.count = count; + return aa; + } +#endif + +#define IsError(o) [o isKindOfClass:[NSError class]] +#define IsPromise(o) [o isKindOfClass:[AnyPromise class]] + +#import "AnyPromise.h" + +@class PMKArray; + +@interface AnyPromise () +- (void)__pipe:(void(^ __nonnull)(__nullable id))block NS_REFINED_FOR_SWIFT; +@end diff --git a/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.h b/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.h new file mode 100644 index 0000000..cd625d9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.h @@ -0,0 +1,299 @@ +#import +#import +#import "fwd.h" + +/// INTERNAL DO NOT USE +@class __AnyPromise; + +/// Provided to simplify some usage sites +typedef void (^PMKResolver)(id __nullable) NS_REFINED_FOR_SWIFT; + + +/// An Objective-C implementation of the promise pattern. +@interface AnyPromise: NSObject + +/** + Create a new promise that resolves with the provided block. + + Use this method when wrapping asynchronous code that does *not* use promises so that this code can be used in promise chains. + + If `resolve` is called with an `NSError` object, the promise is rejected, otherwise the promise is fulfilled. + + Don’t use this method if you already have promises! Instead, just return your promise. + + Should you need to fulfill a promise but have no sensical value to use: your promise is a `void` promise: fulfill with `nil`. + + The block you pass is executed immediately on the calling thread. + + - Parameter block: The provided block is immediately executed, inside the block call `resolve` to resolve this promise and cause any attached handlers to execute. If you are wrapping a delegate-based system, we recommend instead to use: initWithResolver: + - Returns: A new promise. + - Warning: Resolving a promise with `nil` fulfills it. + - SeeAlso: http://promisekit.org/sealing-your-own-promises/ + - SeeAlso: http://promisekit.org/wrapping-delegation/ + */ ++ (instancetype __nonnull)promiseWithResolverBlock:(void (^ __nonnull)(__nonnull PMKResolver))resolveBlock NS_REFINED_FOR_SWIFT; + + +/// INTERNAL DO NOT USE +- (instancetype __nonnull)initWith__D:(__AnyPromise * __nonnull)d; + +/** + Creates a resolved promise. + + When developing your own promise systems, it is occasionally useful to be able to return an already resolved promise. + + - Parameter value: The value with which to resolve this promise. Passing an `NSError` will cause the promise to be rejected, passing an AnyPromise will return a new AnyPromise bound to that promise, otherwise the promise will be fulfilled with the value passed. + - Returns: A resolved promise. + */ ++ (instancetype __nonnull)promiseWithValue:(__nullable id)value NS_REFINED_FOR_SWIFT; + +/** + The value of the asynchronous task this promise represents. + + A promise has `nil` value if the asynchronous task it represents has not finished. If the value is `nil` the promise is still `pending`. + + - Warning: *Note* Our Swift variant’s value property returns nil if the promise is rejected where AnyPromise will return the error object. This fits with the pattern where AnyPromise is not strictly typed and is more dynamic, but you should be aware of the distinction. + + - Note: If the AnyPromise was fulfilled with a `PMKManifold`, returns only the first fulfillment object. + + - Returns: The value with which this promise was resolved or `nil` if this promise is pending. + */ +@property (nonatomic, readonly) __nullable id value NS_REFINED_FOR_SWIFT; + +/// - Returns: if the promise is pending resolution. +@property (nonatomic, readonly) BOOL pending NS_REFINED_FOR_SWIFT; + +/// - Returns: if the promise is resolved and fulfilled. +@property (nonatomic, readonly) BOOL fulfilled NS_REFINED_FOR_SWIFT; + +/// - Returns: if the promise is resolved and rejected. +@property (nonatomic, readonly) BOOL rejected NS_REFINED_FOR_SWIFT; + + +/** + The provided block is executed when its receiver is resolved. + + If you provide a block that takes a parameter, the value of the receiver will be passed as that parameter. + + [NSURLSession GET:url].then(^(NSData *data){ + // do something with data + }); + + @return A new promise that is resolved with the value returned from the provided block. For example: + + [NSURLSession GET:url].then(^(NSData *data){ + return data.length; + }).then(^(NSNumber *number){ + //… + }); + + @warning *Important* The block passed to `then` may take zero, one, two or three arguments, and return an object or return nothing. This flexibility is why the method signature for then is `id`, which means you will not get completion for the block parameter, and must type it yourself. It is safe to type any block syntax here, so to start with try just: `^{}`. + + @warning *Important* If an `NSError` or `NSString` is thrown inside your block, or you return an `NSError` object the next `Promise` will be rejected. See `catch` for documentation on error handling. + + @warning *Important* `then` is always executed on the main queue. + + @see thenOn + @see thenInBackground +*/ +- (AnyPromise * __nonnull (^ __nonnull)(id __nonnull))then NS_REFINED_FOR_SWIFT; + + +/** + The provided block is executed on the default queue when the receiver is fulfilled. + + This method is provided as a convenience for `thenOn`. + + @see then + @see thenOn +*/ +- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))thenInBackground NS_REFINED_FOR_SWIFT; + +/** + The provided block is executed on the dispatch queue of your choice when the receiver is fulfilled. + + @see then + @see thenInBackground +*/ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, id __nonnull))thenOn NS_REFINED_FOR_SWIFT; + +#ifndef __cplusplus +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on the main queue. + + @warning *Note* Cancellation errors are not caught. + + @warning *Note* Since catch is a c++ keyword, this method is not available in Objective-C++ files. Instead use catchOn. + + @see catchOn + @see catchInBackground +*/ +- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catch NS_REFINED_FOR_SWIFT; +#endif + +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on the global background queue. + + @warning *Note* Cancellation errors are not caught. + + @warning *Note* Since catch is a c++ keyword, this method is not available in Objective-C++ files. Instead use catchWithPolicy. + + @see catch + @see catchOn + */ +- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catchInBackground NS_REFINED_FOR_SWIFT; + + +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on queue provided. + + @warning *Note* Cancellation errors are not caught. + + @see catch + @see catchInBackground + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, id __nonnull))catchOn NS_REFINED_FOR_SWIFT; + +/** + The provided block is executed when the receiver is resolved. + + The provided block always runs on the main queue. + + @see ensureOn +*/ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull))ensure NS_REFINED_FOR_SWIFT; + +/** + The provided block is executed on the dispatch queue of your choice when the receiver is resolved. + + @see ensure + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, dispatch_block_t __nonnull))ensureOn NS_REFINED_FOR_SWIFT; + +/** + Create a new promise with an associated resolver. + + Use this method when wrapping asynchronous code that does *not* use + promises so that this code can be used in promise chains. Generally, + prefer `promiseWithResolverBlock:` as the resulting code is more elegant. + + PMKResolver resolve; + AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; + + // later + resolve(@"foo"); + + @param resolver A reference to a block pointer of PMKResolver type. + You can then call your resolver to resolve this promise. + + @return A new promise. + + @warning *Important* The resolver strongly retains the promise. + + @see promiseWithResolverBlock: +*/ +- (instancetype __nonnull)initWithResolver:(PMKResolver __strong __nonnull * __nonnull)resolver NS_REFINED_FOR_SWIFT; + +@end + + +typedef void (^PMKAdapter)(id __nullable, NSError * __nullable) NS_REFINED_FOR_SWIFT; +typedef void (^PMKIntegerAdapter)(NSInteger, NSError * __nullable) NS_REFINED_FOR_SWIFT; +typedef void (^PMKBooleanAdapter)(BOOL, NSError * __nullable) NS_REFINED_FOR_SWIFT; + + +@interface AnyPromise (Adapters) + +/** + Create a new promise by adapting an existing asynchronous system. + + The pattern of a completion block that passes two parameters, the first + the result and the second an `NSError` object is so common that we + provide this convenience adapter to make wrapping such systems more + elegant. + + return [PMKPromise promiseWithAdapterBlock:^(PMKAdapter adapter){ + PFQuery *query = [PFQuery …]; + [query findObjectsInBackgroundWithBlock:adapter]; + }]; + + @warning *Important* If both parameters are nil, the promise fulfills, + if both are non-nil the promise rejects. This is per the convention. + + @see http://promisekit.org/sealing-your-own-promises/ + */ ++ (instancetype __nonnull)promiseWithAdapterBlock:(void (^ __nonnull)(PMKAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; + +/** + Create a new promise by adapting an existing asynchronous system. + + Adapts asynchronous systems that complete with `^(NSInteger, NSError *)`. + NSInteger will cast to enums provided the enum has been wrapped with + `NS_ENUM`. All of Apple’s enums are, so if you find one that hasn’t you + may need to make a pull-request. + + @see promiseWithAdapter + */ ++ (instancetype __nonnull)promiseWithIntegerAdapterBlock:(void (^ __nonnull)(PMKIntegerAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; + +/** + Create a new promise by adapting an existing asynchronous system. + + Adapts asynchronous systems that complete with `^(BOOL, NSError *)`. + + @see promiseWithAdapter + */ ++ (instancetype __nonnull)promiseWithBooleanAdapterBlock:(void (^ __nonnull)(PMKBooleanAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; + +@end + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + Whenever resolving a promise you may resolve with a tuple, eg. + returning from a `then` or `catch` handler or resolving a new promise. + + Consumers of your Promise are not compelled to consume any arguments and + in fact will often only consume the first parameter. Thus ensure the + order of parameters is: from most-important to least-important. + + Currently PromiseKit limits you to THREE parameters to the manifold. +*/ +#define PMKManifold(...) __PMKManifold(__VA_ARGS__, 3, 2, 1) +#define __PMKManifold(_1, _2, _3, N, ...) __PMKArrayWithCount(N, _1, _2, _3) +extern id __nonnull __PMKArrayWithCount(NSUInteger, ...); + +#ifdef __cplusplus +} // Extern C +#endif + + +@interface AnyPromise (Unavailable) + +- (instancetype __nonnull)init __attribute__((unavailable("It is illegal to create an unresolvable promise."))); ++ (instancetype __nonnull)new __attribute__((unavailable("It is illegal to create an unresolvable promise."))); +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull))always __attribute__((unavailable("See -ensure"))); +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull))alwaysOn __attribute__((unavailable("See -ensureOn"))); +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull))finally __attribute__((unavailable("See -ensure"))); +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull, dispatch_block_t __nonnull))finallyOn __attribute__((unavailable("See -ensureOn"))); + +@end + +__attribute__((unavailable("See AnyPromise"))) +@interface PMKPromise +@end diff --git a/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.m b/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.m new file mode 100644 index 0000000..af66310 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.m @@ -0,0 +1,175 @@ +#if __has_include("PromiseKit-Swift.h") + #import "PromiseKit-Swift.h" +#else + #import +#endif +#import "PMKCallVariadicBlock.m" +#import "AnyPromise+Private.h" +#import "AnyPromise.h" + +NSString *const PMKErrorDomain = @"PMKErrorDomain"; + + +@implementation AnyPromise { + __AnyPromise *d; +} + +- (instancetype)initWith__D:(__AnyPromise *)dd { + self = [super init]; + if (self) self->d = dd; + return self; +} + +- (instancetype)initWithResolver:(PMKResolver __strong *)resolver { + self = [super init]; + if (self) + d = [[__AnyPromise alloc] initWithResolver:^(void (^resolve)(id)) { + *resolver = resolve; + }]; + return self; +} + ++ (instancetype)promiseWithResolverBlock:(void (^)(PMKResolver _Nonnull))resolveBlock { + id d = [[__AnyPromise alloc] initWithResolver:resolveBlock]; + return [[self alloc] initWith__D:d]; +} + ++ (instancetype)promiseWithValue:(id)value { + //TODO provide a more efficient route for sealed promises + id d = [[__AnyPromise alloc] initWithResolver:^(void (^resolve)(id)) { + resolve(value); + }]; + return [[self alloc] initWith__D:d]; +} + +//TODO remove if possible, but used by when.m +- (void)__pipe:(void (^)(id _Nullable))block { + [d __pipe:block]; +} + +//NOTE used by AnyPromise.swift +- (id)__d { + return d; +} + +- (AnyPromise *(^)(id))then { + return ^(id block) { + return [self->d __thenOn:dispatch_get_main_queue() execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, id))thenOn { + return ^(dispatch_queue_t queue, id block) { + return [self->d __thenOn:queue execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))thenInBackground { + return ^(id block) { + return [self->d __thenOn:dispatch_get_global_queue(0, 0) execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, id))catchOn { + return ^(dispatch_queue_t q, id block) { + return [self->d __catchOn:q execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))catch { + return ^(id block) { + return [self->d __catchOn:dispatch_get_main_queue() execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))catchInBackground { + return ^(id block) { + return [self->d __catchOn:dispatch_get_global_queue(0, 0) execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_block_t))ensure { + return ^(dispatch_block_t block) { + return [self->d __ensureOn:dispatch_get_main_queue() execute:block]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, dispatch_block_t))ensureOn { + return ^(dispatch_queue_t queue, dispatch_block_t block) { + return [self->d __ensureOn:queue execute:block]; + }; +} + +- (BOOL)pending { + return [[d valueForKey:@"__pending"] boolValue]; +} + +- (BOOL)rejected { + return IsError([d __value]); +} + +- (BOOL)fulfilled { + return !self.rejected; +} + +- (id)value { + id obj = [d __value]; + + if ([obj isKindOfClass:[PMKArray class]]) { + return obj[0]; + } else { + return obj; + } +} + +@end + + + +@implementation AnyPromise (Adapters) + ++ (instancetype)promiseWithAdapterBlock:(void (^)(PMKAdapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(id value, id error){ + resolve(error ?: value); + }); + }]; +} + ++ (instancetype)promiseWithIntegerAdapterBlock:(void (^)(PMKIntegerAdapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(NSInteger value, id error){ + if (error) { + resolve(error); + } else { + resolve(@(value)); + } + }); + }]; +} + ++ (instancetype)promiseWithBooleanAdapterBlock:(void (^)(PMKBooleanAdapter adapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(BOOL value, id error){ + if (error) { + resolve(error); + } else { + resolve(@(value)); + } + }); + }]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.swift b/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.swift new file mode 100644 index 0000000..5dfa1df --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.swift @@ -0,0 +1,204 @@ +import Foundation + +/** + __AnyPromise is an implementation detail. + + Because of how ObjC/Swift compatability work we have to compose our AnyPromise + with this internal object, however this is still part of the public interface. + Sadly. Please don’t use it. +*/ +@objc(__AnyPromise) public class __AnyPromise: NSObject { + fileprivate let box: Box + + @objc public init(resolver body: (@escaping (Any?) -> Void) -> Void) { + box = EmptyBox() + super.init() + body { + if let p = $0 as? AnyPromise { + p.d.__pipe(self.box.seal) + } else { + self.box.seal($0) + } + } + } + + @objc public func __thenOn(_ q: DispatchQueue, execute: @escaping (Any?) -> Any?) -> AnyPromise { + return AnyPromise(__D: __AnyPromise(resolver: { resolve in + self.__pipe { obj in + if !(obj is NSError) { + q.async { + resolve(execute(obj)) + } + } else { + resolve(obj) + } + } + })) + } + + @objc public func __catchOn(_ q: DispatchQueue, execute: @escaping (Any?) -> Any?) -> AnyPromise { + return AnyPromise(__D: __AnyPromise(resolver: { resolve in + self.__pipe { obj in + if obj is NSError { + q.async { + resolve(execute(obj)) + } + } else { + resolve(obj) + } + } + })) + } + + @objc public func __ensureOn(_ q: DispatchQueue, execute: @escaping () -> Void) -> AnyPromise { + return AnyPromise(__D: __AnyPromise(resolver: { resolve in + self.__pipe { obj in + q.async { + execute() + resolve(obj) + } + } + })) + } + + /// Internal, do not use! Some behaviors undefined. + @objc public func __pipe(_ to: @escaping (Any?) -> Void) { + let to = { (obj: Any?) -> Void in + if obj is NSError { + to(obj) // or we cannot determine if objects are errors in objc land + } else { + to(obj) + } + } + switch box.inspect() { + case .pending: + box.inspect { + switch $0 { + case .pending(let handlers): + handlers.append { obj in + to(obj) + } + case .resolved(let obj): + to(obj) + } + } + case .resolved(let obj): + to(obj) + } + } + + @objc public var __value: Any? { + switch box.inspect() { + case .resolved(let obj): + return obj + default: + return nil + } + } + + @objc public var __pending: Bool { + switch box.inspect() { + case .pending: + return true + case .resolved: + return false + } + } +} + +extension AnyPromise: Thenable, CatchMixin { + + /// - Returns: A new `AnyPromise` bound to a `Promise`. + public convenience init(_ bridge: U) { + self.init(__D: __AnyPromise(resolver: { resolve in + bridge.pipe { + switch $0 { + case .rejected(let error): + resolve(error as NSError) + case .fulfilled(let value): + resolve(value) + } + } + })) + } + + public func pipe(to body: @escaping (Result) -> Void) { + + func fulfill() { + // calling through to the ObjC `value` property unwraps (any) PMKManifold + // and considering this is the Swift pipe; we want that. + body(.fulfilled(self.value(forKey: "value"))) + } + + switch box.inspect() { + case .pending: + box.inspect { + switch $0 { + case .pending(let handlers): + handlers.append { + if let error = $0 as? Error { + body(.rejected(error)) + } else { + fulfill() + } + } + case .resolved(let error as Error): + body(.rejected(error)) + case .resolved: + fulfill() + } + } + case .resolved(let error as Error): + body(.rejected(error)) + case .resolved: + fulfill() + } + } + + fileprivate var d: __AnyPromise { + return value(forKey: "__d") as! __AnyPromise + } + + var box: Box { + return d.box + } + + public var result: Result? { + guard let value = __value else { + return nil + } + if let error = value as? Error { + return .rejected(error) + } else { + return .fulfilled(value) + } + } + + public typealias T = Any? +} + + +#if swift(>=3.1) +public extension Promise where T == Any? { + convenience init(_ anyPromise: AnyPromise) { + self.init { + anyPromise.pipe(to: $0.resolve) + } + } +} +#else +extension AnyPromise { + public func asPromise() -> Promise { + return Promise(.pending, resolver: { resolve in + pipe { result in + switch result { + case .rejected(let error): + resolve.reject(error) + case .fulfilled(let obj): + resolve.fulfill(obj) + } + } + }) + } +} +#endif diff --git a/Carthage/Checkouts/PromiseKit/Sources/Box.swift b/Carthage/Checkouts/PromiseKit/Sources/Box.swift new file mode 100644 index 0000000..3bf7ecd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Box.swift @@ -0,0 +1,101 @@ +import Dispatch + +enum Sealant { + case pending(Handlers) + case resolved(R) +} + +class Handlers { + var bodies: [(R) -> Void] = [] + func append(_ item: @escaping(R) -> Void) { bodies.append(item) } +} + +/// - Remark: not protocol ∵ http://www.russbishop.net/swift-associated-types-cont +class Box { + func inspect() -> Sealant { fatalError() } + func inspect(_: (Sealant) -> Void) { fatalError() } + func seal(_: T) {} +} + +class SealedBox: Box { + let value: T + + init(value: T) { + self.value = value + } + + override func inspect() -> Sealant { + return .resolved(value) + } +} + +class EmptyBox: Box { + private var sealant = Sealant.pending(.init()) + private let barrier = DispatchQueue(label: "org.promisekit.barrier", attributes: .concurrent) + + override func seal(_ value: T) { + var handlers: Handlers! + barrier.sync(flags: .barrier) { + guard case .pending(let _handlers) = self.sealant else { + return // already fulfilled! + } + handlers = _handlers + self.sealant = .resolved(value) + } + + //FIXME we are resolved so should `pipe(to:)` be called at this instant, “thens are called in order” would be invalid + //NOTE we don’t do this in the above `sync` because that could potentially deadlock + //THOUGH since `then` etc. typically invoke after a run-loop cycle, this issue is somewhat less severe + + if let handlers = handlers { + handlers.bodies.forEach{ $0(value) } + } + + //TODO solution is an unfortunate third state “sealed” where then's get added + // to a separate handler pool for that state + // any other solution has potential races + } + + override func inspect() -> Sealant { + var rv: Sealant! + barrier.sync { + rv = self.sealant + } + return rv + } + + override func inspect(_ body: (Sealant) -> Void) { + var sealed = false + barrier.sync(flags: .barrier) { + switch sealant { + case .pending: + // body will append to handlers, so we must stay barrier’d + body(sealant) + case .resolved: + sealed = true + } + } + if sealed { + // we do this outside the barrier to prevent potential deadlocks + // it's safe because we never transition away from this state + body(sealant) + } + } +} + + +extension Optional where Wrapped: DispatchQueue { + @inline(__always) + func async(flags: DispatchWorkItemFlags?, _ body: @escaping() -> Void) { + switch self { + case .none: + body() + case .some(let q): + if let flags = flags { + q.async(flags: flags, execute: body) + } else { + q.async(execute: body) + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/Catchable.swift b/Carthage/Checkouts/PromiseKit/Sources/Catchable.swift new file mode 100644 index 0000000..41ec727 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Catchable.swift @@ -0,0 +1,256 @@ +import Dispatch + +/// Provides `catch` and `recover` to your object that conforms to `Thenable` +public protocol CatchMixin: Thenable +{} + +public extension CatchMixin { + + /** + The provided closure executes when this promise rejects. + + Rejecting a promise cascades: rejecting all subsequent promises (unless + recover is invoked) thus you will typically place your catch at the end + of a chain. Often utility promises will not have a catch, instead + delegating the error handling to the caller. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter policy: The default policy does not execute your handler for cancellation errors. + - Parameter execute: The handler to execute if this promise is rejected. + - Returns: A promise finalizer. + - SeeAlso: [Cancellation](http://promisekit.org/docs/) + */ + @discardableResult + func `catch`(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, policy: CatchPolicy = conf.catchPolicy, _ body: @escaping(Error) -> Void) -> PMKFinalizer { + let finalizer = PMKFinalizer() + pipe { + switch $0 { + case .rejected(let error): + guard policy == .allErrors || !error.isCancelled else { + fallthrough + } + on.async(flags: flags) { + body(error) + finalizer.pending.resolve(()) + } + case .fulfilled: + finalizer.pending.resolve(()) + } + } + return finalizer + } +} + +public class PMKFinalizer { + let pending = Guarantee.pending() + + /// `finally` is the same as `ensure`, but it is not chainable + public func finally(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, _ body: @escaping () -> Void) { + pending.guarantee.done(on: on, flags: flags) { + body() + } + } +} + + +public extension CatchMixin { + + /** + The provided closure executes when this promise rejects. + + Unlike `catch`, `recover` continues the chain. + Use `recover` in circumstances where recovering the chain from certain errors is a possibility. For example: + + firstly { + CLLocationManager.requestLocation() + }.recover { error in + guard error == CLError.unknownLocation else { throw error } + return .value(CLLocation.chicago) + } + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The handler to execute if this promise is rejected. + - SeeAlso: [Cancellation](http://promisekit.org/docs/) + */ + func recover(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, policy: CatchPolicy = conf.catchPolicy, _ body: @escaping(Error) throws -> U) -> Promise where U.T == T { + let rp = Promise(.pending) + pipe { + switch $0 { + case .fulfilled(let value): + rp.box.seal(.fulfilled(value)) + case .rejected(let error): + if policy == .allErrors || !error.isCancelled { + on.async(flags: flags) { + do { + let rv = try body(error) + guard rv !== rp else { throw PMKError.returnedSelf } + rv.pipe(to: rp.box.seal) + } catch { + rp.box.seal(.rejected(error)) + } + } + } else { + rp.box.seal(.rejected(error)) + } + } + } + return rp + } + + /** + The provided closure executes when this promise rejects. + This variant of `recover` requires the handler to return a Guarantee, thus it returns a Guarantee itself and your closure cannot `throw`. + - Note it is logically impossible for this to take a `catchPolicy`, thus `allErrors` are handled. + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The handler to execute if this promise is rejected. + - SeeAlso: [Cancellation](http://promisekit.org/docs/) + */ + @discardableResult + func recover(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ body: @escaping(Error) -> Guarantee) -> Guarantee { + let rg = Guarantee(.pending) + pipe { + switch $0 { + case .fulfilled(let value): + rg.box.seal(value) + case .rejected(let error): + on.async(flags: flags) { + body(error).pipe(to: rg.box.seal) + } + } + } + return rg + } + + /** + The provided closure executes when this promise resolves, whether it rejects or not. + + firstly { + UIApplication.shared.networkActivityIndicatorVisible = true + }.done { + //… + }.ensure { + UIApplication.shared.networkActivityIndicatorVisible = false + }.catch { + //… + } + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The closure that executes when this promise resolves. + - Returns: A new promise, resolved with this promise’s resolution. + */ + func ensure(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, _ body: @escaping () -> Void) -> Promise { + let rp = Promise(.pending) + pipe { result in + on.async(flags: flags) { + body() + rp.box.seal(result) + } + } + return rp + } + + /** + The provided closure executes when this promise resolves, whether it rejects or not. + The chain waits on the returned `Guarantee`. + + firstly { + setup() + }.done { + //… + }.ensureThen { + teardown() // -> Guarante + }.catch { + //… + } + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The closure that executes when this promise resolves. + - Returns: A new promise, resolved with this promise’s resolution. + */ + func ensureThen(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, _ body: @escaping () -> Guarantee) -> Promise { + let rp = Promise(.pending) + pipe { result in + on.async(flags: flags) { + body().done { + rp.box.seal(result) + } + } + } + return rp + } + + + + /** + Consumes the Swift unused-result warning. + - Note: You should `catch`, but in situations where you know you don’t need a `catch`, `cauterize` makes your intentions clear. + */ + @discardableResult + func cauterize() -> PMKFinalizer { + return self.catch { + Swift.print("PromiseKit:cauterized-error:", $0) + } + } +} + + +public extension CatchMixin where T == Void { + + /** + The provided closure executes when this promise rejects. + + This variant of `recover` is specialized for `Void` promises and de-errors your chain returning a `Guarantee`, thus you cannot `throw` and you must handle all errors including cancellation. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The handler to execute if this promise is rejected. + - SeeAlso: [Cancellation](http://promisekit.org/docs/) + */ + @discardableResult + func recover(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ body: @escaping(Error) -> Void) -> Guarantee { + let rg = Guarantee(.pending) + pipe { + switch $0 { + case .fulfilled: + rg.box.seal(()) + case .rejected(let error): + on.async(flags: flags) { + body(error) + rg.box.seal(()) + } + } + } + return rg + } + + /** + The provided closure executes when this promise rejects. + + This variant of `recover` ensures that no error is thrown from the handler and allows specifying a catch policy. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The handler to execute if this promise is rejected. + - SeeAlso: [Cancellation](http://promisekit.org/docs/) + */ + func recover(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, policy: CatchPolicy = conf.catchPolicy, _ body: @escaping(Error) throws -> Void) -> Promise { + let rg = Promise(.pending) + pipe { + switch $0 { + case .fulfilled: + rg.box.seal(.fulfilled(())) + case .rejected(let error): + if policy == .allErrors || !error.isCancelled { + on.async(flags: flags) { + do { + rg.box.seal(.fulfilled(try body(error))) + } catch { + rg.box.seal(.rejected(error)) + } + } + } else { + rg.box.seal(.rejected(error)) + } + } + } + return rg + } +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/Configuration.swift b/Carthage/Checkouts/PromiseKit/Sources/Configuration.swift new file mode 100644 index 0000000..4891c45 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Configuration.swift @@ -0,0 +1,13 @@ +import Dispatch + +/// PromiseKit’s configurable parameters +public struct PMKConfiguration { + /// The default queues that promises handlers dispatch to + public var Q: (map: DispatchQueue?, return: DispatchQueue?) = (map: DispatchQueue.main, return: DispatchQueue.main) + + /// The default catch-policy for all `catch` and `resolve` + public var catchPolicy = CatchPolicy.allErrorsExceptCancellation +} + +/// Modify this as soon as possible in your application’s lifetime +public var conf = PMKConfiguration() diff --git a/Carthage/Checkouts/PromiseKit/Sources/CustomStringConvertible.swift b/Carthage/Checkouts/PromiseKit/Sources/CustomStringConvertible.swift new file mode 100644 index 0000000..eee0b02 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/CustomStringConvertible.swift @@ -0,0 +1,44 @@ + +extension Promise: CustomStringConvertible { + /// - Returns: A description of the state of this promise. + public var description: String { + switch result { + case nil: + return "Promise(…\(T.self))" + case .rejected(let error)?: + return "Promise(\(error))" + case .fulfilled(let value)?: + return "Promise(\(value))" + } + } +} + +extension Promise: CustomDebugStringConvertible { + /// - Returns: A debug-friendly description of the state of this promise. + public var debugDescription: String { + switch box.inspect() { + case .pending(let handlers): + return "Promise<\(T.self)>.pending(handlers: \(handlers.bodies.count))" + case .resolved(.rejected(let error)): + return "Promise<\(T.self)>.rejected(\(type(of: error)).\(error))" + case .resolved(.fulfilled(let value)): + return "Promise<\(T.self)>.fulfilled(\(value))" + } + } +} + +#if !SWIFT_PACKAGE +extension AnyPromise { + /// - Returns: A description of the state of this promise. + override open var description: String { + switch box.inspect() { + case .pending: + return "AnyPromise(…)" + case .resolved(let obj?): + return "AnyPromise(\(obj))" + case .resolved(nil): + return "AnyPromise(nil)" + } + } +} +#endif diff --git a/Carthage/Checkouts/PromiseKit/Sources/Deprecations.swift b/Carthage/Checkouts/PromiseKit/Sources/Deprecations.swift new file mode 100644 index 0000000..ac4eb36 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Deprecations.swift @@ -0,0 +1,93 @@ +import Dispatch + +@available(*, deprecated, message: "See `init(resolver:)`") +public func wrap(_ body: (@escaping (T?, Error?) -> Void) throws -> Void) -> Promise { + return Promise { seal in + try body(seal.resolve) + } +} + +@available(*, deprecated, message: "See `init(resolver:)`") +public func wrap(_ body: (@escaping (T, Error?) -> Void) throws -> Void) -> Promise { + return Promise { seal in + try body(seal.resolve) + } +} + +@available(*, deprecated, message: "See `init(resolver:)`") +public func wrap(_ body: (@escaping (Error?, T?) -> Void) throws -> Void) -> Promise { + return Promise { seal in + try body(seal.resolve) + } +} + +@available(*, deprecated, message: "See `init(resolver:)`") +public func wrap(_ body: (@escaping (Error?) -> Void) throws -> Void) -> Promise { + return Promise { seal in + try body(seal.resolve) + } +} + +@available(*, deprecated, message: "See `init(resolver:)`") +public func wrap(_ body: (@escaping (T) -> Void) throws -> Void) -> Promise { + return Promise { seal in + try body(seal.fulfill) + } +} + +public extension Promise { + @available(*, deprecated, message: "See `ensure`") + public func always(on q: DispatchQueue = .main, execute body: @escaping () -> Void) -> Promise { + return ensure(on: q, body) + } +} + +public extension Thenable { +#if PMKFullDeprecations + /// disabled due to ambiguity with the other `.flatMap` + @available(*, deprecated: 6.1, message: "See: `compactMap`") + func flatMap(on: DispatchQueue? = conf.Q.map, _ transform: @escaping(T) throws -> U?) -> Promise { + return compactMap(on: on, transform) + } +#endif +} + +public extension Thenable where T: Sequence { +#if PMKFullDeprecations + /// disabled due to ambiguity with the other `.map` + @available(*, deprecated, message: "See: `mapValues`") + func map(on: DispatchQueue? = conf.Q.map, _ transform: @escaping(T.Iterator.Element) throws -> U) -> Promise<[U]> { + return mapValues(on: on, transform) + } + + /// disabled due to ambiguity with the other `.flatMap` + @available(*, deprecated, message: "See: `flatMapValues`") + func flatMap(on: DispatchQueue? = conf.Q.map, _ transform: @escaping(T.Iterator.Element) throws -> U) -> Promise<[U.Iterator.Element]> { + return flatMapValues(on: on, transform) + } +#endif + + @available(*, deprecated, message: "See: `filterValues`") + func filter(on: DispatchQueue? = conf.Q.map, test: @escaping (T.Iterator.Element) -> Bool) -> Promise<[T.Iterator.Element]> { + return filterValues(on: on, test) + } +} + +public extension Thenable where T: Collection { + @available(*, deprecated, message: "See: `firstValue`") + var first: Promise { + return firstValue + } + + @available(*, deprecated, message: "See: `lastValue`") + var last: Promise { + return lastValue + } +} + +public extension Thenable where T: Sequence, T.Iterator.Element: Comparable { + @available(*, deprecated, message: "See: `sortedValues`") + func sorted(on: DispatchQueue? = conf.Q.map) -> Promise<[T.Iterator.Element]> { + return sortedValues(on: on) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/Error.swift b/Carthage/Checkouts/PromiseKit/Sources/Error.swift new file mode 100644 index 0000000..7229e6f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Error.swift @@ -0,0 +1,103 @@ +import Foundation + +public enum PMKError: Error { + /** + The completionHandler with form `(T?, Error?)` was called with `(nil, nil)`. + This is invalid as per Cocoa/Apple calling conventions. + */ + case invalidCallingConvention + + /** + A handler returned its own promise. 99% of the time, this is likely a + programming error. It is also invalid per Promises/A+. + */ + case returnedSelf + + /** `when()`, `race()` etc. were called with invalid parameters, eg. an empty array. */ + case badInput + + /// The operation was cancelled + case cancelled + + /// `nil` was returned from `flatMap` + @available(*, deprecated, message: "See: `compactMap`") + case flatMap(Any, Any.Type) + + /// `nil` was returned from `compactMap` + case compactMap(Any, Any.Type) + + /** + The lastValue or firstValue of a sequence was requested but the sequence was empty. + + Also used if all values of this collection failed the test passed to `firstValue(where:)`. + */ + case emptySequence +} + +extension PMKError: CustomDebugStringConvertible { + public var debugDescription: String { + switch self { + case .flatMap(let obj, let type): + return "Could not `flatMap<\(type)>`: \(obj)" + case .compactMap(let obj, let type): + return "Could not `compactMap<\(type)>`: \(obj)" + case .invalidCallingConvention: + return "A closure was called with an invalid calling convention, probably (nil, nil)" + case .returnedSelf: + return "A promise handler returned itself" + case .badInput: + return "Bad input was provided to a PromiseKit function" + case .cancelled: + return "The asynchronous sequence was cancelled" + case .emptySequence: + return "The first or last element was requested for an empty sequence" + } + } +} + +extension PMKError: LocalizedError { + public var errorDescription: String? { + return debugDescription + } +} + + +//////////////////////////////////////////////////////////// Cancellation + +/// An error that may represent the cancelled condition +public protocol CancellableError: Error { + /// returns true if this Error represents a cancelled condition + var isCancelled: Bool { get } +} + +extension Error { + public var isCancelled: Bool { + do { + throw self + } catch PMKError.cancelled { + return true + } catch let error as CancellableError { + return error.isCancelled + } catch URLError.cancelled { + return true + } catch CocoaError.userCancelled { + return true + } catch { + #if os(macOS) || os(iOS) || os(tvOS) + let pair = { ($0.domain, $0.code) }(error as NSError) + return ("SKErrorDomain", 2) == pair + #else + return false + #endif + } + } +} + +/// Used by `catch` and `recover` +public enum CatchPolicy { + /// Indicates that `catch` or `recover` handle all error types including cancellable-errors. + case allErrors + + /// Indicates that `catch` or `recover` handle all error except cancellable-errors. + case allErrorsExceptCancellation +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/Guarantee.swift b/Carthage/Checkouts/PromiseKit/Sources/Guarantee.swift new file mode 100644 index 0000000..3007599 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Guarantee.swift @@ -0,0 +1,201 @@ +import class Foundation.Thread +import Dispatch + +/** + A `Guarantee` is a functional abstraction around an asynchronous operation that cannot error. + - See: `Thenable` +*/ +public class Guarantee: Thenable { + let box: Box + + fileprivate init(box: SealedBox) { + self.box = box + } + + /// Returns a `Guarantee` sealed with the provided value. + public static func value(_ value: T) -> Guarantee { + return .init(box: SealedBox(value: value)) + } + + /// Returns a pending `Guarantee` that can be resolved with the provided closure’s parameter. + public init(resolver body: (@escaping(T) -> Void) -> Void) { + box = EmptyBox() + body(box.seal) + } + + /// - See: `Thenable.pipe` + public func pipe(to: @escaping(Result) -> Void) { + pipe{ to(.fulfilled($0)) } + } + + func pipe(to: @escaping(T) -> Void) { + switch box.inspect() { + case .pending: + box.inspect { + switch $0 { + case .pending(let handlers): + handlers.append(to) + case .resolved(let value): + to(value) + } + } + case .resolved(let value): + to(value) + } + } + + /// - See: `Thenable.result` + public var result: Result? { + switch box.inspect() { + case .pending: + return nil + case .resolved(let value): + return .fulfilled(value) + } + } + + init(_: PMKUnambiguousInitializer) { + box = EmptyBox() + } + + /// Returns a tuple of a pending `Guarantee` and a function that resolves it. + public class func pending() -> (guarantee: Guarantee, resolve: (T) -> Void) { + return { ($0, $0.box.seal) }(Guarantee(.pending)) + } +} + +public extension Guarantee { + @discardableResult + func done(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, _ body: @escaping(T) -> Void) -> Guarantee { + let rg = Guarantee(.pending) + pipe { (value: T) in + on.async(flags: flags) { + body(value) + rg.box.seal(()) + } + } + return rg + } + + func get(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, _ body: @escaping (T) -> Void) -> Guarantee { + return map(on: on, flags: flags) { + body($0) + return $0 + } + } + + func map(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ body: @escaping(T) -> U) -> Guarantee { + let rg = Guarantee(.pending) + pipe { value in + on.async(flags: flags) { + rg.box.seal(body(value)) + } + } + return rg + } + + @discardableResult + func then(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ body: @escaping(T) -> Guarantee) -> Guarantee { + let rg = Guarantee(.pending) + pipe { value in + on.async(flags: flags) { + body(value).pipe(to: rg.box.seal) + } + } + return rg + } + + public func asVoid() -> Guarantee { + return map(on: nil) { _ in } + } + + /** + Blocks this thread, so you know, don’t call this on a serial thread that + any part of your chain may use. Like the main thread for example. + */ + public func wait() -> T { + + if Thread.isMainThread { + print("PromiseKit: warning: `wait()` called on main thread!") + } + + var result = value + + if result == nil { + let group = DispatchGroup() + group.enter() + pipe { (foo: T) in result = foo; group.leave() } + group.wait() + } + + return result! + } +} + +public extension Guarantee where T: Sequence { + + /** + `Guarantee<[T]>` => `T` -> `Guarantee` => `Guaranetee<[U]>` + + firstly { + .value([1,2,3]) + }.thenMap { + .value($0 * 2) + }.done { + // $0 => [2,4,6] + } + */ + func thenMap(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ transform: @escaping(T.Iterator.Element) -> Guarantee) -> Guarantee<[U]> { + return then(on: on, flags: flags) { + when(fulfilled: $0.map(transform)) + }.recover { + // if happens then is bug inside PromiseKit + fatalError(String(describing: $0)) + } + } +} + +#if swift(>=3.1) +public extension Guarantee where T == Void { + convenience init() { + self.init(box: SealedBox(value: Void())) + } +} +#endif + + +public extension DispatchQueue { + /** + Asynchronously executes the provided closure on a dispatch queue. + + DispatchQueue.global().async(.promise) { + md5(input) + }.done { md5 in + //… + } + + - Parameter body: The closure that resolves this promise. + - Returns: A new `Guarantee` resolved by the result of the provided closure. + - Note: There is no Promise/Thenable version of this due to Swift compiler ambiguity issues. + */ + @available(macOS 10.10, iOS 2.0, tvOS 10.0, watchOS 2.0, *) + final func async(_: PMKNamespacer, group: DispatchGroup? = nil, qos: DispatchQoS = .default, flags: DispatchWorkItemFlags = [], execute body: @escaping () -> T) -> Guarantee { + let rg = Guarantee(.pending) + async(group: group, qos: qos, flags: flags) { + rg.box.seal(body()) + } + return rg + } +} + + +#if os(Linux) +import func CoreFoundation._CFIsMainThread + +extension Thread { + // `isMainThread` is not implemented yet in swift-corelibs-foundation. + static var isMainThread: Bool { + return _CFIsMainThread() + } +} +#endif diff --git a/Carthage/Checkouts/PromiseKit/Sources/Info.plist b/Carthage/Checkouts/PromiseKit/Sources/Info.plist new file mode 100644 index 0000000..3a619de --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + $(CURRENT_PROJECT_VERSION) + CFBundleSignature + ???? + CFBundleVersion + 1 + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/Carthage/Checkouts/PromiseKit/Sources/NSMethodSignatureForBlock.m b/Carthage/Checkouts/PromiseKit/Sources/NSMethodSignatureForBlock.m new file mode 100644 index 0000000..700c1b3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/NSMethodSignatureForBlock.m @@ -0,0 +1,77 @@ +#import + +struct PMKBlockLiteral { + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int flags; + int reserved; + void (*invoke)(void *, ...); + struct block_descriptor { + unsigned long int reserved; // NULL + unsigned long int size; // sizeof(struct Block_literal_1) + // optional helper functions + void (*copy_helper)(void *dst, void *src); // IFF (1<<25) + void (*dispose_helper)(void *src); // IFF (1<<25) + // required ABI.2010.3.16 + const char *signature; // IFF (1<<30) + } *descriptor; + // imported variables +}; + +typedef NS_OPTIONS(NSUInteger, PMKBlockDescriptionFlags) { + PMKBlockDescriptionFlagsHasCopyDispose = (1 << 25), + PMKBlockDescriptionFlagsHasCtor = (1 << 26), // helpers have C++ code + PMKBlockDescriptionFlagsIsGlobal = (1 << 28), + PMKBlockDescriptionFlagsHasStret = (1 << 29), // IFF BLOCK_HAS_SIGNATURE + PMKBlockDescriptionFlagsHasSignature = (1 << 30) +}; + +// It appears 10.7 doesn't support quotes in method signatures. Remove them +// via @rabovik's method. See https://github.com/OliverLetterer/SLObjectiveCRuntimeAdditions/pull/2 +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 +NS_INLINE static const char * pmk_removeQuotesFromMethodSignature(const char *str){ + char *result = malloc(strlen(str) + 1); + BOOL skip = NO; + char *to = result; + char c; + while ((c = *str++)) { + if ('"' == c) { + skip = !skip; + continue; + } + if (skip) continue; + *to++ = c; + } + *to = '\0'; + return result; +} +#endif + +static NSMethodSignature *NSMethodSignatureForBlock(id block) { + if (!block) + return nil; + + struct PMKBlockLiteral *blockRef = (__bridge struct PMKBlockLiteral *)block; + PMKBlockDescriptionFlags flags = (PMKBlockDescriptionFlags)blockRef->flags; + + if (flags & PMKBlockDescriptionFlagsHasSignature) { + void *signatureLocation = blockRef->descriptor; + signatureLocation += sizeof(unsigned long int); + signatureLocation += sizeof(unsigned long int); + + if (flags & PMKBlockDescriptionFlagsHasCopyDispose) { + signatureLocation += sizeof(void(*)(void *dst, void *src)); + signatureLocation += sizeof(void (*)(void *src)); + } + + const char *signature = (*(const char **)signatureLocation); +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 + signature = pmk_removeQuotesFromMethodSignature(signature); + NSMethodSignature *nsSignature = [NSMethodSignature signatureWithObjCTypes:signature]; + free((void *)signature); + + return nsSignature; +#endif + return [NSMethodSignature signatureWithObjCTypes:signature]; + } + return 0; +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/PMKCallVariadicBlock.m b/Carthage/Checkouts/PromiseKit/Sources/PMKCallVariadicBlock.m new file mode 100644 index 0000000..1453a7d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/PMKCallVariadicBlock.m @@ -0,0 +1,120 @@ +#import "NSMethodSignatureForBlock.m" +#import +#import +#import "AnyPromise+Private.h" +#import +#import +#import + +#ifndef PMKLog +#define PMKLog NSLog +#endif + +@interface PMKArray : NSObject { +@public + id objs[3]; + NSUInteger count; +} @end + +@implementation PMKArray + +- (id)objectAtIndexedSubscript:(NSUInteger)idx { + if (count <= idx) { + // this check is necessary due to lack of checks in `pmk_safely_call_block` + return nil; + } + return objs[idx]; +} + +@end + +id __PMKArrayWithCount(NSUInteger count, ...) { + PMKArray *this = [PMKArray new]; + this->count = count; + va_list args; + va_start(args, count); + for (NSUInteger x = 0; x < count; ++x) + this->objs[x] = va_arg(args, id); + va_end(args); + return this; +} + + +static inline id _PMKCallVariadicBlock(id frock, id result) { + NSCAssert(frock, @""); + + NSMethodSignature *sig = NSMethodSignatureForBlock(frock); + const NSUInteger nargs = sig.numberOfArguments; + const char rtype = sig.methodReturnType[0]; + + #define call_block_with_rtype(type) ({^type{ \ + switch (nargs) { \ + case 1: \ + return ((type(^)(void))frock)(); \ + case 2: { \ + const id arg = [result class] == [PMKArray class] ? result[0] : result; \ + return ((type(^)(id))frock)(arg); \ + } \ + case 3: { \ + type (^block)(id, id) = frock; \ + return [result class] == [PMKArray class] \ + ? block(result[0], result[1]) \ + : block(result, nil); \ + } \ + case 4: { \ + type (^block)(id, id, id) = frock; \ + return [result class] == [PMKArray class] \ + ? block(result[0], result[1], result[2]) \ + : block(result, nil, nil); \ + } \ + default: \ + @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"PromiseKit: The provided block’s argument count is unsupported." userInfo:nil]; \ + }}();}) + + switch (rtype) { + case 'v': + call_block_with_rtype(void); + return nil; + case '@': + return call_block_with_rtype(id) ?: nil; + case '*': { + char *str = call_block_with_rtype(char *); + return str ? @(str) : nil; + } + case 'c': return @(call_block_with_rtype(char)); + case 'i': return @(call_block_with_rtype(int)); + case 's': return @(call_block_with_rtype(short)); + case 'l': return @(call_block_with_rtype(long)); + case 'q': return @(call_block_with_rtype(long long)); + case 'C': return @(call_block_with_rtype(unsigned char)); + case 'I': return @(call_block_with_rtype(unsigned int)); + case 'S': return @(call_block_with_rtype(unsigned short)); + case 'L': return @(call_block_with_rtype(unsigned long)); + case 'Q': return @(call_block_with_rtype(unsigned long long)); + case 'f': return @(call_block_with_rtype(float)); + case 'd': return @(call_block_with_rtype(double)); + case 'B': return @(call_block_with_rtype(_Bool)); + case '^': + if (strcmp(sig.methodReturnType, "^v") == 0) { + call_block_with_rtype(void); + return nil; + } + // else fall through! + default: + @throw [NSException exceptionWithName:@"PromiseKit" reason:@"PromiseKit: Unsupported method signature." userInfo:nil]; + } +} + +static id PMKCallVariadicBlock(id frock, id result) { + @try { + return _PMKCallVariadicBlock(frock, result); + } @catch (id thrown) { + if ([thrown isKindOfClass:[NSString class]]) + return thrown; + if ([thrown isKindOfClass:[NSError class]]) + return thrown; + + // we don’t catch objc exceptions: they are meant to crash your app + @throw thrown; + } +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/Promise.swift b/Carthage/Checkouts/PromiseKit/Sources/Promise.swift new file mode 100644 index 0000000..c78ae85 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Promise.swift @@ -0,0 +1,179 @@ +import class Foundation.Thread +import Dispatch + +/** + A `Promise` is a functional abstraction around a failable asynchronous operation. + - See: `Thenable` + */ +public class Promise: Thenable, CatchMixin { + let box: Box> + + fileprivate init(box: SealedBox>) { + self.box = box + } + + /** + Initialize a new fulfilled promise. + + We do not provide `init(value:)` because Swift is “greedy” + and would pick that initializer in cases where it should pick + one of the other more specific options leading to Promises with + `T` that is eg: `Error` or worse `(T->Void,Error->Void)` for + uses of our PMK < 4 pending initializer due to Swift trailing + closure syntax (nothing good comes without pain!). + + Though often easy to detect, sometimes these issues would be + hidden by other type inference leading to some nasty bugs in + production. + + In PMK5 we tried to work around this by making the pending + initializer take the form `Promise(.pending)` but this led to + bad migration errors for PMK4 users. Hence instead we quickly + released PMK6 and now only provide this initializer for making + sealed & fulfilled promises. + + Usage is still (usually) good: + + guard foo else { + return .value(bar) + } + */ + public class func value(_ value: T) -> Promise { + return Promise(box: SealedBox(value: .fulfilled(value))) + } + + /// Initialize a new rejected promise. + public init(error: Error) { + box = SealedBox(value: .rejected(error)) + } + + /// Initialize a new promise bound to the provided `Thenable`. + public init(_ bridge: U) where U.T == T { + box = EmptyBox() + bridge.pipe(to: box.seal) + } + + /// Initialize a new promise that can be resolved with the provided `Resolver`. + public init(resolver body: (Resolver) throws -> Void) { + box = EmptyBox() + let resolver = Resolver(box) + do { + try body(resolver) + } catch { + resolver.reject(error) + } + } + + /// - Returns: a tuple of a new pending promise and its `Resolver`. + public class func pending() -> (promise: Promise, resolver: Resolver) { + return { ($0, Resolver($0.box)) }(Promise(.pending)) + } + + /// - See: `Thenable.pipe` + public func pipe(to: @escaping(Result) -> Void) { + switch box.inspect() { + case .pending: + box.inspect { + switch $0 { + case .pending(let handlers): + handlers.append(to) + case .resolved(let value): + to(value) + } + } + case .resolved(let value): + to(value) + } + } + + /// - See: `Thenable.result` + public var result: Result? { + switch box.inspect() { + case .pending: + return nil + case .resolved(let result): + return result + } + } + + init(_: PMKUnambiguousInitializer) { + box = EmptyBox() + } +} + +public extension Promise { + /** + Blocks this thread, so—you know—don’t call this on a serial thread that + any part of your chain may use. Like the main thread for example. + */ + func wait() throws -> T { + + if Thread.isMainThread { + Swift.print("PromiseKit: warning: `wait()` called on main thread!") + } + + var result = self.result + + if result == nil { + let group = DispatchGroup() + group.enter() + pipe { result = $0; group.leave() } + group.wait() + } + + switch result! { + case .rejected(let error): + throw error + case .fulfilled(let value): + return value + } + } +} + +#if swift(>=3.1) +extension Promise where T == Void { + /// Initializes a new promise fulfilled with `Void` + public convenience init() { + self.init(box: SealedBox(value: .fulfilled(Void()))) + } +} +#endif + + +public extension DispatchQueue { + /** + Asynchronously executes the provided closure on a dispatch queue. + + DispatchQueue.global().async(.promise) { + try md5(input) + }.done { md5 in + //… + } + + - Parameter body: The closure that resolves this promise. + - Returns: A new `Promise` resolved by the result of the provided closure. + - Note: There is no Promise/Thenable version of this due to Swift compiler ambiguity issues. + */ + @available(macOS 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *) + final func async(_: PMKNamespacer, group: DispatchGroup? = nil, qos: DispatchQoS = .default, flags: DispatchWorkItemFlags = [], execute body: @escaping () throws -> T) -> Promise { + let promise = Promise(.pending) + async(group: group, qos: qos, flags: flags) { + do { + promise.box.seal(.fulfilled(try body())) + } catch { + promise.box.seal(.rejected(error)) + } + } + return promise + } +} + + +/// used by our extensions to provide unambiguous functions with the same name as the original function +public enum PMKNamespacer { + case promise +} + +enum PMKUnambiguousInitializer { + case pending +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/PromiseKit.h b/Carthage/Checkouts/PromiseKit/Sources/PromiseKit.h new file mode 100644 index 0000000..2651530 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/PromiseKit.h @@ -0,0 +1,7 @@ +#import "fwd.h" +#import "AnyPromise.h" + +#import // `FOUNDATION_EXPORT` + +FOUNDATION_EXPORT double PromiseKitVersionNumber; +FOUNDATION_EXPORT const unsigned char PromiseKitVersionString[]; diff --git a/Carthage/Checkouts/PromiseKit/Sources/Resolver.swift b/Carthage/Checkouts/PromiseKit/Sources/Resolver.swift new file mode 100644 index 0000000..ac58a76 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Resolver.swift @@ -0,0 +1,85 @@ +/// An object for resolving promises +public class Resolver { + let box: Box> + + init(_ box: Box>) { + self.box = box + } + + deinit { + if case .pending = box.inspect() { + print("PromiseKit: warning: pending promise deallocated") + } + } +} + +public extension Resolver { + /// Fulfills the promise with the provided value + func fulfill(_ value: T) { + box.seal(.fulfilled(value)) + } + + /// Rejects the promise with the provided error + func reject(_ error: Error) { + box.seal(.rejected(error)) + } + + /// Resolves the promise with the provided result + public func resolve(_ result: Result) { + box.seal(result) + } + + /// Resolves the promise with the provided value or error + public func resolve(_ obj: T?, _ error: Error?) { + if let error = error { + reject(error) + } else if let obj = obj { + fulfill(obj) + } else { + reject(PMKError.invalidCallingConvention) + } + } + + /// Fulfills the promise with the provided value unless the provided error is non-nil + public func resolve(_ obj: T, _ error: Error?) { + if let error = error { + reject(error) + } else { + fulfill(obj) + } + } + + /// Resolves the promise, provided for non-conventional value-error ordered completion handlers. + public func resolve(_ error: Error?, _ obj: T?) { + resolve(obj, error) + } +} + +#if swift(>=3.1) +extension Resolver where T == Void { + /// Fulfills the promise unless error is non-nil + public func resolve(_ error: Error?) { + if let error = error { + reject(error) + } else { + fulfill(()) + } + } +} +#endif + +public enum Result { + case fulfilled(T) + case rejected(Error) +} + +public extension PromiseKit.Result { + var isFulfilled: Bool { + switch self { + case .fulfilled: + return true + case .rejected: + return false + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/Thenable.swift b/Carthage/Checkouts/PromiseKit/Sources/Thenable.swift new file mode 100644 index 0000000..7762372 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/Thenable.swift @@ -0,0 +1,424 @@ +import Dispatch + +/// Thenable represents an asynchronous operation that can be chained. +public protocol Thenable: class { + /// The type of the wrapped value + associatedtype T + + /// `pipe` is immediately executed when this `Thenable` is resolved + func pipe(to: @escaping(Result) -> Void) + + /// The resolved result or nil if pending. + var result: Result? { get } +} + +public extension Thenable { + /** + The provided closure executes when this promise resolves. + + This allows chaining promises. The promise returned by the provided closure is resolved before the promise returned by this closure resolves. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The closure that executes when this promise fulfills. It must return a promise. + - Returns: A new promise that resolves when the promise returned from the provided closure resolves. For example: + + firstly { + URLSession.shared.dataTask(.promise, with: url1) + }.then { response in + transform(data: response.data) + }.done { transformation in + //… + } + */ + func then(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ body: @escaping(T) throws -> U) -> Promise { + let rp = Promise(.pending) + pipe { + switch $0 { + case .fulfilled(let value): + on.async(flags: flags) { + do { + let rv = try body(value) + guard rv !== rp else { throw PMKError.returnedSelf } + rv.pipe(to: rp.box.seal) + } catch { + rp.box.seal(.rejected(error)) + } + } + case .rejected(let error): + rp.box.seal(.rejected(error)) + } + } + return rp + } + + /** + The provided closure is executed when this promise is resolved. + + This is like `then` but it requires the closure to return a non-promise. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter transform: The closure that is executed when this Promise is fulfilled. It must return a non-promise. + - Returns: A new promise that is resolved with the value returned from the provided closure. For example: + + firstly { + URLSession.shared.dataTask(.promise, with: url1) + }.map { response in + response.data.length + }.done { length in + //… + } + */ + func map(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ transform: @escaping(T) throws -> U) -> Promise { + let rp = Promise(.pending) + pipe { + switch $0 { + case .fulfilled(let value): + on.async(flags: flags) { + do { + rp.box.seal(.fulfilled(try transform(value))) + } catch { + rp.box.seal(.rejected(error)) + } + } + case .rejected(let error): + rp.box.seal(.rejected(error)) + } + } + return rp + } + + /** + The provided closure is executed when this promise is resolved. + + In your closure return an `Optional`, if you return `nil` the resulting promise is rejected with `PMKError.compactMap`, otherwise the promise is fulfilled with the unwrapped value. + + firstly { + URLSession.shared.dataTask(.promise, with: url) + }.compactMap { + try JSONSerialization.jsonObject(with: $0.data) as? [String: String] + }.done { dictionary in + //… + }.catch { + // either `PMKError.compactMap` or a `JSONError` + } + */ + func compactMap(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ transform: @escaping(T) throws -> U?) -> Promise { + let rp = Promise(.pending) + pipe { + switch $0 { + case .fulfilled(let value): + on.async(flags: flags) { + do { + if let rv = try transform(value) { + rp.box.seal(.fulfilled(rv)) + } else { + throw PMKError.compactMap(value, U.self) + } + } catch { + rp.box.seal(.rejected(error)) + } + } + case .rejected(let error): + rp.box.seal(.rejected(error)) + } + } + return rp + } + + /** + The provided closure is executed when this promise is resolved. + + Equivalent to `map { x -> Void in`, but since we force the `Void` return Swift + is happier and gives you less hassle about your closure’s qualification. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The closure that is executed when this Promise is fulfilled. + - Returns: A new promise fulfilled as `Void`. + + firstly { + URLSession.shared.dataTask(.promise, with: url) + }.done { response in + print(response.data) + } + */ + func done(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, _ body: @escaping(T) throws -> Void) -> Promise { + let rp = Promise(.pending) + pipe { + switch $0 { + case .fulfilled(let value): + on.async(flags: flags) { + do { + try body(value) + rp.box.seal(.fulfilled(())) + } catch { + rp.box.seal(.rejected(error)) + } + } + case .rejected(let error): + rp.box.seal(.rejected(error)) + } + } + return rp + } + + /** + The provided closure is executed when this promise is resolved. + + This is like `done` but it returns the same value that the handler is fed. + `get` immutably accesses the fulfilled value; the returned Promise maintains that value. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The closure that is executed when this Promise is fulfilled. + - Returns: A new promise that is resolved with the value that the handler is fed. For example: + + firstly { + .value(1) + }.get { foo in + print(foo, " is 1") + }.done { foo in + print(foo, " is 1") + }.done { foo in + print(foo, " is Void") + } + */ + func get(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, _ body: @escaping (T) throws -> Void) -> Promise { + return map(on: on, flags: flags) { + try body($0) + return $0 + } + } + + /** + The provided closure is executed with promise result. + + This is like `get` but provides the Result of the Promise so you can inspect the value of the chain at this point without causing any side effects. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The closure that is executed with Result of Promise. + - Returns: A new promise that is resolved with the result that the handler is fed. For example: + + promise.tap{ print($0) }.then{ /*…*/ } + */ + func tap(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ body: @escaping(Result) -> Void) -> Promise { + return Promise { seal in + pipe { result in + on.async(flags: flags) { + body(result) + seal.resolve(result) + } + } + } + } + + /// - Returns: a new promise chained off this promise but with its value discarded. + func asVoid() -> Promise { + return map(on: nil) { _ in } + } +} + +public extension Thenable { + /** + - Returns: The error with which this promise was rejected; `nil` if this promise is not rejected. + */ + var error: Error? { + switch result { + case .none: + return nil + case .some(.fulfilled): + return nil + case .some(.rejected(let error)): + return error + } + } + + /** + - Returns: `true` if the promise has not yet resolved. + */ + var isPending: Bool { + return result == nil + } + + /** + - Returns: `true` if the promise has resolved. + */ + var isResolved: Bool { + return !isPending + } + + /** + - Returns: `true` if the promise was fulfilled. + */ + var isFulfilled: Bool { + return value != nil + } + + /** + - Returns: `true` if the promise was rejected. + */ + var isRejected: Bool { + return error != nil + } + + /** + - Returns: The value with which this promise was fulfilled or `nil` if this promise is pending or rejected. + */ + var value: T? { + switch result { + case .none: + return nil + case .some(.fulfilled(let value)): + return value + case .some(.rejected): + return nil + } + } +} + +public extension Thenable where T: Sequence { + /** + `Promise<[T]>` => `T` -> `U` => `Promise<[U]>` + + firstly { + .value([1,2,3]) + }.mapValues { integer in + integer * 2 + }.done { + // $0 => [2,4,6] + } + */ + func mapValues(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ transform: @escaping(T.Iterator.Element) throws -> U) -> Promise<[U]> { + return map(on: on, flags: flags){ try $0.map(transform) } + } + + /** + `Promise<[T]>` => `T` -> `[U]` => `Promise<[U]>` + + firstly { + .value([1,2,3]) + }.flatMapValues { integer in + [integer, integer] + }.done { + // $0 => [1,1,2,2,3,3] + } + */ + func flatMapValues(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ transform: @escaping(T.Iterator.Element) throws -> U) -> Promise<[U.Iterator.Element]> { + return map(on: on, flags: flags){ (foo: T) in + try foo.flatMap{ try transform($0) } + } + } + + /** + `Promise<[T]>` => `T` -> `U?` => `Promise<[U]>` + + firstly { + .value(["1","2","a","3"]) + }.compactMapValues { + Int($0) + }.done { + // $0 => [1,2,3] + } + */ + func compactMapValues(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ transform: @escaping(T.Iterator.Element) throws -> U?) -> Promise<[U]> { + return map(on: on, flags: flags) { foo -> [U] in + #if !swift(>=3.3) || (swift(>=4) && !swift(>=4.1)) + return try foo.flatMap(transform) + #else + return try foo.compactMap(transform) + #endif + } + } + + /** + `Promise<[T]>` => `T` -> `Promise` => `Promise<[U]>` + + firstly { + .value([1,2,3]) + }.thenMap { integer in + .value(integer * 2) + }.done { + // $0 => [2,4,6] + } + */ + func thenMap(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ transform: @escaping(T.Iterator.Element) throws -> U) -> Promise<[U.T]> { + return then(on: on, flags: flags) { + when(fulfilled: try $0.map(transform)) + } + } + + /** + `Promise<[T]>` => `T` -> `Promise<[U]>` => `Promise<[U]>` + + firstly { + .value([1,2,3]) + }.thenFlatMap { integer in + .value([integer, integer]) + }.done { + // $0 => [1,1,2,2,3,3] + } + */ + func thenFlatMap(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ transform: @escaping(T.Iterator.Element) throws -> U) -> Promise<[U.T.Iterator.Element]> where U.T: Sequence { + return then(on: on, flags: flags) { + when(fulfilled: try $0.map(transform)) + }.map(on: nil) { + $0.flatMap{ $0 } + } + } + + /** + `Promise<[T]>` => `T` -> Bool => `Promise<[U]>` + + firstly { + .value([1,2,3]) + }.filterValues { + $0 > 1 + }.done { + // $0 => [2,3] + } + */ + func filterValues(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, _ isIncluded: @escaping (T.Iterator.Element) -> Bool) -> Promise<[T.Iterator.Element]> { + return map(on: on, flags: flags) { + $0.filter(isIncluded) + } + } +} + +public extension Thenable where T: Collection { + /// - Returns: a promise fulfilled with the first value of this `Collection` or, if empty, a promise rejected with PMKError.emptySequence. + var firstValue: Promise { + return map(on: nil) { aa in + if let a1 = aa.first { + return a1 + } else { + throw PMKError.emptySequence + } + } + } + + func firstValue(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil, where test: @escaping (T.Iterator.Element) -> Bool) -> Promise { + return map(on: on, flags: flags) { + for x in $0 where test(x) { + return x + } + throw PMKError.emptySequence + } + } + + /// - Returns: a promise fulfilled with the last value of this `Collection` or, if empty, a promise rejected with PMKError.emptySequence. + var lastValue: Promise { + return map(on: nil) { aa in + if aa.isEmpty { + throw PMKError.emptySequence + } else { + let i = aa.index(aa.endIndex, offsetBy: -1) + return aa[i] + } + } + } +} + +public extension Thenable where T: Sequence, T.Iterator.Element: Comparable { + /// - Returns: a promise fulfilled with the sorted values of this `Sequence`. + func sortedValues(on: DispatchQueue? = conf.Q.map, flags: DispatchWorkItemFlags? = nil) -> Promise<[T.Iterator.Element]> { + return map(on: on, flags: flags){ $0.sorted() } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/after.m b/Carthage/Checkouts/PromiseKit/Sources/after.m new file mode 100644 index 0000000..25f9966 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/after.m @@ -0,0 +1,14 @@ +#import "AnyPromise.h" +@import Dispatch; +@import Foundation.NSDate; +@import Foundation.NSValue; + +/// @return A promise that fulfills after the specified duration. +AnyPromise *PMKAfter(NSTimeInterval duration) { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)); + dispatch_after(time, dispatch_get_global_queue(0, 0), ^{ + resolve(@(duration)); + }); + }]; +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/after.swift b/Carthage/Checkouts/PromiseKit/Sources/after.swift new file mode 100644 index 0000000..cb29bb8 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/after.swift @@ -0,0 +1,46 @@ +import struct Foundation.TimeInterval +import Dispatch + +/** + after(.seconds(2)).then { + //… + } + +- Returns: A guarantee that resolves after the specified duration. +*/ +public func after(seconds: TimeInterval) -> Guarantee { + let (rg, seal) = Guarantee.pending() + let when = DispatchTime.now() + seconds +#if swift(>=4.0) + q.asyncAfter(deadline: when) { seal(()) } +#else + q.asyncAfter(deadline: when, execute: seal) +#endif + return rg +} + +/** + after(seconds: 1.5).then { + //… + } + + - Returns: A guarantee that resolves after the specified duration. +*/ +public func after(_ interval: DispatchTimeInterval) -> Guarantee { + let (rg, seal) = Guarantee.pending() + let when = DispatchTime.now() + interval +#if swift(>=4.0) + q.asyncAfter(deadline: when) { seal(()) } +#else + q.asyncAfter(deadline: when, execute: seal) +#endif + return rg +} + +private var q: DispatchQueue { + if #available(macOS 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *) { + return DispatchQueue.global(qos: .default) + } else { + return DispatchQueue.global(priority: .default) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/dispatch_promise.m b/Carthage/Checkouts/PromiseKit/Sources/dispatch_promise.m new file mode 100644 index 0000000..ecb89f7 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/dispatch_promise.m @@ -0,0 +1,10 @@ +#import "AnyPromise.h" +@import Dispatch; + +AnyPromise *dispatch_promise_on(dispatch_queue_t queue, id block) { + return [AnyPromise promiseWithValue:nil].thenOn(queue, block); +} + +AnyPromise *dispatch_promise(id block) { + return dispatch_promise_on(dispatch_get_global_queue(0, 0), block); +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/firstly.swift b/Carthage/Checkouts/PromiseKit/Sources/firstly.swift new file mode 100644 index 0000000..a5b477d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/firstly.swift @@ -0,0 +1,39 @@ +import Dispatch + +/** + Judicious use of `firstly` *may* make chains more readable. + + Compare: + + URLSession.shared.dataTask(url: url1).then { + URLSession.shared.dataTask(url: url2) + }.then { + URLSession.shared.dataTask(url: url3) + } + + With: + + firstly { + URLSession.shared.dataTask(url: url1) + }.then { + URLSession.shared.dataTask(url: url2) + }.then { + URLSession.shared.dataTask(url: url3) + } + + - Note: the block you pass excecutes immediately on the current thread/queue. + */ +public func firstly(execute body: () throws -> U) -> Promise { + do { + let rp = Promise(.pending) + try body().pipe(to: rp.box.seal) + return rp + } catch { + return Promise(error: error) + } +} + +/// - See: firstly() +public func firstly(execute body: () -> Guarantee) -> Guarantee { + return body() +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/fwd.h b/Carthage/Checkouts/PromiseKit/Sources/fwd.h new file mode 100644 index 0000000..480d148 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/fwd.h @@ -0,0 +1,165 @@ +#import +#import + +@class AnyPromise; +extern NSString * __nonnull const PMKErrorDomain; + +#define PMKFailingPromiseIndexKey @"PMKFailingPromiseIndexKey" +#define PMKJoinPromisesKey @"PMKJoinPromisesKey" + +#define PMKUnexpectedError 1l +#define PMKInvalidUsageError 3l +#define PMKAccessDeniedError 4l +#define PMKOperationFailed 8l +#define PMKTaskError 9l +#define PMKJoinError 10l + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + @return A new promise that resolves after the specified duration. + + @parameter duration The duration in seconds to wait before this promise is resolve. + + For example: + + PMKAfter(1).then(^{ + //… + }); +*/ +extern AnyPromise * __nonnull PMKAfter(NSTimeInterval duration) NS_REFINED_FOR_SWIFT; + + + +/** + `when` is a mechanism for waiting more than one asynchronous task and responding when they are all complete. + + `PMKWhen` accepts varied input. If an array is passed then when those promises fulfill, when’s promise fulfills with an array of fulfillment values. If a dictionary is passed then the same occurs, but when’s promise fulfills with a dictionary of fulfillments keyed as per the input. + + Interestingly, if a single promise is passed then when waits on that single promise, and if a single non-promise object is passed then when fulfills immediately with that object. If the array or dictionary that is passed contains objects that are not promises, then these objects are considered fulfilled promises. The reason we do this is to allow a pattern know as "abstracting away asynchronicity". + + If *any* of the provided promises reject, the returned promise is immediately rejected with that promise’s rejection. The error’s `userInfo` object is supplemented with `PMKFailingPromiseIndexKey`. + + For example: + + PMKWhen(@[promise1, promise2]).then(^(NSArray *results){ + //… + }); + + @warning *Important* In the event of rejection the other promises will continue to resolve and as per any other promise will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed. In such situations use `PMKJoin`. + + @param input The input upon which to wait before resolving this promise. + + @return A promise that is resolved with either: + + 1. An array of values from the provided array of promises. + 2. The value from the provided promise. + 3. The provided non-promise object. + + @see PMKJoin + +*/ +extern AnyPromise * __nonnull PMKWhen(id __nonnull input) NS_REFINED_FOR_SWIFT; + + + +/** + Creates a new promise that resolves only when all provided promises have resolved. + + Typically, you should use `PMKWhen`. + + For example: + + PMKJoin(@[promise1, promise2]).then(^(NSArray *resultingValues){ + //… + }).catch(^(NSError *error){ + assert(error.domain == PMKErrorDomain); + assert(error.code == PMKJoinError); + + NSArray *promises = error.userInfo[PMKJoinPromisesKey]; + for (AnyPromise *promise in promises) { + if (promise.rejected) { + //… + } + } + }); + + @param promises An array of promises. + + @return A promise that thens three parameters: + + 1) An array of mixed values and errors from the resolved input. + 2) An array of values from the promises that fulfilled. + 3) An array of errors from the promises that rejected or nil if all promises fulfilled. + + @see when +*/ +AnyPromise *__nonnull PMKJoin(NSArray * __nonnull promises) NS_REFINED_FOR_SWIFT; + + + +/** + Literally hangs this thread until the promise has resolved. + + Do not use hang… unless you are testing, playing or debugging. + + If you use it in production code I will literally and honestly cry like a child. + + @return The resolved value of the promise. + + @warning T SAFE. IT IS NOT SAFE. IT IS NOT SAFE. IT IS NOT SAFE. IT IS NO +*/ +extern id __nullable PMKHang(AnyPromise * __nonnull promise); + + + +/** + Executes the provided block on a background queue. + + dispatch_promise is a convenient way to start a promise chain where the + first step needs to run synchronously on a background queue. + + dispatch_promise(^{ + return md5(input); + }).then(^(NSString *md5){ + NSLog(@"md5: %@", md5); + }); + + @param block The block to be executed in the background. Returning an `NSError` will reject the promise, everything else (including void) fulfills the promise. + + @return A promise resolved with the return value of the provided block. + + @see dispatch_async +*/ +extern AnyPromise * __nonnull dispatch_promise(id __nonnull block) NS_SWIFT_UNAVAILABLE("Use our `DispatchQueue.async` override instead"); + + + +/** + Executes the provided block on the specified background queue. + + dispatch_promise_on(myDispatchQueue, ^{ + return md5(input); + }).then(^(NSString *md5){ + NSLog(@"md5: %@", md5); + }); + + @param block The block to be executed in the background. Returning an `NSError` will reject the promise, everything else (including void) fulfills the promise. + + @return A promise resolved with the return value of the provided block. + + @see dispatch_promise +*/ +extern AnyPromise * __nonnull dispatch_promise_on(dispatch_queue_t __nonnull queue, id __nonnull block) NS_SWIFT_UNAVAILABLE("Use our `DispatchQueue.async` override instead"); + +/** + Returns a new promise that resolves when the value of the first resolved promise in the provided array of promises. +*/ +extern AnyPromise * __nonnull PMKRace(NSArray * __nonnull promises) NS_REFINED_FOR_SWIFT; + +#ifdef __cplusplus +} // Extern C +#endif diff --git a/Carthage/Checkouts/PromiseKit/Sources/hang.m b/Carthage/Checkouts/PromiseKit/Sources/hang.m new file mode 100644 index 0000000..913339e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/hang.m @@ -0,0 +1,29 @@ +#import "AnyPromise.h" +#import "AnyPromise+Private.h" +@import CoreFoundation.CFRunLoop; + +/** + Suspends the active thread waiting on the provided promise. + + @return The value of the provided promise once resolved. + */ +id PMKHang(AnyPromise *promise) { + if (promise.pending) { + static CFRunLoopSourceContext context; + + CFRunLoopRef runLoop = CFRunLoopGetCurrent(); + CFRunLoopSourceRef runLoopSource = CFRunLoopSourceCreate(NULL, 0, &context); + CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopDefaultMode); + + promise.ensure(^{ + CFRunLoopStop(runLoop); + }); + while (promise.pending) { + CFRunLoopRun(); + } + CFRunLoopRemoveSource(runLoop, runLoopSource, kCFRunLoopDefaultMode); + CFRelease(runLoopSource); + } + + return promise.value; +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/hang.swift b/Carthage/Checkouts/PromiseKit/Sources/hang.swift new file mode 100644 index 0000000..f974c2f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/hang.swift @@ -0,0 +1,51 @@ +import Foundation +import CoreFoundation + +/** + Runs the active run-loop until the provided promise resolves. + + This is for debug and is not a generally safe function to use in your applications. We mostly provide it for use in testing environments. + + Still if you like, study how it works (by reading the sources!) and use at your own risk. + + - Returns: The value of the resolved promise + - Throws: An error, should the promise be rejected + - See: `wait()` +*/ +public func hang(_ promise: Promise) throws -> T { +#if os(Linux) || os(Android) + // isMainThread is not yet implemented on Linux. + let runLoopModeRaw = RunLoopMode.defaultRunLoopMode.rawValue._bridgeToObjectiveC() + let runLoopMode: CFString = unsafeBitCast(runLoopModeRaw, to: CFString.self) +#else + guard Thread.isMainThread else { + // hang doesn't make sense on threads that aren't the main thread. + // use `.wait()` on those threads. + fatalError("Only call hang() on the main thread.") + } + let runLoopMode: CFRunLoopMode = CFRunLoopMode.defaultMode +#endif + + if promise.isPending { + var context = CFRunLoopSourceContext() + let runLoop = CFRunLoopGetCurrent() + let runLoopSource = CFRunLoopSourceCreate(nil, 0, &context) + CFRunLoopAddSource(runLoop, runLoopSource, runLoopMode) + + _ = promise.ensure { + CFRunLoopStop(runLoop) + } + + while promise.isPending { + CFRunLoopRun() + } + CFRunLoopRemoveSource(runLoop, runLoopSource, runLoopMode) + } + + switch promise.result! { + case .rejected(let error): + throw error + case .fulfilled(let value): + return value + } +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/join.m b/Carthage/Checkouts/PromiseKit/Sources/join.m new file mode 100644 index 0000000..979f092 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/join.m @@ -0,0 +1,54 @@ +@import Foundation.NSDictionary; +#import "AnyPromise+Private.h" +#import +@import Foundation.NSError; +@import Foundation.NSNull; +#import "PromiseKit.h" +#import + +/** + Waits on all provided promises. + + `PMKWhen` rejects as soon as one of the provided promises rejects. `PMKJoin` waits on all provided promises, then rejects if any of those promises rejects, otherwise it fulfills with values from the provided promises. + + - Returns: A new promise that resolves once all the provided promises resolve. +*/ +AnyPromise *PMKJoin(NSArray *promises) { + if (promises == nil) + return [AnyPromise promiseWithValue:[NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"PMKJoin(nil)"}]]; + + if (promises.count == 0) + return [AnyPromise promiseWithValue:promises]; + + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + NSPointerArray *results = NSPointerArrayMake(promises.count); + __block atomic_int countdown = promises.count; + __block BOOL rejected = NO; + + [promises enumerateObjectsUsingBlock:^(AnyPromise *promise, NSUInteger ii, BOOL *stop) { + [promise __pipe:^(id value) { + + if (IsError(value)) { + rejected = YES; + } + + //FIXME surely this isn't thread safe on multiple cores? + [results replacePointerAtIndex:ii withPointer:(__bridge void *)(value ?: [NSNull null])]; + + atomic_fetch_sub_explicit(&countdown, 1, memory_order_relaxed); + + if (countdown == 0) { + if (!rejected) { + resolve(results.allObjects); + } else { + id userInfo = @{PMKJoinPromisesKey: promises}; + id err = [NSError errorWithDomain:PMKErrorDomain code:PMKJoinError userInfo:userInfo]; + resolve(err); + } + } + }]; + + (void) stop; + }]; + }]; +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/race.m b/Carthage/Checkouts/PromiseKit/Sources/race.m new file mode 100644 index 0000000..cab38ec --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/race.m @@ -0,0 +1,9 @@ +#import "AnyPromise+Private.h" + +AnyPromise *PMKRace(NSArray *promises) { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + for (AnyPromise *promise in promises) { + [promise __pipe:resolve]; + } + }]; +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/race.swift b/Carthage/Checkouts/PromiseKit/Sources/race.swift new file mode 100644 index 0000000..2b817de --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/race.swift @@ -0,0 +1,57 @@ +@inline(__always) +private func _race(_ thenables: [U]) -> Promise { + let rp = Promise(.pending) + for thenable in thenables { + thenable.pipe(to: rp.box.seal) + } + return rp +} + +/** + Waits for one promise to resolve + + race(promise1, promise2, promise3).then { winner in + //… + } + + - Returns: The promise that resolves first + - Warning: If the first resolution is a rejection, the returned promise is rejected +*/ +public func race(_ thenables: U...) -> Promise { + return _race(thenables) +} + +/** + Waits for one promise to resolve + + race(promise1, promise2, promise3).then { winner in + //… + } + + - Returns: The promise that resolves first + - Warning: If the first resolution is a rejection, the returned promise is rejected + - Remark: If the provided array is empty the returned promise is rejected with PMKError.badInput +*/ +public func race(_ thenables: [U]) -> Promise { + guard !thenables.isEmpty else { + return Promise(error: PMKError.badInput) + } + return _race(thenables) +} + +/** + Waits for one guarantee to resolve + + race(promise1, promise2, promise3).then { winner in + //… + } + + - Returns: The guarantee that resolves first +*/ +public func race(_ guarantees: Guarantee...) -> Guarantee { + let rg = Guarantee(.pending) + for guarantee in guarantees { + guarantee.pipe(to: rg.box.seal) + } + return rg +} diff --git a/Carthage/Checkouts/PromiseKit/Sources/when.m b/Carthage/Checkouts/PromiseKit/Sources/when.m new file mode 100644 index 0000000..43e5fed --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/when.m @@ -0,0 +1,107 @@ +@import Foundation.NSDictionary; +#import "AnyPromise+Private.h" +@import Foundation.NSProgress; +#import +@import Foundation.NSError; +@import Foundation.NSNull; +#import "PromiseKit.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +// ^^ OSAtomicDecrement32 is deprecated on watchOS + + +// NSProgress resources: +// * https://robots.thoughtbot.com/asynchronous-nsprogress +// * http://oleb.net/blog/2014/03/nsprogress/ +// NSProgress! Beware! +// * https://github.com/AFNetworking/AFNetworking/issues/2261 + +/** + Wait for all promises in a set to resolve. + + @note If *any* of the provided promises reject, the returned promise is immediately rejected with that error. + @warning In the event of rejection the other promises will continue to resolve and, as per any other promise, will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed, in such situations use `when(resolved:)`. + @param promises The promises upon which to wait before the returned promise resolves. + @note PMKWhen provides NSProgress. + @return A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. +*/ +AnyPromise *PMKWhen(id promises) { + if (promises == nil) + return [AnyPromise promiseWithValue:[NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"PMKWhen(nil)"}]]; + + if ([promises isKindOfClass:[NSArray class]] || [promises isKindOfClass:[NSDictionary class]]) { + if ([promises count] == 0) + return [AnyPromise promiseWithValue:promises]; + } else if ([promises isKindOfClass:[AnyPromise class]]) { + promises = @[promises]; + } else { + return [AnyPromise promiseWithValue:promises]; + } + +#ifndef PMKDisableProgress + NSProgress *progress = [NSProgress progressWithTotalUnitCount:(int64_t)[promises count]]; + progress.pausable = NO; + progress.cancellable = NO; +#else + struct PMKProgress { + int completedUnitCount; + int totalUnitCount; + double fractionCompleted; + }; + __block struct PMKProgress progress; +#endif + + __block int32_t countdown = (int32_t)[promises count]; + BOOL const isdict = [promises isKindOfClass:[NSDictionary class]]; + + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + NSInteger index = 0; + + for (__strong id key in promises) { + AnyPromise *promise = isdict ? promises[key] : key; + if (!isdict) key = @(index); + + if (![promise isKindOfClass:[AnyPromise class]]) + promise = [AnyPromise promiseWithValue:promise]; + + [promise __pipe:^(id value){ + if (progress.fractionCompleted >= 1) + return; + + if (IsError(value)) { + progress.completedUnitCount = progress.totalUnitCount; + + NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:[(NSError *)value userInfo] ?: @{}]; + userInfo[PMKFailingPromiseIndexKey] = key; + [userInfo setObject:value forKey:NSUnderlyingErrorKey]; + id err = [[NSError alloc] initWithDomain:[value domain] code:[value code] userInfo:userInfo]; + resolve(err); + } + else if (OSAtomicDecrement32(&countdown) == 0) { + progress.completedUnitCount = progress.totalUnitCount; + + id results; + if (isdict) { + results = [NSMutableDictionary new]; + for (id key in promises) { + id promise = promises[key]; + results[key] = IsPromise(promise) ? ((AnyPromise *)promise).value : promise; + } + } else { + results = [NSMutableArray new]; + for (AnyPromise *promise in promises) { + id value = IsPromise(promise) ? (promise.value ?: [NSNull null]) : promise; + [results addObject:value]; + } + } + resolve(results); + } else { + progress.completedUnitCount++; + } + }]; + } + }]; +} + +#pragma GCC diagnostic pop diff --git a/Carthage/Checkouts/PromiseKit/Sources/when.swift b/Carthage/Checkouts/PromiseKit/Sources/when.swift new file mode 100644 index 0000000..0913c64 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Sources/when.swift @@ -0,0 +1,262 @@ +import Foundation +import Dispatch + +private func _when(_ thenables: [U]) -> Promise { + var countdown = thenables.count + guard countdown > 0 else { + return .value(Void()) + } + + let rp = Promise(.pending) + +#if PMKDisableProgress || os(Linux) + var progress: (completedUnitCount: Int, totalUnitCount: Int) = (0, 0) +#else + let progress = Progress(totalUnitCount: Int64(thenables.count)) + progress.isCancellable = false + progress.isPausable = false +#endif + + let barrier = DispatchQueue(label: "org.promisekit.barrier.when", attributes: .concurrent) + + for promise in thenables { + promise.pipe { result in + barrier.sync(flags: .barrier) { + switch result { + case .rejected(let error): + if rp.isPending { + progress.completedUnitCount = progress.totalUnitCount + rp.box.seal(.rejected(error)) + } + case .fulfilled: + guard rp.isPending else { return } + progress.completedUnitCount += 1 + countdown -= 1 + if countdown == 0 { + rp.box.seal(.fulfilled(())) + } + } + } + } + } + + return rp +} + +/** + Wait for all promises in a set to fulfill. + + For example: + + when(fulfilled: promise1, promise2).then { results in + //… + }.catch { error in + switch error { + case URLError.notConnectedToInternet: + //… + case CLError.denied: + //… + } + } + + - Note: If *any* of the provided promises reject, the returned promise is immediately rejected with that error. + - Warning: In the event of rejection the other promises will continue to resolve and, as per any other promise, will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed, in such situations use `when(resolved:)`. + - Parameter promises: The promises upon which to wait before the returned promise resolves. + - Returns: A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. + - Note: `when` provides `NSProgress`. + - SeeAlso: `when(resolved:)` +*/ +public func when(fulfilled thenables: [U]) -> Promise<[U.T]> { + return _when(thenables).map(on: nil) { thenables.map{ $0.value! } } +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled promises: U...) -> Promise where U.T == Void { + return _when(promises) +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled promises: [U]) -> Promise where U.T == Void { + return _when(promises) +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled pu: U, _ pv: V) -> Promise<(U.T, V.T)> { + return _when([pu.asVoid(), pv.asVoid()]).map(on: nil) { (pu.value!, pv.value!) } +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled pu: U, _ pv: V, _ pw: W) -> Promise<(U.T, V.T, W.T)> { + return _when([pu.asVoid(), pv.asVoid(), pw.asVoid()]).map(on: nil) { (pu.value!, pv.value!, pw.value!) } +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled pu: U, _ pv: V, _ pw: W, _ px: X) -> Promise<(U.T, V.T, W.T, X.T)> { + return _when([pu.asVoid(), pv.asVoid(), pw.asVoid(), px.asVoid()]).map(on: nil) { (pu.value!, pv.value!, pw.value!, px.value!) } +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled pu: U, _ pv: V, _ pw: W, _ px: X, _ py: Y) -> Promise<(U.T, V.T, W.T, X.T, Y.T)> { + return _when([pu.asVoid(), pv.asVoid(), pw.asVoid(), px.asVoid(), py.asVoid()]).map(on: nil) { (pu.value!, pv.value!, pw.value!, px.value!, py.value!) } +} + +/** + Generate promises at a limited rate and wait for all to fulfill. + + For example: + + func downloadFile(url: URL) -> Promise { + // ... + } + + let urls: [URL] = /*…*/ + let urlGenerator = urls.makeIterator() + + let generator = AnyIterator> { + guard url = urlGenerator.next() else { + return nil + } + return downloadFile(url) + } + + when(generator, concurrently: 3).done { datas in + // ... + } + + No more than three downloads will occur simultaneously. + + - Note: The generator is called *serially* on a *background* queue. + - Warning: Refer to the warnings on `when(fulfilled:)` + - Parameter promiseGenerator: Generator of promises. + - Returns: A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. + - SeeAlso: `when(resolved:)` + */ + +public func when(fulfilled promiseIterator: It, concurrently: Int) -> Promise<[It.Element.T]> where It.Element: Thenable { + + guard concurrently > 0 else { + return Promise(error: PMKError.badInput) + } + + var generator = promiseIterator + var root = Promise<[It.Element.T]>.pending() + var pendingPromises = 0 + var promises: [It.Element] = [] + + let barrier = DispatchQueue(label: "org.promisekit.barrier.when", attributes: [.concurrent]) + + func dequeue() { + guard root.promise.isPending else { return } // don’t continue dequeueing if root has been rejected + + var shouldDequeue = false + barrier.sync { + shouldDequeue = pendingPromises < concurrently + } + guard shouldDequeue else { return } + + var index: Int! + var promise: It.Element! + + barrier.sync(flags: .barrier) { + guard let next = generator.next() else { return } + + promise = next + index = promises.count + + pendingPromises += 1 + promises.append(next) + } + + func testDone() { + barrier.sync { + if pendingPromises == 0 { + #if !swift(>=3.3) || (swift(>=4) && !swift(>=4.1)) + root.resolver.fulfill(promises.flatMap{ $0.value }) + #else + root.resolver.fulfill(promises.compactMap{ $0.value }) + #endif + } + } + } + + guard promise != nil else { + return testDone() + } + + promise.pipe { resolution in + barrier.sync(flags: .barrier) { + pendingPromises -= 1 + } + + switch resolution { + case .fulfilled: + dequeue() + testDone() + case .rejected(let error): + root.resolver.reject(error) + } + } + + dequeue() + } + + dequeue() + + return root.promise +} + +/** + Waits on all provided promises. + + `when(fulfilled:)` rejects as soon as one of the provided promises rejects. `when(resolved:)` waits on all provided promises whatever their result, and then provides an array of `Result` so you can individually inspect the results. As a consequence this function returns a `Guarantee`, ie. errors are lifted from the individual promises into the results array of the returned `Guarantee`. + + when(resolved: promise1, promise2, promise3).then { results in + for result in results where case .fulfilled(let value) { + //… + } + }.catch { error in + // invalid! Never rejects + } + + - Returns: A new promise that resolves once all the provided promises resolve. The array is ordered the same as the input, ie. the result order is *not* resolution order. + - Note: we do not provide tuple variants for `when(resolved:)` but will accept a pull-request + - Remark: Doesn't take Thenable due to protocol `associatedtype` paradox +*/ +public func when(resolved promises: Promise...) -> Guarantee<[Result]> { + return when(resolved: promises) +} + +/// - See: `when(resolved: Promise...)` +public func when(resolved promises: [Promise]) -> Guarantee<[Result]> { + guard !promises.isEmpty else { + return .value([]) + } + + var countdown = promises.count + let barrier = DispatchQueue(label: "org.promisekit.barrier.join", attributes: .concurrent) + + let rg = Guarantee<[Result]>(.pending) + for promise in promises { + promise.pipe { result in + barrier.sync(flags: .barrier) { + countdown -= 1 + } + barrier.sync { + if countdown == 0 { + rg.box.seal(promises.map{ $0.result! }) + } + } + } + } + return rg +} + +/// Waits on all provided Guarantees. +public func when(_ guarantees: Guarantee...) -> Guarantee { + return when(guarantees: guarantees) +} + +// Waits on all provided Guarantees. +public func when(guarantees: [Guarantee]) -> Guarantee { + return when(fulfilled: guarantees).recover{ _ in }.asVoid() +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/0.0.0.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/0.0.0.swift new file mode 100644 index 0000000..a96ad90 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/0.0.0.swift @@ -0,0 +1,185 @@ +import PromiseKit +import Dispatch +import XCTest + +enum Error: Swift.Error { + case dummy // we reject with this when we don't intend to test against it + case sentinel(UInt32) +} + +private let timeout: TimeInterval = 10 + +extension XCTestCase { + func describe(_ description: String, file: StaticString = #file, line: UInt = #line, body: () throws -> Void) { + + PromiseKit.conf.Q.map = .main + + do { + try body() + } catch { + XCTFail(description, file: file, line: line) + } + } + + func specify(_ description: String, file: StaticString = #file, line: UInt = #line, body: ((promise: Promise, fulfill: () -> Void, reject: (Error) -> Void), XCTestExpectation) throws -> Void) { + let expectation = self.expectation(description: description) + let (pending, seal) = Promise.pending() + + do { + try body((pending, { seal.fulfill(()) }, seal.reject), expectation) + waitForExpectations(timeout: timeout) { err in + if let _ = err { + XCTFail("wait failed: \(description)", file: file, line: line) + } + } + } catch { + XCTFail(description, file: file, line: line) + } + } + + func testFulfilled(file: StaticString = #file, line: UInt = #line, body: @escaping (Promise, XCTestExpectation, UInt32) -> Void) { + testFulfilled(withExpectationCount: 1, file: file, line: line) { + body($0, $1.first!, $2) + } + } + + func testRejected(file: StaticString = #file, line: UInt = #line, body: @escaping (Promise, XCTestExpectation, UInt32) -> Void) { + testRejected(withExpectationCount: 1, file: file, line: line) { + body($0, $1.first!, $2) + } + } + + func testFulfilled(withExpectationCount: Int, file: StaticString = #file, line: UInt = #line, body: @escaping (Promise, [XCTestExpectation], UInt32) -> Void) { + + let specify = mkspecify(withExpectationCount, file: file, line: line, body: body) + + specify("already-fulfilled") { value in + return (.value(value), {}) + } + specify("immediately-fulfilled") { value in + let (promise, seal) = Promise.pending() + return (promise, { + seal.fulfill(value) + }) + } + specify("eventually-fulfilled") { value in + let (promise, seal) = Promise.pending() + return (promise, { + after(ticks: 5) { + seal.fulfill(value) + } + }) + } + } + + func testRejected(withExpectationCount: Int, file: StaticString = #file, line: UInt = #line, body: @escaping (Promise, [XCTestExpectation], UInt32) -> Void) { + + let specify = mkspecify(withExpectationCount, file: file, line: line, body: body) + + specify("already-rejected") { sentinel in + return (Promise(error: Error.sentinel(sentinel)), {}) + } + specify("immediately-rejected") { sentinel in + let (promise, seal) = Promise.pending() + return (promise, { + seal.reject(Error.sentinel(sentinel)) + }) + } + specify("eventually-rejected") { sentinel in + let (promise, seal) = Promise.pending() + return (promise, { + after(ticks: 50) { + seal.reject(Error.sentinel(sentinel)) + } + }) + } + } + + +///////////////////////////////////////////////////////////////////////// + + private func mkspecify(_ numberOfExpectations: Int, file: StaticString, line: UInt, body: @escaping (Promise, [XCTestExpectation], UInt32) -> Void) -> (String, _ feed: (UInt32) -> (Promise, () -> Void)) -> Void { + return { desc, feed in + let value = arc4random() + let (promise, executeAfter) = feed(value) + let expectations = (1...numberOfExpectations).map { + self.expectation(description: "\(desc) (\($0))") + } + body(promise, expectations, value) + + executeAfter() + + self.waitForExpectations(timeout: timeout) { err in + if let _ = err { + XCTFail("timed out: \(desc)", file: file, line: line) + } + } + } + } + + func mkex() -> XCTestExpectation { + return expectation(description: "") + } +} + +func after(ticks: Int, execute body: @escaping () -> Void) { + precondition(ticks > 0) + + var ticks = ticks + func f() { + DispatchQueue.main.async { + ticks -= 1 + if ticks == 0 { + body() + } else { + f() + } + } + } + f() +} + +extension Promise { + func test(onFulfilled: @escaping () -> Void, onRejected: @escaping () -> Void) { + tap { result in + switch result { + case .fulfilled: + onFulfilled() + case .rejected: + onRejected() + } + }.silenceWarning() + } +} + +prefix func ++(a: inout Int) -> Int { + a += 1 + return a +} + +extension Promise { + func silenceWarning() {} +} + +#if os(Linux) +import func Glibc.random + +func arc4random() -> UInt32 { + return UInt32(random()) +} + +extension XCTestExpectation { + func fulfill() { + fulfill(#file, line: #line) + } +} + +extension XCTestCase { + func wait(for: [XCTestExpectation], timeout: TimeInterval, file: StaticString = #file, line: UInt = #line) { + #if !(swift(>=4.0) && !swift(>=4.1)) + let line = Int(line) + #endif + waitForExpectations(timeout: timeout, file: file, line: line) + } +} +#endif diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.1.2.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.1.2.swift new file mode 100644 index 0000000..c895c2f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.1.2.swift @@ -0,0 +1,26 @@ +import PromiseKit +import XCTest + +class Test212: XCTestCase { + func test() { + describe("2.1.2.1: When fulfilled, a promise: must not transition to any other state.") { + testFulfilled { promise, expectation, _ in + promise.test(onFulfilled: expectation.fulfill, onRejected: { XCTFail() }) + } + + specify("trying to fulfill then immediately reject") { d, expectation in + d.promise.test(onFulfilled: expectation.fulfill, onRejected: { XCTFail() }) + d.fulfill() + d.reject(Error.dummy) + } + + specify("trying to fulfill then reject, delayed") { d, expectation in + d.promise.test(onFulfilled: expectation.fulfill, onRejected: { XCTFail() }) + after(ticks: 1) { + d.fulfill() + d.reject(Error.dummy) + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.1.3.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.1.3.swift new file mode 100644 index 0000000..d24ae68 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.1.3.swift @@ -0,0 +1,34 @@ +import PromiseKit +import XCTest + +class Test213: XCTestCase { + func test() { + describe("2.1.3.1: When rejected, a promise: must not transition to any other state.") { + testRejected { promise, expectation, _ in + promise.test(onFulfilled: { XCTFail() }, onRejected: expectation.fulfill) + } + + specify("trying to reject then immediately fulfill") { d, expectation in + d.promise.test(onFulfilled: { XCTFail() }, onRejected: expectation.fulfill) + d.reject(Error.dummy) + d.fulfill() + } + + specify("trying to reject then fulfill, delayed") { d, expectation in + d.promise.test(onFulfilled: { XCTFail() }, onRejected: expectation.fulfill) + after(ticks: 1) { + d.reject(Error.dummy) + d.fulfill() + } + } + + specify("trying to reject immediately then fulfill delayed") { d, expectation in + d.promise.test(onFulfilled: { XCTFail() }, onRejected: expectation.fulfill) + d.reject(Error.dummy) + after(ticks: 1) { + d.fulfill() + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.2.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.2.swift new file mode 100644 index 0000000..f1ba899 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.2.swift @@ -0,0 +1,92 @@ +import PromiseKit +import XCTest + +class Test222: XCTestCase { + func test() { + describe("2.2.2: If `onFulfilled` is a function,") { + describe("2.2.2.1: it must be called after `promise` is fulfilled, with `promise`’s fulfillment value as its first argument.") { + testFulfilled { promise, expectation, sentinel in + promise.done { + XCTAssertEqual(sentinel, $0) + expectation.fulfill() + }.silenceWarning() + } + } + + describe("2.2.2.2: it must not be called before `promise` is fulfilled") { + specify("fulfilled after a delay") { d, expectation in + var called = false + d.promise.done { + called = true + expectation.fulfill() + }.silenceWarning() + after(ticks: 5) { + XCTAssertFalse(called) + d.fulfill() + } + } + specify("never fulfilled") { d, expectation in + d.promise.done{ XCTFail() }.silenceWarning() + after(ticks: 1000, execute: expectation.fulfill) + } + } + + describe("2.2.2.3: it must not be called more than once.") { + specify("already-fulfilled") { _, expectation in + let ex = (expectation, mkex()) + Promise().done { + ex.0.fulfill() + }.silenceWarning() + after(ticks: 1000) { + ex.1.fulfill() + } + } + specify("trying to fulfill a pending promise more than once, immediately") { d, expectation in + d.promise.done(expectation.fulfill).silenceWarning() + d.fulfill() + d.fulfill() + } + specify("trying to fulfill a pending promise more than once, delayed") { d, expectation in + d.promise.done(expectation.fulfill).silenceWarning() + after(ticks: 5) { + d.fulfill() + d.fulfill() + } + } + specify("trying to fulfill a pending promise more than once, immediately then delayed") { d, expectation in + let ex = (expectation, mkex()) + d.promise.done(ex.0.fulfill).silenceWarning() + d.fulfill() + after(ticks: 5) { + d.fulfill() + } + after(ticks: 10, execute: ex.1.fulfill) + } + specify("when multiple `then` calls are made, spaced apart in time") { d, expectation in + let ex = (expectation, self.expectation(description: ""), self.expectation(description: ""), self.expectation(description: "")) + + do { + d.promise.done(ex.0.fulfill).silenceWarning() + } + after(ticks: 5) { + d.promise.done(ex.1.fulfill).silenceWarning() + } + after(ticks: 10) { + d.promise.done(ex.2.fulfill).silenceWarning() + } + after(ticks: 15) { + d.fulfill() + ex.3.fulfill() + } + } + specify("when `then` is interleaved with fulfillment") { d, expectation in + let ex = (expectation, self.expectation(description: ""), self) + + d.promise.done(ex.0.fulfill).silenceWarning() + d.fulfill() + d.promise.done(ex.1.fulfill).silenceWarning() + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.3.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.3.swift new file mode 100644 index 0000000..996d6a2 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.3.swift @@ -0,0 +1,93 @@ +import PromiseKit +import XCTest + +class Test223: XCTestCase { + func test() { + describe("2.2.3: If `onRejected` is a function,") { + describe("2.2.3.1: it must be called after `promise` is rejected, with `promise`’s rejection reason as its first argument.") { + testRejected { promise, expectation, sentinel in + promise.catch { error in + if case Error.sentinel(let value) = error { + XCTAssertEqual(value, sentinel) + } else { + XCTFail() + } + expectation.fulfill() + } + } + } + describe("2.2.3.2: it must not be called before `promise` is rejected") { + specify("rejected after a delay") { d, expectation in + var called = false + d.promise.catch { _ in + called = true + expectation.fulfill() + } + after(ticks: 1) { + XCTAssertFalse(called) + d.reject(Error.dummy) + } + } + specify("never rejected") { d, expectation in + d.promise.catch { _ in XCTFail() } + after(ticks: 1, execute: expectation.fulfill) + } + } + describe("2.2.3.3: it must not be called more than once.") { + specify("already-rejected") { d, expectation in + var timesCalled = 0 + Promise(error: Error.dummy).catch { _ in + XCTAssertEqual(++timesCalled, 1) + } + after(ticks: 2) { + XCTAssertEqual(timesCalled, 1) + expectation.fulfill() + } + } + specify("trying to reject a pending promise more than once, immediately") { d, expectation in + d.promise.catch{_ in expectation.fulfill() } + d.reject(Error.dummy) + d.reject(Error.dummy) + } + specify("trying to reject a pending promise more than once, delayed") { d, expectation in + d.promise.catch{_ in expectation.fulfill() } + after(ticks: 1) { + d.reject(Error.dummy) + d.reject(Error.dummy) + } + } + specify("trying to reject a pending promise more than once, immediately then delayed") { d, expectation in + d.promise.catch{_ in expectation.fulfill() } + d.reject(Error.dummy) + after(ticks: 1) { + d.reject(Error.dummy) + } + } + specify("when multiple `then` calls are made, spaced apart in time") { d, expectation in + let mk = { self.expectation(description: "") } + let ex = (expectation, mk(), mk(), mk()) + + do { + d.promise.catch{ _ in ex.0.fulfill() } + } + after(ticks: 1) { + d.promise.catch{ _ in ex.1.fulfill() } + } + after(ticks: 2) { + d.promise.catch{ _ in ex.2.fulfill() } + } + after(ticks: 3) { + d.reject(Error.dummy) + ex.3.fulfill() + } + } + specify("when `then` is interleaved with rejection") { d, expectation in + let ex = (expectation, self.expectation(description: "")) + d.promise.catch{ _ in ex.0.fulfill() } + d.reject(Error.dummy) + d.promise.catch{ _ in ex.1.fulfill() } + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.4.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.4.swift new file mode 100644 index 0000000..0472b13 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.4.swift @@ -0,0 +1,146 @@ +import PromiseKit +import XCTest + +class Test224: XCTestCase { + func test() { + describe("2.2.4: `onFulfilled` or `onRejected` must not be called until the execution context stack contains only platform code.") { + + describe("`then` returns before the promise becomes fulfilled or rejected") { + testFulfilled { promise, expectation, dummy in + var thenHasReturned = false + promise.done { _ in + XCTAssert(thenHasReturned) + expectation.fulfill() + }.silenceWarning() + thenHasReturned = true + } + testRejected { promise, expectation, memo in + var catchHasReturned = false + promise.catch { _->() in + XCTAssert(catchHasReturned) + expectation.fulfill() + } + catchHasReturned = true + } + + } + + describe("Clean-stack execution ordering tests (fulfillment case)") { + specify("when `onFulfilled` is added immediately before the promise is fulfilled") { d, expectation in + var onFulfilledCalled = false + d.promise.done { + onFulfilledCalled = true + expectation.fulfill() + }.silenceWarning() + d.fulfill() + XCTAssertFalse(onFulfilledCalled) + } + specify("when `onFulfilled` is added immediately after the promise is fulfilled") { d, expectation in + var onFulfilledCalled = false + d.fulfill() + d.promise.done { + onFulfilledCalled = true + expectation.fulfill() + }.silenceWarning() + XCTAssertFalse(onFulfilledCalled) + } + specify("when one `onFulfilled` is added inside another `onFulfilled`") { _, expectation in + var firstOnFulfilledFinished = false + let promise = Promise() + promise.done { + promise.done { + XCTAssertTrue(firstOnFulfilledFinished) + expectation.fulfill() + }.silenceWarning() + firstOnFulfilledFinished = true + }.silenceWarning() + } + + specify("when `onFulfilled` is added inside an `onRejected`") { _, expectation in + let promise1 = Promise(error: Error.dummy) + let promise2 = Promise() + var firstOnRejectedFinished = false + + promise1.catch { _ in + promise2.done { + XCTAssertTrue(firstOnRejectedFinished) + expectation.fulfill() + }.silenceWarning() + firstOnRejectedFinished = true + } + } + + specify("when the promise is fulfilled asynchronously") { d, expectation in + var firstStackFinished = false + + after(ticks: 1) { + d.fulfill() + firstStackFinished = true + } + + d.promise.done { + XCTAssertTrue(firstStackFinished) + expectation.fulfill() + }.silenceWarning() + } + } + + describe("Clean-stack execution ordering tests (rejection case)") { + specify("when `onRejected` is added immediately before the promise is rejected") { d, expectation in + var onRejectedCalled = false + d.promise.catch { _ in + onRejectedCalled = true + expectation.fulfill() + } + d.reject(Error.dummy) + XCTAssertFalse(onRejectedCalled) + } + specify("when `onRejected` is added immediately after the promise is rejected") { d, expectation in + var onRejectedCalled = false + d.reject(Error.dummy) + d.promise.catch { _ in + onRejectedCalled = true + expectation.fulfill() + } + XCTAssertFalse(onRejectedCalled) + } + specify("when `onRejected` is added inside an `onFulfilled`") { d, expectation in + let promise1 = Promise() + let promise2 = Promise(error: Error.dummy) + var firstOnFulfilledFinished = false + + promise1.done { _ in + promise2.catch { _ in + XCTAssertTrue(firstOnFulfilledFinished) + expectation.fulfill() + } + firstOnFulfilledFinished = true + }.silenceWarning() + } + specify("when one `onRejected` is added inside another `onRejected`") { d, expectation in + let promise = Promise(error: Error.dummy) + var firstOnRejectedFinished = false; + + promise.catch { _ in + promise.catch { _ in + XCTAssertTrue(firstOnRejectedFinished) + expectation.fulfill() + } + firstOnRejectedFinished = true + } + } + specify("when the promise is rejected asynchronously") { d, expectation in + var firstStackFinished = false + after(ticks: 1) { + d.reject(Error.dummy) + firstStackFinished = true + } + d.promise.catch { _ in + XCTAssertTrue(firstStackFinished) + expectation.fulfill() + } + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.6.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.6.swift new file mode 100644 index 0000000..8b938e1 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.6.swift @@ -0,0 +1,275 @@ +import PromiseKit +import XCTest + +class Test226: XCTestCase { + func test() { + describe("2.2.6: `then` may be called multiple times on the same promise.") { + describe("2.2.6.1: If/when `promise` is fulfilled, all respective `onFulfilled` callbacks must execute in the order of their originating calls to `then`.") { + describe("multiple boring fulfillment handlers") { + testFulfilled(withExpectationCount: 4) { promise, exes, sentinel -> () in + var orderValidator = 0 + promise.done { + XCTAssertEqual($0, sentinel) + XCTAssertEqual(++orderValidator, 1) + exes[0].fulfill() + }.silenceWarning() + promise.catch { _ in XCTFail() } + promise.done { + XCTAssertEqual($0, sentinel) + XCTAssertEqual(++orderValidator, 2) + exes[1].fulfill() + }.silenceWarning() + promise.catch { _ in XCTFail() } + promise.done { + XCTAssertEqual($0, sentinel) + XCTAssertEqual(++orderValidator, 3) + exes[2].fulfill() + }.silenceWarning() + promise.catch { _ in XCTFail() } + promise.done { + XCTAssertEqual($0, sentinel) + XCTAssertEqual(++orderValidator, 4) + exes[3].fulfill() + }.silenceWarning() + } + } + describe("multiple fulfillment handlers, one of which throws") { + testFulfilled(withExpectationCount: 4) { promise, exes, sentinel in + var orderValidator = 0 + promise.done { + XCTAssertEqual($0, sentinel) + XCTAssertEqual(++orderValidator, 1) + exes[0].fulfill() + }.silenceWarning() + promise.catch { _ in XCTFail() } + promise.done { + XCTAssertEqual($0, sentinel) + XCTAssertEqual(++orderValidator, 2) + exes[1].fulfill() + }.silenceWarning() + promise.catch { _ in XCTFail() } + promise.done { + XCTAssertEqual($0, sentinel) + XCTAssertEqual(++orderValidator, 3) + exes[2].fulfill() + throw Error.dummy + }.silenceWarning() + promise.catch { value in XCTFail() } + promise.done { + XCTAssertEqual($0, sentinel) + XCTAssertEqual(++orderValidator, 4) + exes[3].fulfill() + }.silenceWarning() + } + } + describe("results in multiple branching chains with their own fulfillment values") { + testFulfilled(withExpectationCount: 3) { promise, exes, memo in + let sentinel1 = 671 + let sentinel2: UInt32 = 672 + let sentinel3 = 673 + + promise.map { _ in + return sentinel1 + }.done { value in + XCTAssertEqual(sentinel1, value) + exes[0].fulfill() + }.silenceWarning() + + promise.done { _ in + throw Error.sentinel(sentinel2) + }.catch { err in + switch err { + case Error.sentinel(let err) where err == sentinel2: + break + default: + XCTFail() + } + exes[1].fulfill() + } + + promise.map { _ in + sentinel3 + }.done { + XCTAssertEqual($0, sentinel3) + exes[2].fulfill() + }.silenceWarning() + } + } + describe("`onFulfilled` handlers are called in the original order") { + testFulfilled(withExpectationCount: 3) { promise, exes, memo in + var orderValidator = 0 + + promise.done { _ in + XCTAssertEqual(++orderValidator, 1) + exes[0].fulfill() + }.silenceWarning() + promise.done { _ in + XCTAssertEqual(++orderValidator, 2) + exes[1].fulfill() + }.silenceWarning() + promise.done { _ in + XCTAssertEqual(++orderValidator, 3) + exes[2].fulfill() + }.silenceWarning() + } + } + describe("even when one handler is added inside another handler") { + testFulfilled(withExpectationCount: 3) { promise, exes, memo in + var x = 0 + promise.done { _ in + XCTAssertEqual(x, 0) + x += 1 + exes[0].fulfill() + promise.done { _ in + XCTAssertEqual(x, 2) + x += 1 + exes[1].fulfill() + }.silenceWarning() + }.silenceWarning() + promise.done { _ in + XCTAssertEqual(x, 1) + x += 1 + exes[2].fulfill() + }.silenceWarning() + } + } + } + describe("2.2.6.2: If/when `promise` is rejected, all respective `onRejected` callbacks must execute in the order of their originating calls to `then`.") { + describe("multiple boring rejection handlers") { + testRejected(withExpectationCount: 4) { promise, exes, sentinel in + var ticket = 0 + + promise.catch { err in + guard case Error.sentinel(let x) = err, x == sentinel else { return XCTFail() } + XCTAssertEqual(++ticket, 1) + exes[0].fulfill() + } + promise.done { _ in XCTFail() }.silenceWarning() + promise.catch { err in + guard case Error.sentinel(let x) = err, x == sentinel else { return XCTFail() } + XCTAssertEqual(++ticket, 2) + exes[1].fulfill() + } + promise.done { _ in XCTFail() }.silenceWarning() + promise.catch { err in + guard case Error.sentinel(let x) = err, x == sentinel else { return XCTFail() } + XCTAssertEqual(++ticket, 3) + exes[2].fulfill() + } + promise.done { _ in XCTFail() }.silenceWarning() + promise.catch { err in + guard case Error.sentinel(let x) = err, x == sentinel else { return XCTFail() } + XCTAssertEqual(++ticket, 4) + exes[3].fulfill() + } + } + } + describe("multiple rejection handlers, one of which throws") { + testRejected(withExpectationCount: 4) { promise, exes, sentinel in + var orderValidator = 0 + + promise.catch { err in + guard case Error.sentinel(let x) = err, x == sentinel else { return XCTFail() } + XCTAssertEqual(++orderValidator, 1) + exes[0].fulfill() + } + promise.done { _ in XCTFail() }.silenceWarning() + promise.catch { err in + guard case Error.sentinel(let x) = err, x == sentinel else { return XCTFail() } + XCTAssertEqual(++orderValidator, 2) + exes[1].fulfill() + } + promise.done { _ in XCTFail() }.silenceWarning() + promise.recover { err -> Promise in + if case Error.sentinel(let x) = err { + XCTAssertEqual(x, sentinel) + } else { + XCTFail() + } + XCTAssertEqual(++orderValidator, 3) + exes[2].fulfill() + throw Error.dummy + }.silenceWarning() + promise.done { _ in XCTFail() }.silenceWarning() + promise.catch { err in + guard case Error.sentinel(let x) = err, x == sentinel else { return XCTFail() } + XCTAssertEqual(++orderValidator, 4) + exes[3].fulfill() + } + } + } + describe("results in multiple branching chains with their own fulfillment values") { + testRejected(withExpectationCount: 3) { promise, exes, memo in + let sentinel1 = arc4random() + let sentinel2 = arc4random() + let sentinel3 = arc4random() + + promise.recover { _ in + return .value(sentinel1) + }.done { value in + XCTAssertEqual(sentinel1, value) + exes[0].fulfill() + } + + promise.recover { _ -> Promise in + throw Error.sentinel(sentinel2) + }.catch { err in + if case Error.sentinel(let x) = err, x == sentinel2 { + exes[1].fulfill() + } + } + + promise.recover { _ in + .value(sentinel3) + }.done { value in + XCTAssertEqual(value, sentinel3) + exes[2].fulfill() + } + } + } + describe("`onRejected` handlers are called in the original order") { + testRejected(withExpectationCount: 3) { promise, exes, memo in + var x = 0 + + promise.catch { _ in + XCTAssertEqual(x, 0) + x += 1 + exes[0].fulfill() + } + promise.catch { _ in + XCTAssertEqual(x, 1) + x += 1 + exes[1].fulfill() + } + promise.catch { _ in + XCTAssertEqual(x, 2) + x += 1 + exes[2].fulfill() + } + } + } + describe("even when one handler is added inside another handler") { + testRejected(withExpectationCount: 3) { promise, exes, memo in + var x = 0 + + promise.catch { _ in + XCTAssertEqual(x, 0) + x += 1 + exes[0].fulfill() + promise.catch { _ in + XCTAssertEqual(x, 2) + x += 1 + exes[1].fulfill() + } + } + promise.catch { _ in + XCTAssertEqual(x, 1) + x += 1 + exes[2].fulfill() + } + } + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.7.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.7.swift new file mode 100644 index 0000000..ad9052d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.2.7.swift @@ -0,0 +1,33 @@ +import PromiseKit +import XCTest + +class Test227: XCTestCase { + func test() { + describe("2.2.7: `then` must return a promise: `promise2 = promise1.then(onFulfilled, onRejected)") { + describe("2.2.7.2: If either `onFulfilled` or `onRejected` throws an exception `e`, `promise2` must be rejected with `e` as the reason.") { + + testFulfilled { promise1, expectation, _ in + let sentinel = arc4random() + let promise2 = promise1.done { _ in throw Error.sentinel(sentinel) } + + promise2.catch { + if case Error.sentinel(let x) = $0, x == sentinel { + expectation.fulfill() + } + } + } + + testRejected { promise1, expectation, _ in + let sentinel = arc4random() + let promise2 = promise1.recover { _ -> Promise in throw Error.sentinel(sentinel) } + + promise2.catch { error in + if case Error.sentinel(let x) = error, x == sentinel { + expectation.fulfill() + } + } + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.1.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.1.swift new file mode 100644 index 0000000..d526a67 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.1.swift @@ -0,0 +1,31 @@ +import PromiseKit +import XCTest + +class Test231: XCTestCase { + func test() { + describe("2.3.1: If `promise` and `x` refer to the same object, reject `promise` with a `TypeError' as the reason.") { + specify("via return from a fulfilled promise") { d, expectation in + var promise: Promise! + promise = Promise().then { () -> Promise in + return promise + } + promise.catch { err in + if case PMKError.returnedSelf = err { + expectation.fulfill() + } + } + } + specify("via return from a rejected promise") { d, expectation in + var promise: Promise! + promise = Promise(error: Error.dummy).recover { _ -> Promise in + return promise + } + promise.catch { err in + if case PMKError.returnedSelf = err { + expectation.fulfill() + } + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.2.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.2.swift new file mode 100644 index 0000000..cf4ceb0 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.2.swift @@ -0,0 +1,116 @@ +import PromiseKit +import XCTest + +class Test232: XCTestCase { + func test() { + describe("2.3.2: If `x` is a promise, adopt its state") { + describe("2.3.2.1: If `x` is pending, `promise` must remain pending until `x` is fulfilled or rejected.") { + + func xFactory() -> Promise { + return Promise.pending().promise + } + + testPromiseResolution(factory: xFactory) { promise, expectation in + var wasFulfilled = false; + var wasRejected = false; + + promise.test(onFulfilled: { wasFulfilled = true }, onRejected: { wasRejected = true }) + + after(ticks: 4) { + XCTAssertFalse(wasFulfilled) + XCTAssertFalse(wasRejected) + expectation.fulfill() + } + } + } + + describe("2.3.2.2: If/when `x` is fulfilled, fulfill `promise` with the same value.") { + describe("`x` is already-fulfilled") { + let sentinel = arc4random() + + func xFactory() -> Promise { + return .value(sentinel) + } + + testPromiseResolution(factory: xFactory) { promise, expectation in + promise.done { + XCTAssertEqual($0, sentinel) + expectation.fulfill() + }.silenceWarning() + } + } + describe("`x` is eventually-fulfilled") { + let sentinel = arc4random() + + func xFactory() -> Promise { + return Promise { seal in + after(ticks: 2) { + seal.fulfill(sentinel) + } + } + } + + testPromiseResolution(factory: xFactory) { promise, expectation in + promise.done { + XCTAssertEqual($0, sentinel) + expectation.fulfill() + }.silenceWarning() + } + } + } + + describe("2.3.2.3: If/when `x` is rejected, reject `promise` with the same reason.") { + describe("`x` is already-rejected") { + let sentinel = arc4random() + + func xFactory() -> Promise { + return Promise(error: Error.sentinel(sentinel)) + } + + testPromiseResolution(factory: xFactory) { promise, expectation in + promise.catch { err in + if case Error.sentinel(let value) = err, value == sentinel { + expectation.fulfill() + } + } + } + } + describe("`x` is eventually-rejected") { + let sentinel = arc4random() + + func xFactory() -> Promise { + return Promise { seal in + after(ticks: 2) { + seal.reject(Error.sentinel(sentinel)) + } + } + } + + testPromiseResolution(factory: xFactory) { promise, expectation in + promise.catch { err in + if case Error.sentinel(let value) = err, value == sentinel { + expectation.fulfill() + } + } + } + } + } + } + } +} + + +///////////////////////////////////////////////////////////////////////// + +extension Test232 { + fileprivate func testPromiseResolution(factory: @escaping () -> Promise, line: UInt = #line, test: (Promise, XCTestExpectation) -> Void) { + specify("via return from a fulfilled promise", file: #file, line: line) { d, expectation in + let promise = Promise.value(arc4random()).then { _ in factory() } + test(promise, expectation) + } + specify("via return from a rejected promise", file: #file, line: line) { d, expectation in + let promise: Promise = Promise(error: Error.dummy).recover { _ in factory() } + test(promise, expectation) + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.4.swift b/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.4.swift new file mode 100644 index 0000000..2c0133b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/2.3.4.swift @@ -0,0 +1,26 @@ +import PromiseKit +import XCTest + + +class Test234: XCTestCase { + func test() { + describe("2.3.4: If `x` is not an object or function, fulfill `promise` with `x`") { + testFulfilled { promise, exception, _ in + promise.map { value -> UInt32 in + return 1 + }.done { value in + XCTAssertEqual(value, 1) + exception.fulfill() + }.silenceWarning() + } + testRejected { promise, expectation, _ in + promise.recover { _ -> Promise in + return .value(UInt32(1)) + }.done { value in + XCTAssertEqual(value, 1) + expectation.fulfill() + }.silenceWarning() + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/A+/README.md b/Carthage/Checkouts/PromiseKit/Tests/A+/README.md new file mode 100644 index 0000000..bba573e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/A+/README.md @@ -0,0 +1,13 @@ +Resources +========= +* https://github.com/promises-aplus/promises-tests + + +Skipped +======= +* 2.3.3: Otherwise, if x is an object or function. + This spec is a NOOP for Swift: + - We have decided not to interact with other Promises A+ implementations + - functions cannot have properties +* 2.3.3.4: If then is not a function, fulfill promise with x. + - See: The 2.3.4 suite. diff --git a/Carthage/Checkouts/PromiseKit/Tests/Bridging/BridgingTests.m b/Carthage/Checkouts/PromiseKit/Tests/Bridging/BridgingTests.m new file mode 100644 index 0000000..928c048 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/Bridging/BridgingTests.m @@ -0,0 +1,34 @@ +@import PromiseKit; +@import XCTest; +#import "Infrastructure.h" + + +@interface BridgingTests: XCTestCase @end @implementation BridgingTests + +- (void)testChainAnyPromiseFromSwiftCode { + XCTestExpectation *ex = [self expectationWithDescription:@""]; + AnyPromise *promise = PMKAfter(0.02); + for (int x = 0; x < 100; ++x) { + promise = promise.then(^{ + return [[[PromiseBridgeHelper alloc] init] bridge1]; + }); + } + promise.then(^{ + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:20 handler:nil]; +} + +- (void)test626 { + XCTestExpectation *ex = [self expectationWithDescription:@""]; + + testCase626().then(^{ + XCTFail(); + }).ensure(^{ + [ex fulfill]; + }); + + [self waitForExpectationsWithTimeout:20 handler:nil]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Tests/Bridging/BridgingTests.swift b/Carthage/Checkouts/PromiseKit/Tests/Bridging/BridgingTests.swift new file mode 100644 index 0000000..0e04334 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/Bridging/BridgingTests.swift @@ -0,0 +1,280 @@ +import Foundation +import PromiseKit +import XCTest + +class BridgingTests: XCTestCase { + + func testCanBridgeAnyObject() { + let sentinel = NSURLRequest() + let p = Promise.value(sentinel) + let ap = AnyPromise(p) + + XCTAssertEqual(ap.value(forKey: "value") as? NSURLRequest, sentinel) + } + + func testCanBridgeOptional() { + let sentinel: NSURLRequest? = NSURLRequest() + let p = Promise.value(sentinel) + let ap = AnyPromise(p) + + XCTAssertEqual(ap.value(forKey: "value") as? NSURLRequest, sentinel) + } + + func testCanBridgeSwiftArray() { + let sentinel = [NSString(), NSString(), NSString()] + let p = Promise.value(sentinel) + let ap = AnyPromise(p) + + guard let foo = ap.value(forKey: "value") as? [NSString] else { return XCTFail() } + XCTAssertEqual(foo, sentinel) + } + + func testCanBridgeSwiftDictionary() { + let sentinel = [NSString(): NSString()] + let p = Promise.value(sentinel) + let ap = AnyPromise(p) + + guard let foo = ap.value(forKey: "value") as? [NSString: NSString] else { return XCTFail() } + XCTAssertEqual(foo, sentinel) + } + + func testCanBridgeInt() { + let sentinel = 3 + let p = Promise.value(sentinel) + let ap = AnyPromise(p) + XCTAssertEqual(ap.value(forKey: "value") as? Int, sentinel) + } + + func testCanBridgeString() { + let sentinel = "a" + let p = Promise.value(sentinel) + let ap = AnyPromise(p) + XCTAssertEqual(ap.value(forKey: "value") as? String, sentinel) + } + + func testCanBridgeBool() { + let sentinel = true + let p = Promise.value(sentinel) + let ap = AnyPromise(p) + XCTAssertEqual(ap.value(forKey: "value") as? Bool, sentinel) + } + + func testCanChainOffAnyPromiseFromObjC() { + let ex = expectation(description: "") + + firstly { + .value(1) + }.then { _ -> AnyPromise in + return PromiseBridgeHelper().value(forKey: "bridge2") as! AnyPromise + }.done { value in + XCTAssertEqual(123, value as? Int) + ex.fulfill() + }.silenceWarning() + + waitForExpectations(timeout: 1) + } + + func testCanThenOffAnyPromise() { + let ex = expectation(description: "") + + PMKDummyAnyPromise_YES().then { obj -> Promise in + if let value = obj as? NSNumber { + XCTAssertEqual(value, NSNumber(value: true)) + ex.fulfill() + } + return Promise() + }.silenceWarning() + + waitForExpectations(timeout: 1) + } + + func testCanThenOffManifoldAnyPromise() { + let ex = expectation(description: "") + + PMKDummyAnyPromise_Manifold().then { obj -> Promise in + defer { ex.fulfill() } + XCTAssertEqual(obj as? NSNumber, NSNumber(value: true), "\(obj ?? "nil") is not @YES") + return Promise() + }.silenceWarning() + + waitForExpectations(timeout: 1) + } + + func testCanAlwaysOffAnyPromise() { + let ex = expectation(description: "") + + PMKDummyAnyPromise_YES().then { obj -> Promise in + ex.fulfill() + return Promise() + }.silenceWarning() + + waitForExpectations(timeout: 1) + } + + func testCanCatchOffAnyPromise() { + let ex = expectation(description: "") + PMKDummyAnyPromise_Error().catch { err in + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func testAsPromise() { + #if swift(>=3.1) + XCTAssertTrue(Promise(PMKDummyAnyPromise_Error()).isRejected) + XCTAssertEqual(Promise(PMKDummyAnyPromise_YES()).value as? NSNumber, NSNumber(value: true)) + #else + XCTAssertTrue(PMKDummyAnyPromise_Error().asPromise().isRejected) + XCTAssertEqual(PMKDummyAnyPromise_YES().asPromise().value as? NSNumber, NSNumber(value: true)) + #endif + } + + func testFirstlyReturningAnyPromiseSuccess() { + let ex = expectation(description: "") + firstly { + PMKDummyAnyPromise_Error() + }.catch { error in + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func testFirstlyReturningAnyPromiseError() { + let ex = expectation(description: "") + firstly { + PMKDummyAnyPromise_YES() + }.done { _ in + ex.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1) + } + + func test1() { + let ex = expectation(description: "") + + // AnyPromise.then { return x } + + let input = after(seconds: 0).map{ 1 } + + AnyPromise(input).then { obj -> Promise in + XCTAssertEqual(obj as? Int, 1) + return .value(2) + }.done { value in + XCTAssertEqual(value, 2) + ex.fulfill() + }.silenceWarning() + + waitForExpectations(timeout: 1) + } + + func test2() { + let ex = expectation(description: "") + + // AnyPromise.then { return AnyPromise } + + let input = after(seconds: 0).map{ 1 } + + AnyPromise(input).then { obj -> AnyPromise in + XCTAssertEqual(obj as? Int, 1) + return AnyPromise(after(seconds: 0).map{ 2 }) + }.done { obj in + XCTAssertEqual(obj as? Int, 2) + ex.fulfill() + }.silenceWarning() + + waitForExpectations(timeout: 1) + } + + func test3() { + let ex = expectation(description: "") + + // AnyPromise.then { return Promise } + + let input = after(seconds: 0).map{ 1 } + + AnyPromise(input).then { obj -> Promise in + XCTAssertEqual(obj as? Int, 1) + return after(seconds: 0).map{ 2 } + }.done { value in + XCTAssertEqual(value, 2) + ex.fulfill() + }.silenceWarning() + + waitForExpectations(timeout: 1, handler: nil) + } + + + // can return AnyPromise (that fulfills) in then handler + func test4() { + let ex = expectation(description: "") + Promise.value(1).then { _ -> AnyPromise in + return AnyPromise(after(seconds: 0).map{ 1 }) + }.done { x in + XCTAssertEqual(x as? Int, 1) + ex.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1, handler: nil) + } + + // can return AnyPromise (that rejects) in then handler + func test5() { + let ex = expectation(description: "") + + Promise.value(1).then { _ -> AnyPromise in + let promise = after(.milliseconds(100)).done{ throw Error.dummy } + return AnyPromise(promise) + }.catch { err in + ex.fulfill() + } + waitForExpectations(timeout: 1) + } + + func testStandardSwiftBridgeIsUnambiguous() { + let p = Promise.value(1) + let q = Promise(p) + + XCTAssertEqual(p.value, q.value) + } + + /// testing NSError to Error for cancelledError types + func testErrorCancellationBridging() { + let ex = expectation(description: "") + + let p = Promise().done { + throw LocalError.cancel as NSError + } + p.catch { _ in + XCTFail() + } + p.catch(policy: .allErrors) { + XCTAssertTrue($0.isCancelled) + ex.fulfill() + } + waitForExpectations(timeout: 1) + + // here we verify that Swift’s NSError bridging works as advertised + + XCTAssertTrue(LocalError.cancel.isCancelled) + XCTAssertTrue((LocalError.cancel as NSError).isCancelled) + } +} + +private enum Error: Swift.Error { + case dummy +} + +extension Promise { + func silenceWarning() {} +} + +private enum LocalError: CancellableError { + case notCancel + case cancel + + var isCancelled: Bool { + switch self { + case .notCancel: return false + case .cancel: return true + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.h b/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.h new file mode 100644 index 0000000..104378f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.h @@ -0,0 +1,14 @@ +@import Foundation; +@class AnyPromise; + +AnyPromise *PMKDummyAnyPromise_YES(void); +AnyPromise *PMKDummyAnyPromise_Manifold(void); +AnyPromise *PMKDummyAnyPromise_Error(void); + +__attribute__((objc_runtime_name("PMKPromiseBridgeHelper"))) +__attribute__((objc_subclassing_restricted)) +@interface PromiseBridgeHelper: NSObject +- (AnyPromise *)bridge1; +@end + +AnyPromise *testCase626(void); diff --git a/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.m b/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.m new file mode 100644 index 0000000..5049310 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.m @@ -0,0 +1,38 @@ +@import Foundation; +@import PromiseKit; +#import "Infrastructure.h" + +AnyPromise *PMKDummyAnyPromise_YES() { + return [AnyPromise promiseWithValue:@YES]; +} + +AnyPromise *PMKDummyAnyPromise_Manifold() { + return [AnyPromise promiseWithValue:PMKManifold(@YES, @NO, @NO)]; +} + +AnyPromise *PMKDummyAnyPromise_Error() { + return [AnyPromise promiseWithValue:[NSError errorWithDomain:@"a" code:1 userInfo:nil]]; +} + +@implementation PromiseBridgeHelper (objc) + +- (AnyPromise *)bridge2 { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + resolve(@123); + }); + }]; +} + +@end + +#import "PMKBridgeTests-Swift.h" + +AnyPromise *testCase626() { + return PMKWhen(@[[TestPromise626 promise], [TestPromise626 promise]]).then(^(id value){ + NSLog(@"Success: %@", value); + }).catch(^(NSError *error) { + NSLog(@"Error: %@", error); + @throw error; + }); +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.swift b/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.swift new file mode 100644 index 0000000..775fd31 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/Bridging/Infrastructure.swift @@ -0,0 +1,24 @@ +import PromiseKit + +// for BridgingTests.m +@objc(PMKPromiseBridgeHelper) class PromiseBridgeHelper: NSObject { + @objc func bridge1() -> AnyPromise { + let p = after(.milliseconds(10)) + return AnyPromise(p) + } +} + +enum MyError: Error { + case PromiseError +} + +@objc class TestPromise626: NSObject { + + @objc class func promise() -> AnyPromise { + let promise: Promise = Promise { seal in + seal.reject(MyError.PromiseError) + } + + return AnyPromise(promise) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/AnyPromiseTests.m b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/AnyPromiseTests.m new file mode 100644 index 0000000..ebe41c0 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/AnyPromiseTests.m @@ -0,0 +1,896 @@ +@import PromiseKit; +@import XCTest; +#import "Infrastructure.h" +#define PMKTestErrorDomain @"PMKTestErrorDomain" + +static inline NSError *dummyWithCode(NSInteger code) { + return [NSError errorWithDomain:PMKTestErrorDomain code:rand() userInfo:@{NSLocalizedDescriptionKey: @(code).stringValue}]; +} + +static inline NSError *dummy() { + return dummyWithCode(rand()); +} + +static inline AnyPromise *rejectLater() { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + dispatch_async(dispatch_get_main_queue(), ^{ + resolve(dummy()); + }); + }); + }]; +} + +static inline AnyPromise *fulfillLater() { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + resolve(@1); + }); + }]; +} + + + +@interface AnyPromiseTestSuite : XCTestCase @end @implementation AnyPromiseTestSuite + +- (void)test_01_resolve { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@1); + }]; + promise.then(^(NSNumber *o){ + [ex1 fulfill]; + XCTAssertEqual(o.intValue, 1); + }); + promise.catch(^{ + XCTFail(); + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_02_reject { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(dummyWithCode(2)); + }]; + promise.then(^{ + XCTFail(); + }); + promise.catch(^(NSError *error){ + XCTAssertEqualObjects(error.localizedDescription, @"2"); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_03_return_error { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@2); + }]; + promise.then(^{ + return [NSError errorWithDomain:@"a" code:3 userInfo:nil]; + }).catch(^(NSError *e){ + [ex1 fulfill]; + XCTAssertEqual(3, e.code); + }); + promise.catch(^{ + XCTFail(); + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_04_return_error_doesnt_compromise_result { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@4); + }].then(^{ + return dummy(); + }); + promise.then(^{ + XCTFail(); + }); + promise.catch(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_05_throw_and_bubble { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@5); + }].then(^(id ii){ + XCTAssertEqual(5, [ii intValue]); + return [NSError errorWithDomain:@"a" code:[ii intValue] userInfo:nil]; + }).catch(^(NSError *e){ + XCTAssertEqual(e.code, 5); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_05_throw_and_bubble_more { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@5); + }].then(^{ + return dummy(); + }).then(^{ + //NOOP + }).catch(^(NSError *e){ + [ex1 fulfill]; + XCTAssertEqualObjects(e.domain, PMKTestErrorDomain); + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_06_return_error { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@5); + }].then(^{ + return dummy(); + }).catch(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_07_can_then_resolved { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@1); + }].then(^(id o){ + [ex1 fulfill]; + XCTAssertEqualObjects(@1, o); + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_07a_can_fail_rejected { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(dummyWithCode(1)); + }].catch(^(NSError *e){ + [ex1 fulfill]; + XCTAssertEqualObjects(@"1", e.localizedDescription); + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_09_async { + id ex1 = [self expectationWithDescription:@""]; + + __block int x = 0; + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@1); + }].then(^{ + XCTAssertEqual(x, 0); + x++; + }).then(^{ + XCTAssertEqual(x, 1); + x++; + }).then(^{ + XCTAssertEqual(x, 2); + x++; + }).then(^{ + XCTAssertEqual(x, 3); + x++; + }).then(^{ + XCTAssertEqual(x, 4); + x++; + + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; + + XCTAssertEqual(x, 5); +} + +- (void)test_10_then_returns_resolved_promise { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@10); + }].then(^(id o){ + XCTAssertEqualObjects(@10, o); + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@100); + }]; + }).then(^(id o){ + XCTAssertEqualObjects(@100, o); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_11_then_returns_pending_promise { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@1); + }].then(^{ + return fulfillLater(); + }).then(^(id o){ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_12_then_returns_recursive_promises { + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + + __block int x = 0; + fulfillLater().then(^{ + NSLog(@"1"); + XCTAssertEqual(x++, 0); + return fulfillLater().then(^{ + NSLog(@"2"); + XCTAssertEqual(x++, 1); + return fulfillLater().then(^{ + NSLog(@"3"); + XCTAssertEqual(x++, 2); + return fulfillLater().then(^{ + NSLog(@"4"); + XCTAssertEqual(x++, 3); + [ex2 fulfill]; + return @"foo"; + }); + }); + }); + }).then(^(id o){ + NSLog(@"5"); + XCTAssertEqualObjects(@"foo", o); + XCTAssertEqual(x++, 4); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; + + XCTAssertEqual(x, 5); +} + + - (void)test_13_then_returns_recursive_promises_that_fails { + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + + fulfillLater().then(^{ + return fulfillLater().then(^{ + return fulfillLater().then(^{ + return fulfillLater().then(^{ + [ex2 fulfill]; + return dummy(); + }); + }); + }); + }).then(^{ + XCTFail(); + }).catch(^(NSError *e){ + XCTAssertEqualObjects(e.domain, PMKTestErrorDomain); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; + } + +- (void)test_14_fail_returns_value { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@1); + }].then(^{ + return [NSError errorWithDomain:@"a" code:1 userInfo:nil]; + }).catch(^(NSError *e){ + XCTAssertEqual(e.code, 1); + return @2; + }).then(^(id o){ + XCTAssertEqualObjects(o, @2); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_15_fail_returns_promise { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@1); + }].then(^{ + return dummy(); + }).catch(^{ + return fulfillLater().then(^{ + return @123; + }); + }).then(^(id o){ + XCTAssertEqualObjects(o, @123); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_23_add_another_fail_to_already_rejected { + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + + PMKResolver resolve; + AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; + + promise.then(^{ + XCTFail(); + }).catch(^(NSError *e){ + XCTAssertEqualObjects(e.localizedDescription, @"23"); + [ex1 fulfill]; + }); + + resolve(dummyWithCode(23)); + + promise.then(^{ + XCTFail(); + }).catch(^(NSError *e){ + XCTAssertEqualObjects(e.localizedDescription, @"23"); + [ex2 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_25_then_plus_deferred_plus_GCD { + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + id ex3 = [self expectationWithDescription:@""]; + + fulfillLater().then(^(id o){ + [ex1 fulfill]; + return fulfillLater().then(^{ + return @YES; + }); + }).then(^(id o){ + XCTAssertEqualObjects(@YES, o); + [ex2 fulfill]; + }).then(^(id o){ + XCTAssertNil(o); + [ex3 fulfill]; + }).catch(^{ + XCTFail(); + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_26_promise_then_promise_fail_promise_fail { + id ex1 = [self expectationWithDescription:@""]; + + fulfillLater().then(^{ + return fulfillLater().then(^{ + return dummy(); + }).catch(^{ + return fulfillLater().then(^{ + return dummy(); + }); + }); + }).then(^{ + XCTFail(); + }).catch(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil];} + +- (void)test_27_eat_failure { + id ex1 = [self expectationWithDescription:@""]; + + fulfillLater().then(^{ + return dummy(); + }).catch(^{ + return @YES; + }).then(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_28_deferred_rejected_catch_promise { + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + + rejectLater().catch(^{ + [ex1 fulfill]; + return fulfillLater(); + }).then(^(id o){ + [ex2 fulfill]; + }).catch(^{ + XCTFail(); + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_29_deferred_rejected_catch_promise { + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + + rejectLater().catch(^{ + [ex1 fulfill]; + return fulfillLater().then(^{ + return dummy(); + }); + }).then(^{ + XCTFail(@"1"); + }).catch(^(NSError *error){ + [ex2 fulfill]; + }).catch(^{ + XCTFail(@"2"); + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_30_dispatch_returns_pending_promise { + id ex1 = [self expectationWithDescription:@""]; + dispatch_promise(^{ + return fulfillLater(); + }).then(^{ + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_31_dispatch_returns_promise { + id ex1 = [self expectationWithDescription:@""]; + dispatch_promise(^{ + return [AnyPromise promiseWithValue:@1]; + }).then(^(id o){ + XCTAssertEqualObjects(o, @1); + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_32_return_primitive { + id ex1 = [self expectationWithDescription:@""]; + __block void (^fulfiller)(id) = nil; + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + fulfiller = resolve; + }].then(^(id o){ + XCTAssertEqualObjects(o, @32); + return 3; + }).then(^(id o){ + XCTAssertEqualObjects(@3, o); + [ex1 fulfill]; + }); + fulfiller(@32); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_33_return_nil { + id ex1 = [self expectationWithDescription:@""]; + [AnyPromise promiseWithValue:@1].then(^(id o){ + XCTAssertEqualObjects(o, @1); + return nil; + }).then(^{ + return nil; + }).then(^(id o){ + XCTAssertNil(o); + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_33a_return_nil { + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithValue:@"HI"].then(^(id o){ + XCTAssertEqualObjects(o, @"HI"); + [ex1 fulfill]; + return nil; + }).then(^{ + return nil; + }).then(^{ + [ex2 fulfill]; + return nil; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_36_promise_with_value_nil { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithValue:nil].then(^(id o){ + XCTAssertNil(o); + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_42 { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithValue:@1].then(^{ + return fulfillLater(); + }).then(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_43_return_promise_from_itself { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *p = fulfillLater().then(^{ return @1; }); + p.then(^{ + return p; + }).then(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_44_reseal { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(@123); + resolve(@234); + }].then(^(id o){ + XCTAssertEqualObjects(o, @123); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_46_test_then_on { + id ex1 = [self expectationWithDescription:@""]; + + dispatch_queue_t q1 = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0); + dispatch_queue_t q2 = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [AnyPromise promiseWithValue:@1].thenOn(q1, ^{ + XCTAssertFalse([NSThread isMainThread]); + return dispatch_get_current_queue(); + }).thenOn(q2, ^(id q){ + XCTAssertFalse([NSThread isMainThread]); + XCTAssertNotEqualObjects(q, dispatch_get_current_queue()); + [ex1 fulfill]; + }); +#pragma clang diagnostic pop + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_47_finally_plus { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithValue:@1].then(^{ + return @1; + }).ensure(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_48_finally_negative { + @autoreleasepool { + id ex1 = [self expectationWithDescription:@"always"]; + id ex2 = [self expectationWithDescription:@"errorUnhandler"]; + + [AnyPromise promiseWithValue:@1].then(^{ + return dummy(); + }).ensure(^{ + [ex1 fulfill]; + }).catch(^(NSError *err){ + XCTAssertEqualObjects(err.domain, PMKTestErrorDomain); + [ex2 fulfill]; + }); + } + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_49_finally_negative_later { + id ex1 = [self expectationWithDescription:@""]; + __block int x = 0; + + [AnyPromise promiseWithValue:@1].then(^{ + XCTAssertEqual(++x, 1); + return dummy(); + }).catch(^{ + XCTAssertEqual(++x, 2); + }).then(^{ + XCTAssertEqual(++x, 3); + }).ensure(^{ + XCTAssertEqual(++x, 4); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_50_fulfill_with_pending_promise { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(fulfillLater().then(^{ return @"HI"; })); + }].then(^(id hi){ + XCTAssertEqualObjects(hi, @"HI"); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_51_fulfill_with_fulfilled_promise { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve([AnyPromise promiseWithValue:@1]); + }].then(^(id o){ + XCTAssertEqualObjects(o, @1); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_52_fulfill_with_rejected_promise { //NEEDEDanypr + id ex1 = [self expectationWithDescription:@""]; + fulfillLater().then(^{ + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve([AnyPromise promiseWithValue:dummy()]); + }]; + }).catch(^(NSError *err){ + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_53_return_rejected_promise { + id ex1 = [self expectationWithDescription:@""]; + fulfillLater().then(^{ + return @1; + }).then(^{ + return [AnyPromise promiseWithValue:dummy()]; + }).catch(^{ + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_54_reject_with_rejected_promise { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + id err = [NSError errorWithDomain:@"a" code:123 userInfo:nil]; + resolve([AnyPromise promiseWithValue:err]); + }].catch(^(NSError *err){ + XCTAssertEqual(err.code, 123); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_58_just_finally { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *promise = fulfillLater().then(^{ + return nil; + }).ensure(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; + + id ex2 = [self expectationWithDescription:@""]; + + promise.ensure(^{ + [ex2 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_59_catch_in_background { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + id err = [NSError errorWithDomain:@"a" code:123 userInfo:nil]; + resolve(err); + }].catchInBackground(^(NSError *err){ + XCTAssertEqual(err.code, 123); + XCTAssertFalse([NSThread isMainThread]); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_60_catch_on_specific_queue { + id ex1 = [self expectationWithDescription:@""]; + + NSString *expectedQueueName = @"specific queue 123"; + dispatch_queue_t q = dispatch_queue_create(expectedQueueName.UTF8String, DISPATCH_QUEUE_SERIAL); + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + id err = [NSError errorWithDomain:@"a" code:123 userInfo:nil]; + resolve(err); + }].catchOn(q, ^(NSError *err){ + XCTAssertEqual(err.code, 123); + XCTAssertFalse([NSThread isMainThread]); + NSString *currentQueueName = [NSString stringWithFormat:@"%s", dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)]; + XCTAssertEqualObjects(expectedQueueName, currentQueueName); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_properties { + XCTAssertEqualObjects([AnyPromise promiseWithValue:@1].value, @1); + XCTAssertEqualObjects([[AnyPromise promiseWithValue:dummyWithCode(2)].value localizedDescription], @"2"); + XCTAssertNil([AnyPromise promiseWithResolverBlock:^(id a){}].value); + XCTAssertTrue([AnyPromise promiseWithResolverBlock:^(id a){}].pending); + XCTAssertFalse([AnyPromise promiseWithValue:@1].pending); + XCTAssertTrue([AnyPromise promiseWithValue:@1].fulfilled); + XCTAssertFalse([AnyPromise promiseWithValue:@1].rejected); +} + +- (void)test_promiseWithValue { + XCTAssertEqual([AnyPromise promiseWithValue:@1].value, @1); + XCTAssertEqualObjects([[AnyPromise promiseWithValue:dummyWithCode(2)].value localizedDescription], @"2"); + XCTAssertEqual([AnyPromise promiseWithValue:[AnyPromise promiseWithValue:@1]].value, @1); +} + +- (void)test_race { + id ex = [self expectationWithDescription:@""]; + id p = PMKAfter(0.1).then(^{ return @2; }); + PMKRace(@[PMKAfter(0.2), PMKAfter(0.5), p]).then(^(id obj){ + XCTAssertEqual(2, [obj integerValue]); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)testInBackground { + id ex = [self expectationWithDescription:@""]; + PMKAfter(0.1).thenInBackground(^{ [ex fulfill]; }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)testEnsureOn { + id ex = [self expectationWithDescription:@""]; + PMKAfter(0.1).ensureOn(dispatch_get_global_queue(0, 0), ^{ [ex fulfill]; }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)testAdapterBlock { + void (^fetch)(PMKAdapter) = ^(PMKAdapter block){ + block(@1, nil); + }; + id ex = [self expectationWithDescription:@""]; + [AnyPromise promiseWithAdapterBlock:fetch].then(^(id obj){ + XCTAssertEqualObjects(obj, @1); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)testIntegerAdapterBlock { + void (^fetch)(PMKIntegerAdapter) = ^(PMKIntegerAdapter block){ + block(1, nil); + }; + id ex = [self expectationWithDescription:@""]; + [AnyPromise promiseWithIntegerAdapterBlock:fetch].then(^(id obj){ + XCTAssertEqualObjects(obj, @1); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)testBooleanAdapterBlock { + void (^fetch)(PMKBooleanAdapter) = ^(PMKBooleanAdapter block){ + block(YES, nil); + }; + id ex = [self expectationWithDescription:@""]; + [AnyPromise promiseWithBooleanAdapterBlock:fetch].then(^(id obj){ + XCTAssertEqualObjects(obj, @YES); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +static NSHashTable *errorArray; + +- (void)setUp { + [super setUp]; + errorArray = [NSHashTable weakObjectsHashTable]; +} + +- (void)testErrorLeaks { + id ex1 = [self expectationWithDescription:@""]; + NSError *error = dummyWithCode(1001); + [errorArray addObject:error]; + [AnyPromise promiseWithValue:error] + .then(^{ + XCTFail(); + }).catch(^(NSError *e){ + XCTAssertEqual(e.localizedDescription.intValue, 1001); + }).then(^{ + NSError *err = dummyWithCode(1002); + [errorArray addObject:err]; + return err; + }).catch(^(NSError *e){ + XCTAssertEqual(e.localizedDescription.intValue, 1002); + }).then(^{ + NSError *err = dummyWithCode(1003); + [errorArray addObject:err]; + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve){ + resolve(err); + }]; + }).catch(^(NSError *e){ + XCTAssertEqual(e.localizedDescription.intValue, 1003); + NSError *err = dummyWithCode(1004); + [errorArray addObject:err]; + return err; + }).catch(^(NSError *e){ + XCTAssertEqual(e.localizedDescription.intValue, 1004); + }).then(^{ + NSError *err = dummyWithCode(1005); + [errorArray addObject:err]; + // throw will lead to leak, if not use complie flag with "-fobjc-arc-exceptions" + @throw err; + }).catch(^(NSError *e){ + XCTAssertEqual(e.localizedDescription.intValue, 1005); + }).ensure(^{ + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)tearDown { + XCTAssertEqual(errorArray.allObjects.count, 0); + [super tearDown]; +} + +//- (void)test_nil_block { +// [AnyPromise promiseWithValue:@1].then(nil); +// [AnyPromise promiseWithValue:@1].thenOn(nil, nil); +// [AnyPromise promiseWithValue:@1].catch(nil); +// [AnyPromise promiseWithValue:@1].always(nil); +// [AnyPromise promiseWithValue:@1].alwaysOn(nil, nil); +//} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/AnyPromiseTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/AnyPromiseTests.swift new file mode 100644 index 0000000..adbc68f --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/AnyPromiseTests.swift @@ -0,0 +1,38 @@ +import PromiseKit +import XCTest + +class AnyPromiseTests: XCTestCase { + func testFulfilledResult() { + switch AnyPromise(Promise.value(true)).result { + case .fulfilled(let obj as Bool)? where obj: + break + default: + XCTFail() + } + } + + func testRejectedResult() { + switch AnyPromise(Promise(error: PMKError.badInput)).result { + case .rejected(let err)?: + print(err) + break + default: + XCTFail() + } + } + + func testPendingResult() { + switch AnyPromise(Promise.pending().promise).result { + case nil: + break + default: + XCTFail() + } + } + + func testCustomStringConvertible() { + XCTAssertEqual("\(AnyPromise(Promise.pending().promise))", "AnyPromise(…)") + XCTAssertEqual("\(AnyPromise(Promise.value(1)))", "AnyPromise(1)") + XCTAssertEqual("\(AnyPromise(Promise.value(nil)))", "AnyPromise(nil)") + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/HangTests.m b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/HangTests.m new file mode 100644 index 0000000..cf31ead --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/HangTests.m @@ -0,0 +1,13 @@ +@import PromiseKit; +@import XCTest; + +@interface HangTests: XCTestCase @end @implementation HangTests + +- (void)test { + __block int x = 0; + id value = PMKHang(PMKAfter(0.02).then(^{ x++; return 1; })); + XCTAssertEqual(x, 1); + XCTAssertEqualObjects(value, @1); +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/JoinTests.m b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/JoinTests.m new file mode 100644 index 0000000..1249cde --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/JoinTests.m @@ -0,0 +1,90 @@ +@import Foundation; +@import PromiseKit; +@import XCTest; + + +@interface JoinTests: XCTestCase @end @implementation JoinTests + +- (void)test_73_join { + XCTestExpectation *ex1 = [self expectationWithDescription:@""]; + + __block void (^fulfiller)(id) = nil; + AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + fulfiller = resolve; + }]; + + PMKJoin(@[ + [AnyPromise promiseWithValue:[NSError errorWithDomain:@"dom" code:1 userInfo:nil]], + promise, + [AnyPromise promiseWithValue:[NSError errorWithDomain:@"dom" code:2 userInfo:nil]] + ]).then(^{ + XCTFail(); + }).catch(^(NSError *error){ + id promises = error.userInfo[PMKJoinPromisesKey]; + + int cume = 0, cumv = 0; + + for (AnyPromise *promise in promises) { + if ([promise.value isKindOfClass:[NSError class]]) { + cume |= [promise.value code]; + } else { + cumv |= [promise.value unsignedIntValue]; + } + } + + XCTAssertTrue(cumv == 4); + XCTAssertTrue(cume == 3); + + [ex1 fulfill]; + }); + fulfiller(@4); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_74_join_no_errors { + XCTestExpectation *ex1 = [self expectationWithDescription:@""]; + PMKJoin(@[ + [AnyPromise promiseWithValue:@1], + [AnyPromise promiseWithValue:@2] + ]).then(^(NSArray *values, id errors) { + XCTAssertEqualObjects(values, (@[@1, @2])); + XCTAssertNil(errors); + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + + +- (void)test_75_join_no_success { + XCTestExpectation *ex1 = [self expectationWithDescription:@""]; + PMKJoin(@[ + [AnyPromise promiseWithValue:[NSError errorWithDomain:@"dom" code:1 userInfo:nil]], + [AnyPromise promiseWithValue:[NSError errorWithDomain:@"dom" code:2 userInfo:nil]], + ]).then(^{ + XCTFail(); + }).catch(^(NSError *error){ + XCTAssertNotNil(error.userInfo[PMKJoinPromisesKey]); + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_76_join_fulfills_if_empty_input { + XCTestExpectation *ex1 = [self expectationWithDescription:@""]; + PMKJoin(@[]).then(^(id a, id b, id c){ + XCTAssertEqualObjects(@[], a); + XCTAssertNil(b); + XCTAssertNil(c); + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_join_nil { + NSArray *foo = nil; + NSError *err = PMKJoin(foo).value; + XCTAssertEqual(err.domain, PMKErrorDomain); + XCTAssertEqual(err.code, PMKInvalidUsageError); +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/PMKManifoldTests.m b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/PMKManifoldTests.m new file mode 100644 index 0000000..78248d6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/PMKManifoldTests.m @@ -0,0 +1,83 @@ +@import PromiseKit; +@import XCTest; + +@interface PMKManifoldTests: XCTestCase @end @implementation PMKManifoldTests + +- (void)test_62_access_extra_elements { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + resolve(PMKManifold(@1)); + }].then(^(id o, id m, id n){ + XCTAssertNil(m, @"Accessing extra elements should not crash"); + XCTAssertNil(n, @"Accessing extra elements should not crash"); + XCTAssertEqualObjects(o, @1); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_63_then_manifold { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithValue:@0].then(^{ + return PMKManifold(@1, @2, @3); + }).then(^(id o1, id o2, id o3){ + XCTAssertEqualObjects(o1, @1); + XCTAssertEqualObjects(o2, @2); + XCTAssertEqualObjects(o3, @3); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_63_then_manifold_with_nil { + id ex1 = [self expectationWithDescription:@""]; + + [AnyPromise promiseWithValue:@0].then(^{ + return PMKManifold(@1, nil, @3); + }).then(^(id o1, id o2, id o3){ + XCTAssertEqualObjects(o1, @1); + XCTAssertEqualObjects(o2, nil); + XCTAssertEqualObjects(o3, @3); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_65_manifold_fulfill_value { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *promise = [AnyPromise promiseWithValue:@1].then(^{ + return PMKManifold(@123, @2); + }); + + promise.then(^(id a, id b){ + XCTAssertNotNil(a); + XCTAssertNotNil(b); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; + + XCTAssertEqualObjects(promise.value, @123); +} + +- (void)test_37_PMKMany_2 { + id ex1 = [self expectationWithDescription:@""]; + + PMKAfter(0.02).then(^{ + return PMKManifold(@1, @2); + }).then(^(id a, id b){ + XCTAssertEqualObjects(a, @1); + XCTAssertEqualObjects(b, @2); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/WhenTests.m b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/WhenTests.m new file mode 100644 index 0000000..f04a21a --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CoreObjC/WhenTests.m @@ -0,0 +1,265 @@ +@import Foundation; +@import PromiseKit; +@import XCTest; + + +@interface WhenTests: XCTestCase @end @implementation WhenTests + +- (void)testProgress { + + id ex = [self expectationWithDescription:@""]; + + XCTAssertNil([NSProgress currentProgress]); + + id p1 = PMKAfter(0.01); + id p2 = PMKAfter(0.02); + id p3 = PMKAfter(0.03); + id p4 = PMKAfter(0.04); + + NSProgress *progress = [NSProgress progressWithTotalUnitCount:1]; + [progress becomeCurrentWithPendingUnitCount:1]; + + PMKWhen(@[p1, p2, p3, p4]).then(^{ + XCTAssertEqual(progress.completedUnitCount, 1); + [ex fulfill]; + }); + + [progress resignCurrent]; + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)testProgressDoesNotExceed100Percent { + + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + + XCTAssertNil([NSProgress currentProgress]); + + id p1 = PMKAfter(0.01); + id p2 = PMKAfter(0.02).then(^{ return [NSError errorWithDomain:@"a" code:1 userInfo:nil]; }); + id p3 = PMKAfter(0.03); + id p4 = PMKAfter(0.04); + + id promises = @[p1, p2, p3, p4]; + + NSProgress *progress = [NSProgress progressWithTotalUnitCount:1]; + [progress becomeCurrentWithPendingUnitCount:1]; + + PMKWhen(promises).catch(^{ + [ex2 fulfill]; + }); + + [progress resignCurrent]; + + PMKJoin(promises).catch(^{ + XCTAssertLessThanOrEqual(1, progress.fractionCompleted); + XCTAssertEqual(progress.completedUnitCount, 1); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)testWhenManifolds { + id ex = [self expectationWithDescription:@""]; + id p1 = dispatch_promise(^{ return PMKManifold(@1, @2); }); + id p2 = dispatch_promise(^{}); + PMKWhen(@[p1, p2]).then(^(NSArray *results){ + XCTAssertEqualObjects(results[0], @1); + XCTAssertEqualObjects(results[1], [NSNull null]); + [ex fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_55_all_dictionary { + id ex1 = [self expectationWithDescription:@""]; + + id promises = @{ + @1: @2, + @2: @"abc", + @"a": PMKAfter(0.1).then(^{ return @"HI"; }) + }; + PMKWhen(promises).then(^(NSDictionary *dict){ + XCTAssertEqual(dict.count, 3ul); + XCTAssertEqualObjects(dict[@1], @2); + XCTAssertEqualObjects(dict[@2], @"abc"); + XCTAssertEqualObjects(dict[@"a"], @"HI"); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_56_empty_array_when { + id ex1 = [self expectationWithDescription:@""]; + + PMKWhen(@[]).then(^(NSArray *array){ + XCTAssertEqual(array.count, 0ul); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_57_empty_array_all { + id ex1 = [self expectationWithDescription:@""]; + + PMKWhen(@[]).then(^(NSArray *array){ + XCTAssertEqual(array.count, 0ul); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_18_when { + id ex1 = [self expectationWithDescription:@""]; + + id a = PMKAfter(0.02).then(^{ return @345; }); + id b = PMKAfter(0.03).then(^{ return @345; }); + PMKWhen(@[a, b]).then(^(NSArray *objs){ + XCTAssertEqual(objs.count, 2ul); + XCTAssertEqualObjects(objs[0], objs[1]); + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_21_recursive_when { + id domain = @"sdjhfg"; + + id ex1 = [self expectationWithDescription:@""]; + id a = PMKAfter(0.03).then(^{ + return [NSError errorWithDomain:domain code:123 userInfo:nil]; + }); + id b = PMKAfter(0.02); + id c = PMKWhen(@[a, b]); + PMKWhen(c).then(^{ + XCTFail(); + }).catch(^(NSError *e){ + XCTAssertEqualObjects(e.userInfo[PMKFailingPromiseIndexKey], @0); + XCTAssertEqualObjects(e.domain, domain); + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_22_already_resolved_and_bubble { + id ex1 = [self expectationWithDescription:@""]; + id ex2 = [self expectationWithDescription:@""]; + + PMKResolver resolve; + AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; + + promise.then(^{ + XCTFail(); + }).catch(^(NSError *e){ + [ex1 fulfill]; + }); + + resolve([NSError errorWithDomain:@"a" code:1 userInfo:nil]); + + PMKWhen(promise).then(^{ + XCTFail(); + }).catch(^{ + [ex2 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_24_some_edge_case { + id ex1 = [self expectationWithDescription:@""]; + id a = PMKAfter(0.02).catch(^{}); + id b = PMKAfter(0.03); + PMKWhen(@[a, b]).then(^(NSArray *objs){ + [ex1 fulfill]; + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_35_when_nil { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *promise = [AnyPromise promiseWithValue:@"35"].then(^{ return nil; }); + PMKWhen(@[PMKAfter(0.02).then(^{ return @1; }), [AnyPromise promiseWithValue:nil], promise]).then(^(NSArray *results){ + XCTAssertEqual(results.count, 3ul); + XCTAssertEqualObjects(results[1], [NSNull null]); + [ex1 fulfill]; + }).catch(^(NSError *err){ + abort(); + }); + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + + +- (void)test_39_when_with_some_values { + id ex1 = [self expectationWithDescription:@""]; + + id p = PMKAfter(0.02); + id v = @1; + PMKWhen(@[p, v]).then(^(NSArray *aa){ + XCTAssertEqual(aa.count, 2ul); + XCTAssertEqualObjects(aa[1], @1); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_40_when_with_all_values { + id ex1 = [self expectationWithDescription:@""]; + + PMKWhen(@[@1, @2]).then(^(NSArray *aa){ + XCTAssertEqualObjects(aa[0], @1); + XCTAssertEqualObjects(aa[1], @2); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_41_when_with_repeated_promises { + id ex1 = [self expectationWithDescription:@""]; + + id p = PMKAfter(0.02); + id v = @1; + PMKWhen(@[p, v, p, v]).then(^(NSArray *aa){ + XCTAssertEqual(aa.count, 4ul); + XCTAssertEqualObjects(aa[1], @1); + XCTAssertEqualObjects(aa[3], @1); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_45_when_which_returns_void { + id ex1 = [self expectationWithDescription:@""]; + + AnyPromise *promise = [AnyPromise promiseWithValue:@1].then(^{}); + PMKWhen(@[promise, [AnyPromise promiseWithValue:@1]]).then(^(NSArray *stuff){ + XCTAssertEqual(stuff.count, 2ul); + XCTAssertEqualObjects(stuff[0], [NSNull null]); + [ex1 fulfill]; + }); + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + +- (void)test_when_nil { + NSArray *foo = nil; + NSError *err = PMKWhen(foo).value; + XCTAssertEqual(err.domain, PMKErrorDomain); + XCTAssertEqual(err.code, PMKInvalidUsageError); +} + + +- (void)test_when_bad_input { + id foo = @"a"; + XCTAssertEqual(PMKWhen(foo).value, foo); +} + +@end diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/AfterTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/AfterTests.swift new file mode 100644 index 0000000..6b587c9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/AfterTests.swift @@ -0,0 +1,52 @@ +import PromiseKit +import XCTest + +class AfterTests: XCTestCase { + func testZero() { + let ex2 = expectation(description: "") + after(seconds: 0).done(ex2.fulfill) + waitForExpectations(timeout: 2, handler: nil) + + let ex3 = expectation(description: "") + after(.seconds(0)).done(ex3.fulfill) + waitForExpectations(timeout: 2, handler: nil) + + #if !SWIFT_PACKAGE + let ex4 = expectation(description: "") + __PMKAfter(0).done{ _ in ex4.fulfill() }.silenceWarning() + waitForExpectations(timeout: 2, handler: nil) + #endif + } + + func testNegative() { + let ex2 = expectation(description: "") + after(seconds: -1).done(ex2.fulfill) + waitForExpectations(timeout: 2, handler: nil) + + let ex3 = expectation(description: "") + after(.seconds(-1)).done(ex3.fulfill) + waitForExpectations(timeout: 2, handler: nil) + + #if !SWIFT_PACKAGE + let ex4 = expectation(description: "") + __PMKAfter(-1).done{ _ in ex4.fulfill() }.silenceWarning() + waitForExpectations(timeout: 2, handler: nil) + #endif + } + + func testPositive() { + let ex2 = expectation(description: "") + after(seconds: 1).done(ex2.fulfill) + waitForExpectations(timeout: 2, handler: nil) + + let ex3 = expectation(description: "") + after(.seconds(1)).done(ex3.fulfill) + waitForExpectations(timeout: 2, handler: nil) + + #if !SWIFT_PACKAGE + let ex4 = expectation(description: "") + __PMKAfter(1).done{ _ in ex4.fulfill() }.silenceWarning() + waitForExpectations(timeout: 2, handler: nil) + #endif + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/CancellableErrorTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/CancellableErrorTests.swift new file mode 100644 index 0000000..fd2b423 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/CancellableErrorTests.swift @@ -0,0 +1,130 @@ +import Foundation +import PromiseKit +import XCTest + +class CancellationTests: XCTestCase { + func testCancellation() { + let ex1 = expectation(description: "") + + let p = after(seconds: 0).done { _ in + throw LocalError.cancel + }.done { + XCTFail() + } + p.catch { _ in + XCTFail() + } + p.catch(policy: .allErrors) { + XCTAssertTrue($0.isCancelled) + ex1.fulfill() + } + + waitForExpectations(timeout: 60) + } + + func testThrowCancellableErrorThatIsNotCancelled() { + let expct = expectation(description: "") + + after(seconds: 0).done { _ in + throw LocalError.notCancel + }.done { + XCTFail() + }.catch { + XCTAssertFalse($0.isCancelled) + expct.fulfill() + } + + waitForExpectations(timeout: 1) + } + + func testRecoverWithCancellation() { + let ex1 = expectation(description: "") + let ex2 = expectation(description: "") + + let p = after(seconds: 0).done { _ in + throw CocoaError.cancelled + }.recover(policy: .allErrors) { err -> Promise in + ex1.fulfill() + XCTAssertTrue(err.isCancelled) + throw err + }.done { _ in + XCTFail() + } + p.catch { _ in + XCTFail() + } + p.catch(policy: .allErrors) { + XCTAssertTrue($0.isCancelled) + ex2.fulfill() + } + + waitForExpectations(timeout: 1) + } + + func testFoundationBridging1() { + let ex = expectation(description: "") + + let p = after(seconds: 0).done { _ in + throw CocoaError.cancelled + } + p.catch { _ in + XCTFail() + } + p.catch(policy: .allErrors) { + XCTAssertTrue($0.isCancelled) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + + func testFoundationBridging2() { + let ex = expectation(description: "") + + let p = Promise().done { + throw URLError.cancelled + } + p.catch { _ in + XCTFail() + } + p.catch(policy: .allErrors) { + XCTAssertTrue($0.isCancelled) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + +#if swift(>=3.2) + func testIsCancelled() { + XCTAssertTrue(PMKError.cancelled.isCancelled) + XCTAssertTrue(URLError.cancelled.isCancelled) + XCTAssertTrue(CocoaError.cancelled.isCancelled) + XCTAssertFalse(CocoaError(_nsError: NSError(domain: NSCocoaErrorDomain, code: CocoaError.Code.coderInvalidValue.rawValue)).isCancelled) + } +#endif +} + +private enum LocalError: CancellableError { + case notCancel + case cancel + + var isCancelled: Bool { + switch self { + case .notCancel: return false + case .cancel: return true + } + } +} + +private extension URLError { + static var cancelled: URLError { + return .init(_nsError: NSError(domain: NSURLErrorDomain, code: URLError.Code.cancelled.rawValue)) + } +} + +private extension CocoaError { + static var cancelled: CocoaError { + return .init(_nsError: NSError(domain: NSCocoaErrorDomain, code: CocoaError.Code.userCancelled.rawValue)) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/CatchableTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/CatchableTests.swift new file mode 100644 index 0000000..d94b2b6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/CatchableTests.swift @@ -0,0 +1,267 @@ +import PromiseKit +import Dispatch +import XCTest + +class CatchableTests: XCTestCase { + + func testFinally() { + let finallyQueue = DispatchQueue(label: "\(#file):\(#line)", attributes: .concurrent) + + func helper(error: Error, on queue: DispatchQueue = .main, flags: DispatchWorkItemFlags? = nil) { + let ex = (expectation(description: ""), expectation(description: "")) + var x = 0 + Promise(error: error).catch(policy: .allErrors) { _ in + XCTAssertEqual(x, 0) + x += 1 + ex.0.fulfill() + }.finally(on: queue, flags: flags) { + if let flags = flags, flags.contains(.barrier) { + dispatchPrecondition(condition: .onQueueAsBarrier(queue)) + } else { + dispatchPrecondition(condition: .onQueue(queue)) + } + XCTAssertEqual(x, 1) + x += 1 + ex.1.fulfill() + } + wait(for: [ex.0, ex.1], timeout: 10) + } + + helper(error: Error.dummy) + helper(error: Error.cancelled) + helper(error: Error.dummy, on: finallyQueue) + helper(error: Error.dummy, on: finallyQueue, flags: .barrier) + } + + func testCauterize() { + let ex = expectation(description: "") + let p = Promise(error: Error.dummy) + + // cannot test specifically that this outputs to console, + // but code-coverage will note that the line is run + p.cauterize() + + p.catch { _ in + ex.fulfill() + } + wait(for: [ex], timeout: 1) + } +} + + +/// `Promise.recover` +extension CatchableTests { + func test__void_specialized_full_recover() { + + func helper(error: Swift.Error) { + let ex = expectation(description: "") + Promise(error: error).recover { _ in }.done(ex.fulfill) + wait(for: [ex], timeout: 10) + } + + helper(error: Error.dummy) + helper(error: Error.cancelled) + } + + func test__void_specialized_full_recover__fulfilled_path() { + let ex = expectation(description: "") + Promise().recover { _ in XCTFail() }.done(ex.fulfill) + wait(for: [ex], timeout: 10) + } + + func test__void_specialized_conditional_recover() { + func helper(policy: CatchPolicy, error: Swift.Error, line: UInt = #line) { + let ex = expectation(description: "") + var x = 0 + Promise(error: error).recover(policy: policy) { err in + guard x < 1 else { throw err } + x += 1 + }.done(ex.fulfill).silenceWarning() + wait(for: [ex], timeout: 10) + } + + for error in [Error.dummy as Swift.Error, Error.cancelled] { + helper(policy: .allErrors, error: error) + } + helper(policy: .allErrorsExceptCancellation, error: Error.dummy) + } + + func test__void_specialized_conditional_recover__no_recover() { + + func helper(policy: CatchPolicy, error: Error, line: UInt = #line) { + let ex = expectation(description: "") + Promise(error: error).recover(policy: policy) { err in + throw err + }.catch(policy: .allErrors) { + XCTAssertEqual(error, $0 as? Error) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + for error in [Error.dummy, Error.cancelled] { + helper(policy: .allErrors, error: error) + } + helper(policy: .allErrorsExceptCancellation, error: Error.dummy) + } + + func test__void_specialized_conditional_recover__ignores_cancellation_but_fed_cancellation() { + let ex = expectation(description: "") + Promise(error: Error.cancelled).recover(policy: .allErrorsExceptCancellation) { _ in + XCTFail() + }.catch(policy: .allErrors) { + XCTAssertEqual(Error.cancelled, $0 as? Error) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func test__void_specialized_conditional_recover__fulfilled_path() { + let ex = expectation(description: "") + Promise().recover { _ in + XCTFail() + }.catch { _ in + XCTFail() // this `catch` to ensure we are calling the `recover` variant we think we are + }.finally { + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } +} + + +/// `Promise.recover` +extension CatchableTests { + func test__full_recover() { + + func helper(error: Swift.Error) { + let ex = expectation(description: "") + Promise(error: error).recover { _ in return .value(2) }.done { + XCTAssertEqual($0, 2) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + helper(error: Error.dummy) + helper(error: Error.cancelled) + } + + func test__full_recover__fulfilled_path() { + let ex = expectation(description: "") + Promise.value(1).recover { _ in XCTFail(); return .value(2) }.done{ + XCTAssertEqual($0, 1) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + + func test__conditional_recover() { + func helper(policy: CatchPolicy, error: Swift.Error, line: UInt = #line) { + let ex = expectation(description: "") + var x = 0 + Promise(error: error).recover(policy: policy) { err -> Promise in + guard x < 1 else { throw err } + x += 1 + return .value(x) + }.done { + XCTAssertEqual($0, x) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } + + for error in [Error.dummy as Swift.Error, Error.cancelled] { + helper(policy: .allErrors, error: error) + } + helper(policy: .allErrorsExceptCancellation, error: Error.dummy) + } + + func test__conditional_recover__no_recover() { + + func helper(policy: CatchPolicy, error: Error, line: UInt = #line) { + let ex = expectation(description: "") + Promise(error: error).recover(policy: policy) { err -> Promise in + throw err + }.catch(policy: .allErrors) { + XCTAssertEqual(error, $0 as? Error) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + for error in [Error.dummy, Error.cancelled] { + helper(policy: .allErrors, error: error) + } + helper(policy: .allErrorsExceptCancellation, error: Error.dummy) + } + + func test__conditional_recover__ignores_cancellation_but_fed_cancellation() { + let ex = expectation(description: "") + Promise(error: Error.cancelled).recover(policy: .allErrorsExceptCancellation) { _ -> Promise in + XCTFail() + return .value(1) + }.catch(policy: .allErrors) { + XCTAssertEqual(Error.cancelled, $0 as? Error) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func test__conditional_recover__fulfilled_path() { + let ex = expectation(description: "") + Promise.value(1).recover { err -> Promise in + XCTFail() + throw err + }.done { + XCTAssertEqual($0, 1) + ex.fulfill() + }.catch { _ in + XCTFail() // this `catch` to ensure we are calling the `recover` variant we think we are + } + wait(for: [ex], timeout: 10) + } + + func testEnsureThen_Error() { + let ex = expectation(description: "") + + Promise.value(1).done { + XCTAssertEqual($0, 1) + throw Error.dummy + }.ensureThen { + after(seconds: 0.01) + }.catch { + XCTAssertEqual(Error.dummy, $0 as? Error) + }.finally { + ex.fulfill() + } + + wait(for: [ex], timeout: 10) + } + + func testEnsureThen_Value() { + let ex = expectation(description: "") + + Promise.value(1).ensureThen { + after(seconds: 0.01) + }.done { + XCTAssertEqual($0, 1) + }.catch { _ in + XCTFail() + }.finally { + ex.fulfill() + } + + wait(for: [ex], timeout: 10) + } +} + +private enum Error: CancellableError { + case dummy + case cancelled + + var isCancelled: Bool { + return self == Error.cancelled + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/DefaultDispatchQueueTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/DefaultDispatchQueueTests.swift new file mode 100644 index 0000000..f9908e2 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/DefaultDispatchQueueTests.swift @@ -0,0 +1,70 @@ +// +// PMKDefaultDispatchQueue.test.swift +// PromiseKit +// +// Created by David Rodriguez on 4/14/16. +// Copyright © 2016 Max Howell. All rights reserved. +// + +import class Foundation.Thread +import PromiseKit +import Dispatch +import XCTest + +private enum Error: Swift.Error { case dummy } + + +class PMKDefaultDispatchQueueTest: XCTestCase { + + let myQueue = DispatchQueue(label: "myQueue") + + override func setUp() { + // can actually only set the default queue once + // - See: PMKSetDefaultDispatchQueue + conf.Q = (myQueue, myQueue) + } + + override func tearDown() { + conf.Q = (.main, .main) + } + + func testOverrodeDefaultThenQueue() { + let ex = expectation(description: "resolving") + + Promise.value(1).then { _ -> Promise in + ex.fulfill() + XCTAssertFalse(Thread.isMainThread) + return Promise() + }.silenceWarning() + + XCTAssertTrue(Thread.isMainThread) + + waitForExpectations(timeout: 1) + } + + func testOverrodeDefaultCatchQueue() { + let ex = expectation(description: "resolving") + + Promise(error: Error.dummy).catch { _ in + ex.fulfill() + XCTAssertFalse(Thread.isMainThread) + } + + XCTAssertTrue(Thread.isMainThread) + + waitForExpectations(timeout: 1) + } + + func testOverrodeDefaultAlwaysQueue() { + let ex = expectation(description: "resolving") + + Promise.value(1).ensure { + ex.fulfill() + XCTAssertFalse(Thread.isMainThread) + }.silenceWarning() + + XCTAssertTrue(Thread.isMainThread) + + waitForExpectations(timeout: 1) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ErrorTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ErrorTests.swift new file mode 100644 index 0000000..d9087d2 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ErrorTests.swift @@ -0,0 +1,22 @@ +import PromiseKit +import XCTest + +class PMKErrorTests: XCTestCase { + func testCustomStringConvertible() { + XCTAssertNotNil(PMKError.invalidCallingConvention.errorDescription) + XCTAssertNotNil(PMKError.returnedSelf.errorDescription) + XCTAssertNotNil(PMKError.badInput.errorDescription) + XCTAssertNotNil(PMKError.cancelled.errorDescription) + XCTAssertNotNil(PMKError.compactMap(1, Int.self).errorDescription) + XCTAssertNotNil(PMKError.emptySequence.errorDescription) + } + + func testCustomDebugStringConvertible() { + XCTAssertFalse(PMKError.invalidCallingConvention.debugDescription.isEmpty) + XCTAssertFalse(PMKError.returnedSelf.debugDescription.isEmpty) + XCTAssertNotNil(PMKError.badInput.debugDescription.isEmpty) + XCTAssertFalse(PMKError.cancelled.debugDescription.isEmpty) + XCTAssertFalse(PMKError.compactMap(1, Int.self).debugDescription.isEmpty) + XCTAssertFalse(PMKError.emptySequence.debugDescription.isEmpty) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/GuaranteeTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/GuaranteeTests.swift new file mode 100644 index 0000000..6c2d60b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/GuaranteeTests.swift @@ -0,0 +1,33 @@ +import PromiseKit +import XCTest + +class GuaranteeTests: XCTestCase { + func testInit() { + let ex = expectation(description: "") + Guarantee { seal in + seal(1) + }.done { + XCTAssertEqual(1, $0) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testWait() { + XCTAssertEqual(after(.milliseconds(100)).map(on: nil){ 1 }.wait(), 1) + } + + func testThenMap() { + + let ex = expectation(description: "") + + Guarantee.value([1, 2, 3]) + .thenMap { Guarantee.value($0 * 2) } + .done { values in + XCTAssertEqual([2, 4, 6], values) + ex.fulfill() + } + + wait(for: [ex], timeout: 10) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/HangTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/HangTests.swift new file mode 100644 index 0000000..84156d3 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/HangTests.swift @@ -0,0 +1,38 @@ +import PromiseKit +import XCTest + +class HangTests: XCTestCase { + func test() { + let ex = expectation(description: "block executed") + do { + let value = try hang(after(seconds: 0.02).then { _ -> Promise in + ex.fulfill() + return .value(1) + }) + XCTAssertEqual(value, 1) + } catch { + XCTFail("Unexpected error") + } + waitForExpectations(timeout: 0) + } + + enum Error: Swift.Error { + case test + } + + func testError() { + var value = 0 + do { + _ = try hang(after(seconds: 0.02).done { + value = 1 + throw Error.test + }) + XCTAssertEqual(value, 1) + } catch Error.test { + return + } catch { + XCTFail("Unexpected error (expected Error.test)") + } + XCTFail("Expected error but no error was thrown") + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/PromiseTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/PromiseTests.swift new file mode 100644 index 0000000..b5f7458 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/PromiseTests.swift @@ -0,0 +1,139 @@ +import PromiseKit +import Dispatch +import XCTest + +class PromiseTests: XCTestCase { + func testIsPending() { + XCTAssertTrue(Promise.pending().promise.isPending) + XCTAssertFalse(Promise().isPending) + XCTAssertFalse(Promise(error: Error.dummy).isPending) + } + + func testIsResolved() { + XCTAssertFalse(Promise.pending().promise.isResolved) + XCTAssertTrue(Promise().isResolved) + XCTAssertTrue(Promise(error: Error.dummy).isResolved) + } + + func testIsFulfilled() { + XCTAssertFalse(Promise.pending().promise.isFulfilled) + XCTAssertTrue(Promise().isFulfilled) + XCTAssertFalse(Promise(error: Error.dummy).isFulfilled) + } + + func testIsRejected() { + XCTAssertFalse(Promise.pending().promise.isRejected) + XCTAssertTrue(Promise(error: Error.dummy).isRejected) + XCTAssertFalse(Promise().isRejected) + } + + @available(macOS 10.10, iOS 2.0, tvOS 10.0, watchOS 2.0, *) + func testDispatchQueueAsyncExtensionReturnsPromise() { + let ex = expectation(description: "") + + DispatchQueue.global().async(.promise) { () -> Int in + XCTAssertFalse(Thread.isMainThread) + return 1 + }.done { one in + XCTAssertEqual(one, 1) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + + @available(macOS 10.10, iOS 2.0, tvOS 10.0, watchOS 2.0, *) + func testDispatchQueueAsyncExtensionCanThrowInBody() { + let ex = expectation(description: "") + + DispatchQueue.global().async(.promise) { () -> Int in + throw Error.dummy + }.done { _ in + XCTFail() + }.catch { _ in + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + + func testCustomStringConvertible() { + XCTAssertEqual(Promise.pending().promise.debugDescription, "Promise.pending(handlers: 0)") + XCTAssertEqual(Promise().debugDescription, "Promise<()>.fulfilled(())") + XCTAssertEqual(Promise(error: Error.dummy).debugDescription, "Promise.rejected(Error.dummy)") + + XCTAssertEqual("\(Promise.pending().promise)", "Promise(…Int)") + XCTAssertEqual("\(Promise.value(3))", "Promise(3)") + XCTAssertEqual("\(Promise(error: Error.dummy))", "Promise(dummy)") + } + + func testCannotFulfillWithError() { + + // sadly this test proves the opposite :( + // left here so maybe one day we can prevent instantiation of `Promise` + + _ = Promise { seal in + seal.fulfill(Error.dummy) + } + + _ = Promise.pending() + + _ = Promise.value(Error.dummy) + + _ = Promise().map { Error.dummy } + } + +#if swift(>=3.1) + func testCanMakeVoidPromise() { + _ = Promise() + _ = Guarantee() + } +#endif + + enum Error: Swift.Error { + case dummy + } + + func testThrowInInitializer() { + let p = Promise { _ in + throw Error.dummy + } + XCTAssertTrue(p.isRejected) + guard let err = p.error, case Error.dummy = err else { return XCTFail() } + } + + func testThrowInFirstly() { + let ex = expectation(description: "") + + firstly { () -> Promise in + throw Error.dummy + }.catch { + XCTAssertEqual($0 as? Error, Error.dummy) + ex.fulfill() + } + + wait(for: [ex], timeout: 10) + } + + func testWait() throws { + let p = after(.milliseconds(100)).then(on: nil){ Promise.value(1) } + XCTAssertEqual(try p.wait(), 1) + + do { + let p = after(.milliseconds(100)).map(on: nil){ throw Error.dummy } + try p.wait() + XCTFail() + } catch { + XCTAssertEqual(error as? Error, Error.dummy) + } + } + + func testPipeForResolved() { + let ex = expectation(description: "") + Promise.value(1).done { + XCTAssertEqual(1, $0) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/RaceTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/RaceTests.swift new file mode 100644 index 0000000..c3676a1 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/RaceTests.swift @@ -0,0 +1,51 @@ +import XCTest +import PromiseKit + +class RaceTests: XCTestCase { + func test1() { + let ex = expectation(description: "") + race(after(.milliseconds(10)).then{ Promise.value(1) }, after(seconds: 1).map{ 2 }).done { index in + XCTAssertEqual(index, 1) + ex.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1, handler: nil) + } + + func test2() { + let ex = expectation(description: "") + race(after(seconds: 1).map{ 1 }, after(.milliseconds(10)).map{ 2 }).done { index in + XCTAssertEqual(index, 2) + ex.fulfill() + } + waitForExpectations(timeout: 1, handler: nil) + } + + func test1Array() { + let ex = expectation(description: "") + let promises = [after(.milliseconds(10)).map{ 1 }, after(seconds: 1).map{ 2 }] + race(promises).done { index in + XCTAssertEqual(index, 1) + ex.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1, handler: nil) + } + + func test2Array() { + let ex = expectation(description: "") + race(after(seconds: 1).map{ 1 }, after(.milliseconds(10)).map{ 2 }).done { index in + XCTAssertEqual(index, 2) + ex.fulfill() + } + waitForExpectations(timeout: 1, handler: nil) + } + + func testEmptyArray() { + let ex = expectation(description: "") + let empty = [Promise]() + race(empty).catch { + guard case PMKError.badInput = $0 else { return XCTFail() } + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/RegressionTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/RegressionTests.swift new file mode 100644 index 0000000..8bcb1a0 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/RegressionTests.swift @@ -0,0 +1,27 @@ +import PromiseKit +import XCTest + +class RegressionTests: XCTestCase { + func testReturningPreviousPromiseWorks() { + + // regression test because we were doing this wrong + // in our A+ tests implementation for spec: 2.3.1 + + do { + let promise1 = Promise() + let promise2 = promise1.then(on: nil) { promise1 } + promise2.catch(on: nil) { _ in XCTFail() } + } + do { + enum Error: Swift.Error { case dummy } + + let promise1 = Promise(error: Error.dummy) + let promise2 = promise1.recover(on: nil) { _ in promise1 } + promise2.catch(on: nil) { err in + if case PMKError.returnedSelf = err { + XCTFail() + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ResolverTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ResolverTests.swift new file mode 100644 index 0000000..fc4584d --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ResolverTests.swift @@ -0,0 +1,166 @@ +import PromiseKit +import XCTest + +class WrapTests: XCTestCase { + fileprivate class KittenFetcher { + let value: Int? + let error: Error? + + init(value: Int?, error: Error?) { + self.value = value + self.error = error + } + + func fetchWithCompletionBlock(block: @escaping(Int?, Error?) -> Void) { + after(.milliseconds(20)).done { + block(self.value, self.error) + } + } + + func fetchWithCompletionBlock2(block: @escaping(Error?, Int?) -> Void) { + after(.milliseconds(20)).done { + block(self.error, self.value) + } + } + + func fetchWithCompletionBlock3(block: @escaping(Int, Error?) -> Void) { + after(.milliseconds(20)).done { + block(self.value ?? -99, self.error) + } + } + + func fetchWithCompletionBlock4(block: @escaping(Error?) -> Void) { + after(.milliseconds(20)).done { + block(self.error) + } + } + } + + func testSuccess() { + let ex = expectation(description: "") + let kittenFetcher = KittenFetcher(value: 2, error: nil) + Promise { seal in + kittenFetcher.fetchWithCompletionBlock(block: seal.resolve) + }.done { + XCTAssertEqual($0, 2) + ex.fulfill() + }.silenceWarning() + + waitForExpectations(timeout: 1) + } + + func testError() { + let ex = expectation(description: "") + + let kittenFetcher = KittenFetcher(value: nil, error: Error.test) + Promise { seal in + kittenFetcher.fetchWithCompletionBlock(block: seal.resolve) + }.catch { error in + defer { ex.fulfill() } + guard case Error.test = error else { + return XCTFail() + } + } + + waitForExpectations(timeout: 1) + } + + func testInvalidCallingConvention() { + let ex = expectation(description: "") + + let kittenFetcher = KittenFetcher(value: nil, error: nil) + Promise { seal in + kittenFetcher.fetchWithCompletionBlock(block: seal.resolve) + }.catch { error in + defer { ex.fulfill() } + guard case PMKError.invalidCallingConvention = error else { + return XCTFail() + } + } + + waitForExpectations(timeout: 1) + } + + func testInvertedCallingConvention() { + let ex = expectation(description: "") + let kittenFetcher = KittenFetcher(value: 2, error: nil) + Promise { seal in + kittenFetcher.fetchWithCompletionBlock2(block: seal.resolve) + }.done { + XCTAssertEqual($0, 2) + ex.fulfill() + }.silenceWarning() + + waitForExpectations(timeout: 1) + + } + + func testNonOptionalFirstParameter() { + let ex1 = expectation(description: "") + let kf1 = KittenFetcher(value: 2, error: nil) + Promise { seal in + kf1.fetchWithCompletionBlock3(block: seal.resolve) + }.done { + XCTAssertEqual($0, 2) + ex1.fulfill() + }.silenceWarning() + + let ex2 = expectation(description: "") + let kf2 = KittenFetcher(value: -100, error: Error.test) + Promise { seal in + kf2.fetchWithCompletionBlock3(block: seal.resolve) + }.catch { _ in ex2.fulfill() } + + wait(for: [ex1, ex2] ,timeout: 1) + } + +#if swift(>=3.1) + func testVoidCompletionValue() { + let ex1 = expectation(description: "") + let kf1 = KittenFetcher(value: nil, error: nil) + Promise { seal in + kf1.fetchWithCompletionBlock4(block: seal.resolve) + }.done(ex1.fulfill).silenceWarning() + + let ex2 = expectation(description: "") + let kf2 = KittenFetcher(value: nil, error: Error.test) + Promise { seal in + kf2.fetchWithCompletionBlock4(block: seal.resolve) + }.catch { _ in ex2.fulfill() } + + wait(for: [ex1, ex2], timeout: 1) + } +#endif + + func testIsFulfilled() { + XCTAssertTrue(Promise.value(()).result?.isFulfilled ?? false) + XCTAssertFalse(Promise(error: Error.test).result?.isFulfilled ?? true) + } + + func testPendingPromiseDeallocated() { + + // NOTE this doesn't seem to register the `deinit` as covered :( + // BUT putting a breakpoint in the deinit CLEARLY shows it getting covered… + + class Foo { + let p = Promise.pending() + var ex: XCTestExpectation! + + deinit { + after(.milliseconds(100)).done(ex.fulfill) + } + } + + let ex = expectation(description: "") + do { + // for code coverage report for `Resolver.deinit` warning + let foo = Foo() + foo.ex = ex + } + wait(for: [ex], timeout: 10) + } +} + +private enum Error: Swift.Error { + case test +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/StressTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/StressTests.swift new file mode 100644 index 0000000..787e485 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/StressTests.swift @@ -0,0 +1,78 @@ +import PromiseKit +import Dispatch +import XCTest + +class StressTests: XCTestCase { + func testThenDataRace() { + let e1 = expectation(description: "") + + //will crash if then doesn't protect handlers + stressDataRace(expectation: e1, stressFunction: { promise in + promise.done { s in + XCTAssertEqual("ok", s) + return + }.silenceWarning() + }, fulfill: { "ok" }) + + waitForExpectations(timeout: 10, handler: nil) + } + + @available(macOS 10.10, iOS 2.0, tvOS 10.0, watchOS 2.0, *) + func testThensAreSequentialForLongTime() { + var values = [Int]() + let ex = expectation(description: "") + var promise = DispatchQueue.global().async(.promise){ 0 } + let N = 1000 + for x in 1.. Guarantee in + values.append(y) + XCTAssertEqual(x - 1, y) + return DispatchQueue.global().async(.promise) { x } + } + } + promise.done { x in + values.append(x) + XCTAssertEqual(values, (0..(expectation e1: XCTestExpectation, iterations: Int = 1000, stressFactor: Int = 10, stressFunction: @escaping (Promise) -> Void, fulfill f: @escaping () -> T) { + let group = DispatchGroup() + let queue = DispatchQueue(label: "the.domain.of.Zalgo", attributes: .concurrent) + + for _ in 0...pending() + + DispatchQueue.concurrentPerform(iterations: stressFactor) { n in + stressFunction(promise) + } + + queue.async(group: group) { + seal.fulfill(f()) + } + } + + group.notify(queue: queue, execute: e1.fulfill) +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ThenableTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ThenableTests.swift new file mode 100644 index 0000000..a1dbb02 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ThenableTests.swift @@ -0,0 +1,155 @@ +import PromiseKit +import Dispatch +import XCTest + +class ThenableTests: XCTestCase { + func testGet() { + let ex1 = expectation(description: "") + let ex2 = expectation(description: "") + Promise.value(1).get { + XCTAssertEqual($0, 1) + ex1.fulfill() + }.done { + XCTAssertEqual($0, 1) + ex2.fulfill() + }.silenceWarning() + wait(for: [ex1, ex2], timeout: 10) + } + + func testCompactMap() { + let ex = expectation(description: "") + Promise.value(1.0).compactMap { + Int($0) + }.done { + XCTAssertEqual($0, 1) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } + + func testCompactMapThrows() { + + enum E: Error { case dummy } + + let ex = expectation(description: "") + Promise.value("a").compactMap { x -> Int in + throw E.dummy + }.catch { + if case E.dummy = $0 {} else { + XCTFail() + } + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testRejectedPromiseCompactMap() { + + enum E: Error { case dummy } + + let ex = expectation(description: "") + Promise(error: E.dummy).compactMap { + Int($0) + }.catch { + if case E.dummy = $0 {} else { + XCTFail() + } + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testPMKErrorCompactMap() { + let ex = expectation(description: "") + Promise.value("a").compactMap { + Int($0) + }.catch { + if case PMKError.compactMap = $0 {} else { + XCTFail() + } + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testCompactMapValues() { + let ex = expectation(description: "") + Promise.value(["1","2","a","4"]).compactMapValues { + Int($0) + }.done { + XCTAssertEqual([1,2,4], $0) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } + + func testThenMap() { + let ex = expectation(description: "") + Promise.value([1,2,3,4]).thenMap { + Promise.value($0) + }.done { + XCTAssertEqual([1,2,3,4], $0) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } + + func testThenFlatMap() { + let ex = expectation(description: "") + Promise.value([1,2,3,4]).thenFlatMap { + Promise.value([$0, $0]) + }.done { + XCTAssertEqual([1,1,2,2,3,3,4,4], $0) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } + + func testLastValueForEmpty() { + XCTAssertTrue(Promise.value([]).lastValue.isRejected) + } + + func testFirstValueForEmpty() { + XCTAssertTrue(Promise.value([]).firstValue.isRejected) + } + + func testThenOffRejected() { + // surprisingly missing in our CI, mainly due to + // extensive use of `done` in A+ tests since PMK 5 + + let ex = expectation(description: "") + Promise(error: PMKError.badInput).then { x -> Promise in + XCTFail() + return .value(x) + }.catch { _ in + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testBarrier() { + let ex = expectation(description: "") + let q = DispatchQueue(label: "\(#file):\(#line)", attributes: .concurrent) + Promise.value(1).done(on: q, flags: .barrier) { + XCTAssertEqual($0, 1) + dispatchPrecondition(condition: .onQueueAsBarrier(q)) + ex.fulfill() + }.catch { _ in + XCTFail() + } + wait(for: [ex], timeout: 10) + } + + func testDispatchFlagsSyntax() { + let ex = expectation(description: "") + let q = DispatchQueue(label: "\(#file):\(#line)", attributes: .concurrent) + Promise.value(1).done(on: q, flags: [.barrier, .inheritQoS]) { + XCTAssertEqual($0, 1) + dispatchPrecondition(condition: .onQueueAsBarrier(q)) + ex.fulfill() + }.catch { _ in + XCTFail() + } + wait(for: [ex], timeout: 10) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/Utilities.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/Utilities.swift new file mode 100644 index 0000000..6e9bce6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/Utilities.swift @@ -0,0 +1,33 @@ +import PromiseKit + +extension Promise { + func silenceWarning() {} +} + +#if os(Linux) +import func CoreFoundation._CFIsMainThread + +extension Thread { + // `isMainThread` is not implemented yet in swift-corelibs-foundation. + static var isMainThread: Bool { + return _CFIsMainThread() + } +} + +import XCTest + +extension XCTestCase { + func wait(for: [XCTestExpectation], timeout: TimeInterval, file: StaticString = #file, line: UInt = #line) { + #if !(swift(>=4.0) && !swift(>=4.1)) + let line = Int(line) + #endif + waitForExpectations(timeout: timeout, file: file, line: line) + } +} + +extension XCTestExpectation { + func fulfill() { + fulfill(#file, line: #line) + } +} +#endif diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenConcurrentTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenConcurrentTests.swift new file mode 100644 index 0000000..54eb6ef --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenConcurrentTests.swift @@ -0,0 +1,159 @@ +import XCTest +import PromiseKit + +class WhenConcurrentTestCase_Swift: XCTestCase { + + func testWhen() { + let e = expectation(description: "") + + var numbers = (0..<42).makeIterator() + let squareNumbers = numbers.map { $0 * $0 } + + let generator = AnyIterator> { + guard let number = numbers.next() else { + return nil + } + + return after(.milliseconds(10)).map { + return number * number + } + } + + when(fulfilled: generator, concurrently: 5).done { numbers in + if numbers == squareNumbers { + e.fulfill() + } + }.silenceWarning() + + waitForExpectations(timeout: 3, handler: nil) + } + + func testWhenEmptyGenerator() { + let e = expectation(description: "") + + let generator = AnyIterator> { + return nil + } + + when(fulfilled: generator, concurrently: 5).done { numbers in + if numbers.count == 0 { + e.fulfill() + } + }.silenceWarning() + + waitForExpectations(timeout: 1, handler: nil) + } + + func testWhenGeneratorError() { + enum LocalError: Error { + case Unknown + case DivisionByZero + } + + let expectedErrorIndex = 42 + let expectedError = LocalError.DivisionByZero + + let e = expectation(description: "") + + var numbers = (-expectedErrorIndex..> { + guard let number = numbers.next() else { + return nil + } + + return after(.milliseconds(10)).then { _ -> Promise in + if number != 0 { + return Promise(error: expectedError) + } else { + return .value(100500 / number) + } + } + } + + when(fulfilled: generator, concurrently: 3) + .catch { error in + guard let error = error as? LocalError else { + return + } + guard case .DivisionByZero = error else { + return + } + e.fulfill() + } + + waitForExpectations(timeout: 3, handler: nil) + } + + func testWhenConcurrency() { + let expectedConcurrently = 4 + var currentConcurrently = 0 + var maxConcurrently = 0 + + let e = expectation(description: "") + + var numbers = (0..<42).makeIterator() + + let generator = AnyIterator> { + currentConcurrently += 1 + maxConcurrently = max(maxConcurrently, currentConcurrently) + + guard let number = numbers.next() else { + return nil + } + + return after(.milliseconds(10)).then(on: .main) { _ -> Promise in + currentConcurrently -= 1 + return .value(number * number) + } + } + + when(fulfilled: generator, concurrently: expectedConcurrently).done { _ in + XCTAssertEqual(expectedConcurrently, maxConcurrently) + e.fulfill() + }.silenceWarning() + + waitForExpectations(timeout: 3) + } + + func testWhenConcurrencyLessThanZero() { + let generator = AnyIterator> { XCTFail(); return nil } + + let p1 = when(fulfilled: generator, concurrently: 0) + let p2 = when(fulfilled: generator, concurrently: -1) + + guard let e1 = p1.error else { return XCTFail() } + guard let e2 = p2.error else { return XCTFail() } + guard case PMKError.badInput = e1 else { return XCTFail() } + guard case PMKError.badInput = e2 else { return XCTFail() } + } + + func testStopsDequeueingOnceRejected() { + let ex = expectation(description: "") + enum Error: Swift.Error { case dummy } + + var x: UInt = 0 + let generator = AnyIterator> { + x += 1 + switch x { + case 0: + fatalError() + case 1: + return Promise() + case 2: + return Promise(error: Error.dummy) + case _: + XCTFail() + return nil + } + } + + when(fulfilled: generator, concurrently: 1).done { + XCTFail("\($0)") + }.catch { error in + ex.fulfill() + } + + waitForExpectations(timeout: 3) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenResolvedTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenResolvedTests.swift new file mode 100644 index 0000000..1eaf930 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenResolvedTests.swift @@ -0,0 +1,41 @@ +// Created by Austin Feight on 3/19/16. +// Copyright © 2016 Max Howell. All rights reserved. + +import PromiseKit +import XCTest + +class JoinTests: XCTestCase { + func testImmediates() { + let successPromise = Promise() + + var joinFinished = false + when(resolved: successPromise).done(on: nil) { _ in joinFinished = true } + XCTAssert(joinFinished, "Join immediately finishes on fulfilled promise") + + let promise2 = Promise.value(2) + let promise3 = Promise.value(3) + let promise4 = Promise.value(4) + var join2Finished = false + when(resolved: promise2, promise3, promise4).done(on: nil) { _ in join2Finished = true } + XCTAssert(join2Finished, "Join immediately finishes on fulfilled promises") + } + + func testFulfilledAfterAllResolve() { + let (promise1, seal1) = Promise.pending() + let (promise2, seal2) = Promise.pending() + let (promise3, seal3) = Promise.pending() + + var finished = false + when(resolved: promise1, promise2, promise3).done(on: nil) { _ in finished = true } + XCTAssertFalse(finished, "Not all promises have resolved") + + seal1.fulfill(()) + XCTAssertFalse(finished, "Not all promises have resolved") + + seal2.fulfill(()) + XCTAssertFalse(finished, "Not all promises have resolved") + + seal3.fulfill(()) + XCTAssert(finished, "All promises have resolved") + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenTests.swift new file mode 100644 index 0000000..69ccfaa --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/WhenTests.swift @@ -0,0 +1,265 @@ +import PromiseKit +import Dispatch +import XCTest + +class WhenTests: XCTestCase { + + func testEmpty() { + let e1 = expectation(description: "") + let promises: [Promise] = [] + when(fulfilled: promises).done { _ in + e1.fulfill() + }.silenceWarning() + + let e2 = expectation(description: "") + when(resolved: promises).done { _ in + e2.fulfill() + }.silenceWarning() + + wait(for: [e1, e2], timeout: 1) + } + + func testInt() { + let e1 = expectation(description: "") + let p1 = Promise.value(1) + let p2 = Promise.value(2) + let p3 = Promise.value(3) + let p4 = Promise.value(4) + + when(fulfilled: [p1, p2, p3, p4]).done { x in + XCTAssertEqual(x[0], 1) + XCTAssertEqual(x[1], 2) + XCTAssertEqual(x[2], 3) + XCTAssertEqual(x[3], 4) + XCTAssertEqual(x.count, 4) + e1.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1, handler: nil) + } + + func testDoubleTuple() { + let e1 = expectation(description: "") + let p1 = Promise.value(1) + let p2 = Promise.value("abc") + when(fulfilled: p1, p2).done{ x, y in + XCTAssertEqual(x, 1) + XCTAssertEqual(y, "abc") + e1.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1, handler: nil) + } + + func testTripleTuple() { + let e1 = expectation(description: "") + let p1 = Promise.value(1) + let p2 = Promise.value("abc") + let p3 = Promise.value( 1.0) + when(fulfilled: p1, p2, p3).done { u, v, w in + XCTAssertEqual(1, u) + XCTAssertEqual("abc", v) + XCTAssertEqual(1.0, w) + e1.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1, handler: nil) + } + + func testQuadrupleTuple() { + let e1 = expectation(description: "") + let p1 = Promise.value(1) + let p2 = Promise.value("abc") + let p3 = Promise.value(1.0) + let p4 = Promise.value(true) + when(fulfilled: p1, p2, p3, p4).done { u, v, w, x in + XCTAssertEqual(1, u) + XCTAssertEqual("abc", v) + XCTAssertEqual(1.0, w) + XCTAssertEqual(true, x) + e1.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1, handler: nil) + } + + func testQuintupleTuple() { + let e1 = expectation(description: "") + let p1 = Promise.value(1) + let p2 = Promise.value("abc") + let p3 = Promise.value(1.0) + let p4 = Promise.value(true) + let p5 = Promise.value("a" as Character) + when(fulfilled: p1, p2, p3, p4, p5).done { u, v, w, x, y in + XCTAssertEqual(1, u) + XCTAssertEqual("abc", v) + XCTAssertEqual(1.0, w) + XCTAssertEqual(true, x) + XCTAssertEqual("a" as Character, y) + e1.fulfill() + }.silenceWarning() + waitForExpectations(timeout: 1, handler: nil) + } + + func testVoid() { + let e1 = expectation(description: "") + let p1 = Promise.value(1).done { _ in } + let p2 = Promise.value(2).done { _ in } + let p3 = Promise.value(3).done { _ in } + let p4 = Promise.value(4).done { _ in } + + when(fulfilled: p1, p2, p3, p4).done(e1.fulfill).silenceWarning() + + waitForExpectations(timeout: 1, handler: nil) + } + + func testRejected() { + enum Error: Swift.Error { case dummy } + + let e1 = expectation(description: "") + let p1 = after(.milliseconds(100)).map{ true } + let p2: Promise = after(.milliseconds(200)).map{ throw Error.dummy } + let p3 = Promise.value(false) + + when(fulfilled: p1, p2, p3).catch { _ in + e1.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } + + func testProgress() { + let ex = expectation(description: "") + + XCTAssertNil(Progress.current()) + + let p1 = after(.milliseconds(10)) + let p2 = after(.milliseconds(20)) + let p3 = after(.milliseconds(30)) + let p4 = after(.milliseconds(40)) + + let progress = Progress(totalUnitCount: 1) + progress.becomeCurrent(withPendingUnitCount: 1) + + when(fulfilled: p1, p2, p3, p4).done { _ in + XCTAssertEqual(progress.completedUnitCount, 1) + ex.fulfill() + }.silenceWarning() + + progress.resignCurrent() + + waitForExpectations(timeout: 1, handler: nil) + } + + func testProgressDoesNotExceed100Percent() { + let ex1 = expectation(description: "") + let ex2 = expectation(description: "") + + XCTAssertNil(Progress.current()) + + let p1 = after(.milliseconds(10)) + let p2 = after(.milliseconds(20)).done { throw NSError(domain: "a", code: 1, userInfo: nil) } + let p3 = after(.milliseconds(30)) + let p4 = after(.milliseconds(40)) + + let progress = Progress(totalUnitCount: 1) + progress.becomeCurrent(withPendingUnitCount: 1) + + let promise = when(fulfilled: p1, p2, p3, p4) + + progress.resignCurrent() + + promise.catch { _ in + ex2.fulfill() + } + + var x = 0 + func finally() { + x += 1 + if x == 4 { + XCTAssertLessThanOrEqual(1, progress.fractionCompleted) + XCTAssertEqual(progress.completedUnitCount, 1) + ex1.fulfill() + } + } + + let q = DispatchQueue.main + p1.done(on: q, finally) + p2.ensure(on: q, finally).silenceWarning() + p3.done(on: q, finally) + p4.done(on: q, finally) + + waitForExpectations(timeout: 1, handler: nil) + } + + func testUnhandledErrorHandlerDoesNotFire() { + enum Error: Swift.Error { + case test + } + + let ex = expectation(description: "") + let p1 = Promise(error: Error.test) + let p2 = after(.milliseconds(100)) + when(fulfilled: p1, p2).done{ _ in XCTFail() }.catch { error in + XCTAssertTrue(error as? Error == Error.test) + ex.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } + + func testUnhandledErrorHandlerDoesNotFireForStragglers() { + enum Error: Swift.Error { + case test + case straggler + } + + let ex1 = expectation(description: "") + let ex2 = expectation(description: "") + let ex3 = expectation(description: "") + + let p1 = Promise(error: Error.test) + let p2 = after(.milliseconds(100)).done { throw Error.straggler } + let p3 = after(.milliseconds(200)).done { throw Error.straggler } + + when(fulfilled: p1, p2, p3).catch { error -> Void in + XCTAssertTrue(Error.test == error as? Error) + ex1.fulfill() + } + + p2.ensure { after(.milliseconds(100)).done(ex2.fulfill) }.silenceWarning() + p3.ensure { after(.milliseconds(100)).done(ex3.fulfill) }.silenceWarning() + + waitForExpectations(timeout: 1, handler: nil) + } + + func testAllSealedRejectedFirstOneRejects() { + enum Error: Swift.Error { + case test1 + case test2 + case test3 + } + + let ex = expectation(description: "") + let p1 = Promise(error: Error.test1) + let p2 = Promise(error: Error.test2) + let p3 = Promise(error: Error.test3) + + when(fulfilled: p1, p2, p3).catch { error in + XCTAssertTrue(error as? Error == Error.test1) + ex.fulfill() + } + + waitForExpectations(timeout: 1) + } + + func testGuaranteeWhen() { + let ex1 = expectation(description: "") + when(Guarantee(), Guarantee()).done { + ex1.fulfill() + } + + let ex2 = expectation(description: "") + when(guarantees: [Guarantee(), Guarantee()]).done { + ex2.fulfill() + } + + wait(for: [ex1, ex2], timeout: 10) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ZalgoTests.swift b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ZalgoTests.swift new file mode 100644 index 0000000..e3909b4 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/CorePromise/ZalgoTests.swift @@ -0,0 +1,59 @@ +import XCTest +import PromiseKit + +class ZalgoTests: XCTestCase { + func test1() { + var resolved = false + Promise.value(1).done(on: nil) { _ in + resolved = true + }.silenceWarning() + XCTAssertTrue(resolved) + } + + func test2() { + let p1 = Promise.value(1).map(on: nil) { x in + return 2 + } + XCTAssertEqual(p1.value!, 2) + + var x = 0 + + let (p2, seal) = Promise.pending() + p2.done(on: nil) { _ in + x = 1 + }.silenceWarning() + XCTAssertEqual(x, 0) + + seal.fulfill(1) + XCTAssertEqual(x, 1) + } + + // returning a pending promise from its own zalgo’d then handler doesn’t hang + func test3() { + let ex = (expectation(description: ""), expectation(description: "")) + + var p1: Promise! + p1 = after(.milliseconds(100)).then(on: nil) { _ -> Promise in + ex.0.fulfill() + return p1 + } + + p1.catch { err in + defer{ ex.1.fulfill() } + guard case PMKError.returnedSelf = err else { return XCTFail() } + } + + waitForExpectations(timeout: 1) + } + + // return a sealed promise from its own zalgo’d then handler doesn’t hang + func test4() { + let ex = expectation(description: "") + let p1 = Promise.value(1) + p1.then(on: nil) { _ -> Promise in + ex.fulfill() + return p1 + }.silenceWarning() + waitForExpectations(timeout: 1) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/DeprecationTests.swift b/Carthage/Checkouts/PromiseKit/Tests/DeprecationTests.swift new file mode 100644 index 0000000..d382ce8 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/DeprecationTests.swift @@ -0,0 +1,158 @@ +import PromiseKit +import XCTest + +class DeprecationTests: XCTestCase { + func testWrap1() { + let dummy = 10 + + func completion(_ body: (_ a: Int?, _ b: Error?) -> Void) { + body(dummy, nil) + } + + let ex = expectation(description: "") + wrap(completion).done { + XCTAssertEqual($0, dummy) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testWrap2() { + let dummy = 10 + + func completion(_ body: (_ a: Int, _ b: Error?) -> Void) { + body(dummy, nil) + } + + let ex = expectation(description: "") + wrap(completion).done { + XCTAssertEqual($0, dummy) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testWrap3() { + let dummy = 10 + + func completion(_ body: (_ a: Error?, _ b: Int?) -> Void) { + body(nil, dummy) + } + + let ex = expectation(description: "") + wrap(completion).done { + XCTAssertEqual($0, dummy) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testWrap4() { + let dummy = 10 + + func completion(_ body: (_ a: Error?) -> Void) { + body(nil) + } + + let ex = expectation(description: "") + wrap(completion).done { + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testWrap5() { + let dummy = 10 + + func completion(_ body: (_ a: Int) -> Void) { + body(dummy) + } + + let ex = expectation(description: "") + wrap(completion).done { + XCTAssertEqual($0, dummy) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testAlways() { + let ex = expectation(description: "") + Promise.value(1).always(execute: ex.fulfill) + wait(for: [ex], timeout: 10) + } + +#if PMKFullDeprecations + func testFlatMap() { + let ex = expectation(description: "") + Promise.value(1).flatMap { _ -> Int? in + nil + }.catch { + //TODO should be `flatMap`, but how to enact that without causing + // compiler to warn when building PromiseKit for end-users? LOL + guard case PMKError.compactMap = $0 else { return XCTFail() } + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testSequenceMap() { + let ex = expectation(description: "") + Promise.value([1, 2]).map { + $0 + 1 + }.done { + XCTAssertEqual($0, [2, 3]) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } + + func testSequenceFlatMap() { + let ex = expectation(description: "") + Promise.value([1, 2]).flatMap { + [$0 + 1, $0 + 2] + }.done { + XCTAssertEqual($0, [2, 3, 3, 4]) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } +#endif + + func testSequenceFilter() { + let ex = expectation(description: "") + Promise.value([0, 1, 2, 3]).filter { + $0 < 2 + }.done { + XCTAssertEqual($0, [0, 1]) + ex.fulfill() + }.silenceWarning() + wait(for: [ex], timeout: 10) + } + + func testSorted() { + let ex = expectation(description: "") + Promise.value([5, 2, 1, 8]).sorted().done { + XCTAssertEqual($0, [1,2,5,8]) + ex.fulfill() + } + wait(for: [ex], timeout: 10) + } + + func testFirst() { + XCTAssertEqual(Promise.value([1,2]).first.value, 1) + } + + func testLast() { + XCTAssertEqual(Promise.value([1,2]).last.value, 2) + } + + func testPMKErrorFlatMap() { + XCTAssertNotNil(PMKError.flatMap(1, Int.self).errorDescription) + } +} + + +extension Promise { + func silenceWarning() {} +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/.gitignore b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/.gitignore new file mode 100644 index 0000000..6c0be0c --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/.gitignore @@ -0,0 +1,63 @@ +# From https://github.com/github/gitignore/blob/master/Node.gitignore + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/AllTests.swift b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/AllTests.swift new file mode 100644 index 0000000..476ee34 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/AllTests.swift @@ -0,0 +1,80 @@ +// +// AllTests.swift +// PMKJSA+Tests +// +// Created by Lois Di Qual on 2/28/18. +// + +import XCTest +import PromiseKit +import JavaScriptCore + +class AllTests: XCTestCase { + + func testAll() { + + let scriptPath = URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("build/build.js") + guard FileManager.default.fileExists(atPath: scriptPath.path) else { + return print("Skipping JS-A+: see README for instructions on how to build") + } + + guard let script = try? String(contentsOf: scriptPath) else { + return XCTFail("Couldn't read content of test suite JS file") + } + + let context = JSUtils.sharedContext + + // Add a global exception handler + context.exceptionHandler = { context, exception in + guard let exception = exception else { + return XCTFail("Unknown JS exception") + } + JSUtils.printStackTrace(exception: exception, includeExceptionDescription: true) + } + + // Setup mock functions (timers, console.log, etc) + let environment = MockNodeEnvironment() + environment.setup(with: context) + + // Expose JSPromise in the javascript context + context.setObject(JSPromise.self, forKeyedSubscript: "JSPromise" as NSString) + + // Create adapter + guard let adapter = JSValue(object: NSDictionary(), in: context) else { + fatalError("Couldn't create adapter") + } + adapter.setObject(JSAdapter.resolved, forKeyedSubscript: "resolved" as NSString) + adapter.setObject(JSAdapter.rejected, forKeyedSubscript: "rejected" as NSString) + adapter.setObject(JSAdapter.deferred, forKeyedSubscript: "deferred" as NSString) + + // Evaluate contents of `build.js`, which exposes `runTests` in the global context + context.evaluateScript(script) + guard let runTests = context.objectForKeyedSubscript("runTests") else { + return XCTFail("Couldn't find `runTests` in JS context") + } + + // Create a callback that's called whenever there's a failure + let onFail: @convention(block) (JSValue, JSValue) -> Void = { test, error in + guard let test = test.toString(), let error = error.toString() else { + return XCTFail("Unknown test failure") + } + XCTFail("\(test) failed: \(error)") + } + let onFailValue: JSValue = JSValue(object: onFail, in: context) + + // Create a new callback that we'll send to `runTest` so that it notifies when tests are done running. + let expectation = self.expectation(description: "async") + let onDone: @convention(block) (JSValue) -> Void = { failures in + expectation.fulfill() + } + let onDoneValue: JSValue = JSValue(object: onDone, in: context) + + // If there's a need to only run one specific test, uncomment the next line and comment the one after + // let testName: JSValue = JSValue(object: "2.3.1", in: context) + let testName = JSUtils.undefined + + // Call `runTests` + runTests.call(withArguments: [adapter, onFailValue, onDoneValue, testName]) + self.wait(for: [expectation], timeout: 60) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSAdapter.swift b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSAdapter.swift new file mode 100644 index 0000000..6dcbe74 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSAdapter.swift @@ -0,0 +1,53 @@ +// +// JSAdapter.swift +// PMKJSA+Tests +// +// Created by Lois Di Qual on 3/2/18. +// + +import Foundation +import JavaScriptCore +import PromiseKit + +enum JSAdapter { + + static let resolved: @convention(block) (JSValue) -> JSPromise = { value in + return JSPromise(promise: .value(value)) + } + + static let rejected: @convention(block) (JSValue) -> JSPromise = { reason in + let error = JSUtils.JSError(reason: reason) + let promise = Promise(error: error) + return JSPromise(promise: promise) + } + + static let deferred: @convention(block) () -> JSValue = { + + let context = JSContext.current() + + guard let object = JSValue(object: NSDictionary(), in: context) else { + fatalError("Couldn't create object") + } + + let pendingPromise = Promise.pending() + let jsPromise = JSPromise(promise: pendingPromise.promise) + + // promise + object.setObject(jsPromise, forKeyedSubscript: "promise" as NSString) + + // resolve + let resolve: @convention(block) (JSValue) -> Void = { value in + pendingPromise.resolver.fulfill(value) + } + object.setObject(resolve, forKeyedSubscript: "resolve" as NSString) + + // reject + let reject: @convention(block) (JSValue) -> Void = { reason in + let error = JSUtils.JSError(reason: reason) + pendingPromise.resolver.reject(error) + } + object.setObject(reject, forKeyedSubscript: "reject" as NSString) + + return object + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSPromise.swift b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSPromise.swift new file mode 100644 index 0000000..70381fd --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSPromise.swift @@ -0,0 +1,94 @@ +// +// JSPromise.swift +// PMKJSA+Tests +// +// Created by Lois Di Qual on 3/1/18. +// + +import Foundation +import XCTest +import PromiseKit +import JavaScriptCore + +@objc protocol JSPromiseProtocol: JSExport { + func then(_: JSValue, _: JSValue) -> JSPromise +} + +class JSPromise: NSObject, JSPromiseProtocol { + + let promise: Promise + + init(promise: Promise) { + self.promise = promise + } + + func then(_ onFulfilled: JSValue, _ onRejected: JSValue) -> JSPromise { + + // Keep a reference to the returned promise so we can comply to 2.3.1 + var returnedPromiseRef: Promise? + + let afterFulfill = promise.then { value -> Promise in + + // 2.2.1: ignored if not a function + guard JSUtils.isFunction(value: onFulfilled) else { + return .value(value) + } + + // Call `onFulfilled` + // 2.2.5: onFulfilled/onRejected must be called as functions (with no `this` value) + guard let returnValue = try JSUtils.call(function: onFulfilled, arguments: [JSUtils.undefined, value]) else { + return .value(value) + } + + // Extract JSPromise.promise if available, or use plain return value + if let jsPromise = returnValue.toObjectOf(JSPromise.self) as? JSPromise { + + // 2.3.1: if returned value is the promise that `then` returned, throw TypeError + if jsPromise.promise === returnedPromiseRef { + throw JSUtils.JSError(reason: JSUtils.typeError(message: "Returned self")) + } + return jsPromise.promise + } else { + return .value(returnValue) + } + } + + let afterReject = promise.recover { error -> Promise in + + // 2.2.1: ignored if not a function + guard let jsError = error as? JSUtils.JSError, JSUtils.isFunction(value: onRejected) else { + throw error + } + + // Call `onRejected` + // 2.2.5: onFulfilled/onRejected must be called as functions (with no `this` value) + guard let returnValue = try JSUtils.call(function: onRejected, arguments: [JSUtils.undefined, jsError.reason]) else { + throw error + } + + // Extract JSPromise.promise if available, or use plain return value + if let jsPromise = returnValue.toObjectOf(JSPromise.self) as? JSPromise { + + // 2.3.1: if returned value is the promise that `then` returned, throw TypeError + if jsPromise.promise === returnedPromiseRef { + throw JSUtils.JSError(reason: JSUtils.typeError(message: "Returned self")) + } + return jsPromise.promise + } else { + return .value(returnValue) + } + } + + let newPromise = Promise> { resolver in + _ = promise.tap(resolver.fulfill) + }.then(on: nil) { result -> Promise in + switch result { + case .fulfilled: return afterFulfill + case .rejected: return afterReject + } + } + returnedPromiseRef = newPromise + + return JSPromise(promise: newPromise) + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSUtils.swift b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSUtils.swift new file mode 100644 index 0000000..d08a44b --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/JSUtils.swift @@ -0,0 +1,116 @@ +// +// JSUtils.swift +// PMKJSA+Tests +// +// Created by Lois Di Qual on 3/2/18. +// + +import Foundation +import JavaScriptCore + +enum JSUtils { + + class JSError: Error { + let reason: JSValue + init(reason: JSValue) { + self.reason = reason + } + } + + static let sharedContext: JSContext = { + guard let context = JSContext() else { + fatalError("Couldn't create JS context") + } + return context + }() + + static var undefined: JSValue { + guard let undefined = JSValue(undefinedIn: JSUtils.sharedContext) else { + fatalError("Couldn't create `undefined` value") + } + return undefined + } + + static func typeError(message: String) -> JSValue { + let message = message.replacingOccurrences(of: "\"", with: "\\\"") + let script = "new TypeError(\"\(message)\")" + guard let result = sharedContext.evaluateScript(script) else { + fatalError("Couldn't create TypeError") + } + return result + } + + // @warning: relies on lodash to be present + static func isFunction(value: JSValue) -> Bool { + guard let context = value.context else { + return false + } + guard let lodash = context.objectForKeyedSubscript("_") else { + fatalError("Couldn't get lodash in JS context") + } + guard let result = lodash.invokeMethod("isFunction", withArguments: [value]) else { + fatalError("Couldn't invoke _.isFunction") + } + return result.toBool() + } + + // Calls a JS function using `Function.prototype.call` and throws any potential exception wrapped in a JSError + static func call(function: JSValue, arguments: [JSValue]) throws -> JSValue? { + + let context = JSUtils.sharedContext + + // Create a new exception handler that will store a potential exception + // thrown in the handler. Save the value of the old handler. + var caughtException: JSValue? + let savedExceptionHandler = context.exceptionHandler + context.exceptionHandler = { context, exception in + caughtException = exception + } + + // Call the handler + let returnValue = function.invokeMethod("call", withArguments: arguments) + context.exceptionHandler = savedExceptionHandler + + // If an exception was caught, throw it + if let exception = caughtException { + throw JSError(reason: exception) + } + + return returnValue + } + + static func printCurrentStackTrace() { + guard let exception = JSUtils.sharedContext.evaluateScript("new Error()") else { + return print("Couldn't get current stack trace") + } + printStackTrace(exception: exception, includeExceptionDescription: false) + } + + static func printStackTrace(exception: JSValue, includeExceptionDescription: Bool) { + guard let lineNumber = exception.objectForKeyedSubscript("line"), + let column = exception.objectForKeyedSubscript("column"), + let message = exception.objectForKeyedSubscript("message"), + let stacktrace = exception.objectForKeyedSubscript("stack")?.toString() else { + return print("Couldn't print stack trace") + } + + if includeExceptionDescription { + print("JS Exception at \(lineNumber):\(column): \(message)") + } + + let lines = stacktrace.split(separator: "\n").map { "\t> \($0)" }.joined(separator: "\n") + print(lines) + } +} + +#if !swift(>=3.2) +extension String { + func split(separator: Character, omittingEmptySubsequences: Bool = true) -> [String] { + return characters.split(separator: separator, omittingEmptySubsequences: omittingEmptySubsequences).map(String.init) + } + + var first: Character? { + return characters.first + } +} +#endif diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/MockNodeEnvironment.swift b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/MockNodeEnvironment.swift new file mode 100644 index 0000000..6abe516 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/MockNodeEnvironment.swift @@ -0,0 +1,117 @@ +// +// MockNodeEnvironment.swift +// PMKJSA+Tests +// +// Created by Lois Di Qual on 3/1/18. +// + +import Foundation +import JavaScriptCore + +class MockNodeEnvironment { + + private var timers: [UInt32: Timer] = [:] + + func setup(with context: JSContext) { + + // console.log / console.error + setupConsole(context: context) + + // setTimeout + let setTimeout: @convention(block) (JSValue, Double) -> UInt32 = { function, intervalMs in + let timerID = self.addTimer(interval: intervalMs / 1000, repeats: false, function: function) + return timerID + } + context.setObject(setTimeout, forKeyedSubscript: "setTimeout" as NSString) + + // clearTimeout + let clearTimeout: @convention(block) (JSValue) -> Void = { timeoutID in + guard timeoutID.isNumber else { + return + } + self.removeTimer(timerID: timeoutID.toUInt32()) + } + context.setObject(clearTimeout, forKeyedSubscript: "clearTimeout" as NSString) + + // setInterval + let setInterval: @convention(block) (JSValue, Double) -> UInt32 = { function, intervalMs in + let timerID = self.addTimer(interval: intervalMs / 1000, repeats: true, function: function) + return timerID + } + context.setObject(setInterval, forKeyedSubscript: "setInterval" as NSString) + + // clearInterval + let clearInterval: @convention(block) (JSValue) -> Void = { intervalID in + guard intervalID.isNumber else { + return + } + self.removeTimer(timerID: intervalID.toUInt32()) + } + context.setObject(clearInterval, forKeyedSubscript: "clearInterval" as NSString) + } + + private func setupConsole(context: JSContext) { + + guard let console = context.objectForKeyedSubscript("console") else { + fatalError("Couldn't get global `console` object") + } + + let consoleLog: @convention(block) () -> Void = { + guard let arguments = JSContext.currentArguments(), let format = arguments.first as? JSValue else { + return + } + + let otherArguments = arguments.dropFirst() + if otherArguments.count == 0 { + print(format) + } else { + + let otherArguments = otherArguments.compactMap { $0 as? JSValue } + let format = format.toString().replacingOccurrences(of: "%s", with: "%@") + let expectedTypes = format.split(separator: "%", omittingEmptySubsequences: false).dropFirst().compactMap { $0.first }.map { String($0) } + + let typedArguments = otherArguments.enumerated().compactMap { index, value -> CVarArg? in + let expectedType = expectedTypes[index] + let converted: CVarArg + switch expectedType { + case "s": converted = value.toString() + case "d": converted = value.toInt32() + case "f": converted = value.toDouble() + default: converted = value.toString() + } + return converted + } + + let output = String(format: format, arguments: typedArguments) + print(output) + } + } + console.setObject(consoleLog, forKeyedSubscript: "log" as NSString) + console.setObject(consoleLog, forKeyedSubscript: "error" as NSString) + } + + private func addTimer(interval: TimeInterval, repeats: Bool, function: JSValue) -> UInt32 { + let block = BlockOperation { + DispatchQueue.main.async { + function.call(withArguments: []) + } + } + let timer = Timer.scheduledTimer(timeInterval: interval, target: block, selector: #selector(Operation.main), userInfo: nil, repeats: repeats) + let rawHash = UUID().uuidString.hashValue + #if swift(>=4.0) + let hash = UInt32(truncatingIfNeeded: rawHash) + #else + let hash = UInt32(truncatingBitPattern: rawHash) + #endif + timers[hash] = timer + return hash + } + + private func removeTimer(timerID: UInt32) { + guard let timer = timers[timerID] else { + return print("Couldn't find timer \(timerID)") + } + timer.invalidate() + timers[timerID] = nil + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/README.md b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/README.md new file mode 100644 index 0000000..05ab7f9 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/README.md @@ -0,0 +1,75 @@ +Promises/A+ Compliance Test Suite (JavaScript) +============================================== + +What is this? +------------- + +This contains the necessary Swift and JS files to run the Promises/A+ compliance test suite from PromiseKit's unit tests. + + - Promise/A+ Spec: + - Compliance Test Suite: + +Run tests +--------- + +``` +$ npm install +$ npm run build +``` + +then open `PromiseKit.xcodeproj` and run the `PMKJSA+Tests` unit test scheme. + +Known limitations +----------------- + +See `ignoredTests` in `index.js`. + + + - 2.3.3 is disabled: Otherwise, if x is an object or function. This spec is a NOOP for Swift: + - We have decided not to interact with other Promises A+ implementations + - functions cannot have properties + +Upgrade the test suite +---------------------- + +``` +$ npm install --save promises-aplus-tests@latest +$ npm run build +``` + +Develop +------- + +JavaScriptCore is a bit tedious to work with so here are a couple tips in case you're trying to debug the test suite. + +If you're editing JS files, enable live rebuilds: + +``` +$ npm run watch +``` + +If you're editing Swift files, a couple things you can do: + + - You can adjust `testName` in `AllTests.swift` to only run one test suite + - You can call `JSUtils.printCurrentStackTrace()` at any time. It won't contain line numbers but some of the frame names might help. + +How it works +------------ + +The Promises/A+ test suite is written in JavaScript but PromiseKit is written in Swift/ObjC. For the test suite to run against swift code, we expose a promise wrapper `JSPromise` inside a JavaScriptCore context. This is done in a regular XCTestCase. + +Since JavaScriptCore doesn't support CommonJS imports, we inline all the JavaScript code into `build/build.js` using webpack. This includes all the npm dependencies (`promises-aplus-tests`, `mocha`, `sinon`, etc) as well as the glue code in `index.js`. + +`build.js` exposes one global variable `runTests(adapter, onFail, onDone, [testName])`. In our XCTestCase, a shared JavaScriptCore context is created, `build.js` is evaluated and now `runTests` is accessible from the Swift context. + +In our swift test, we create a JS-bridged `JSPromise` which only has one method `then(onFulfilled, onRejected) -> Promise`. It wraps a swift `Promise` and delegates call `then` calls to it. + +An [adapter](https://github.com/promises-aplus/promises-tests#adapters) – plain JS object which provides `revoled(value), rejected(reason), and deferred()` – is passed to `runTests` to run the whole JavaScript test suite. + +Errors and end events are reported back to Swift and piped to `XCTFail()` if necessary. + +Since JavaScriptCore isn't a node/web environment, there is quite a bit of stubbing necessary for all this to work: + + - The `fs` module is stubbed with an empty function + - `console.log` redirects to `Swift.print` and provides only basic format parsing + - `setTimeout/setInterval` are implemented with `Swift.Timer` behind the scenes and stored in a `[TimerID: Timer]` map. diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/index.js b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/index.js new file mode 100644 index 0000000..d18e046 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/index.js @@ -0,0 +1,42 @@ +const _ = require('lodash') +require('mocha') + +// Ignored by design +const ignoredTests = [ + '2.3.3' +] + +module.exports = function(adapter, onFail, onDone, testName) { + + global.adapter = adapter + const mocha = new Mocha({ ui: 'bdd' }) + + // Require all tests + console.log('Loading test files') + const requireTest = require.context('promises-aplus-tests/lib/tests', false, /\.js$/) + requireTest.keys().forEach(file => { + + let currentTestName = _.replace(_.replace(file, './', ''), '.js', '') + if (testName && currentTestName !== testName) { + return + } + + if (_.includes(ignoredTests, currentTestName)) { + return + } + + console.log(`\t${currentTestName}`) + mocha.suite.emit('pre-require', global, file, mocha) + mocha.suite.emit('require', requireTest(file), file, mocha) + mocha.suite.emit('post-require', global, file, mocha) + }) + + const runner = mocha.run(failures => { + onDone(failures) + }) + + runner.on('fail', (test, err) => { + console.error(err) + onFail(test.title, err) + }) +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/package-lock.json b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/package-lock.json new file mode 100644 index 0000000..553072e --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/package-lock.json @@ -0,0 +1,7869 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@sinonjs/formatio": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", + "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", + "requires": { + "samsam": "1.3.0" + }, + "dependencies": { + "samsam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", + "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==" + } + } + }, + "acorn": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.0.tgz", + "integrity": "sha512-arn53F07VXmls4o4pUhSzBa4fvaagPRe7AVZ8l7NHxFWUie2DsuFSBMMNAkgzRlOhEhzAnxeKyaWVzOH4xqp/g==" + }, + "acorn-dynamic-import": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", + "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", + "requires": { + "acorn": "^5.0.0" + } + }, + "ajv": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.2.0.tgz", + "integrity": "sha1-r6wpW7qgFSRJ5SJ0LkVHwa6TKNI=", + "requires": { + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ajv-keywords": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.1.0.tgz", + "integrity": "sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74=" + }, + "ansi-escapes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==" + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "argv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", + "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=" + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=" + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "requires": { + "util": "0.10.3" + } + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, + "ast-types": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.10.1.tgz", + "integrity": "sha512-UY7+9DPzlJ9VM8eY0b2TUZcZvF+1pO0hzMtAyjBYKhOmnvRlqYNYnWdtsMj0V16CGaMlpL0G1jnLbLo4AyotuQ==" + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "atob": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.0.3.tgz", + "integrity": "sha1-GcenYEc3dEaPILLS0DNyrX1Mv10=" + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "babel-core": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", + "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.0", + "debug": "^2.6.8", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.7", + "slash": "^1.0.0", + "source-map": "^0.5.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" + } + } + }, + "babel-helper-bindify-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz", + "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-explode-class": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz", + "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=", + "requires": { + "babel-helper-bindify-decorators": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-loader": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.3.tgz", + "integrity": "sha512-PeN29YvOynPMvNk7QCzsHqxpmfXwKAC+uxkiSNFQsmXBBVltzEkVWmv/Ip3tx7yk149dQUwk497bTXNu+DZjLA==", + "requires": { + "find-cache-dir": "^1.0.0", + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=" + }, + "babel-plugin-syntax-async-generators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", + "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=" + }, + "babel-plugin-syntax-class-constructor-call": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz", + "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=" + }, + "babel-plugin-syntax-class-properties": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=" + }, + "babel-plugin-syntax-decorators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", + "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=" + }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=" + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=" + }, + "babel-plugin-syntax-export-extensions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz", + "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=" + }, + "babel-plugin-syntax-flow": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=" + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=" + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=" + }, + "babel-plugin-transform-async-generator-functions": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", + "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-generators": "^6.5.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-class-constructor-call": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz", + "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=", + "requires": { + "babel-plugin-syntax-class-constructor-call": "^6.18.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-class-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-plugin-syntax-class-properties": "^6.8.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz", + "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=", + "requires": { + "babel-helper-explode-class": "^6.24.1", + "babel-plugin-syntax-decorators": "^6.13.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", + "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-export-extensions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz", + "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=", + "requires": { + "babel-plugin-syntax-export-extensions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-flow-strip-types": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", + "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", + "requires": { + "babel-plugin-syntax-flow": "^6.18.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-preset-env": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", + "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==", + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^2.1.2", + "invariant": "^2.2.2", + "semver": "^5.3.0" + } + }, + "babel-preset-es2015": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.24.1", + "babel-plugin-transform-es2015-classes": "^6.24.1", + "babel-plugin-transform-es2015-computed-properties": "^6.24.1", + "babel-plugin-transform-es2015-destructuring": "^6.22.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", + "babel-plugin-transform-es2015-for-of": "^6.22.0", + "babel-plugin-transform-es2015-function-name": "^6.24.1", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-transform-es2015-object-super": "^6.24.1", + "babel-plugin-transform-es2015-parameters": "^6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.24.1", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.24.1", + "babel-plugin-transform-regenerator": "^6.24.1" + } + }, + "babel-preset-stage-1": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz", + "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=", + "requires": { + "babel-plugin-transform-class-constructor-call": "^6.24.1", + "babel-plugin-transform-export-extensions": "^6.22.0", + "babel-preset-stage-2": "^6.24.1" + } + }, + "babel-preset-stage-2": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz", + "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=", + "requires": { + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-decorators": "^6.24.1", + "babel-preset-stage-3": "^6.24.1" + } + }, + "babel-preset-stage-3": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", + "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", + "requires": { + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-generator-functions": "^6.24.1", + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-plugin-transform-exponentiation-operator": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.22.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "base64-js": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.3.tgz", + "integrity": "sha512-MsAhsUW1GxCdgYSO6tAfZrNapmUKk7mWx/k5mFY/A1gBtkaCaNapTg+FExCw1r9yeaZhqx/xPg43xgTFH6KL5w==" + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=" + }, + "binaryextensions": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.1.1.tgz", + "integrity": "sha512-XBaoWE9RW8pPdPQNibZsW2zh8TW6gcarXp1FZPwT8Uop8ScSNldJEWf2k9l3HeTqdrEwsOsFcq74RiJECW34yA==" + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "requires": { + "hoek": "2.x.x" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", + "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "kind-of": "^6.0.2", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=" + }, + "browserify-aes": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", + "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", + "requires": { + "caniuse-lite": "^1.0.30000792", + "electron-to-chromium": "^1.3.30" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + }, + "cacache": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "requires": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.1", + "mississippi": "^2.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^5.2.4", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "caniuse-lite": { + "version": "1.0.30000812", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000812.tgz", + "integrity": "sha512-j+l55ayQ9BO4Sy9iVfbf99+G+4ddAmkXoiEt73WCW4vJ83usrlHzDkFEnNXe5/swkVqE7YBm5i8M2uRXlx9vWg==" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chalk": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", + "requires": { + "ansi-styles": "^3.2.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.2.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "supports-color": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=" + }, + "chokidar": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.2.tgz", + "integrity": "sha512-l32Hw3wqB0L2kGVmSbK/a+xXLDrUEsc84pSgMkmwygHvD7ubRsP/vxxHa5BtB6oix1XLLVCHyYMsckRXxThmZw==", + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.0", + "braces": "^2.3.0", + "fsevents": "^1.0.0", + "glob-parent": "^3.1.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^2.1.1", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0", + "upath": "^1.0.0" + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=" + }, + "chrome-trace-event": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-0.1.2.tgz", + "integrity": "sha1-kPNohdU0WlBiEzLwcXtZWIPV2YI=" + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-spinners": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-0.1.2.tgz", + "integrity": "sha1-u3ZNiOGF+54eaiofGXcjGPYF4xw=" + }, + "cli-table": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz", + "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=", + "requires": { + "colors": "1.0.3" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" + } + } + }, + "cli-truncate": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz", + "integrity": "sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ=", + "requires": { + "slice-ansi": "0.0.4", + "string-width": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "clone": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", + "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=" + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=" + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=" + }, + "cloneable-readable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz", + "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=", + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^1.0.6", + "through2": "^2.0.1" + }, + "dependencies": { + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "codecov": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.0.0.tgz", + "integrity": "sha1-wnO4xPEpRXI+jcnSWAPYk0Pl8o4=", + "requires": { + "argv": "0.0.2", + "request": "2.81.0", + "urlgrey": "0.4.4" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "requires": { + "color-name": "^1.1.1" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=" + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "requires": { + "date-now": "^0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=" + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, + "core-js": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "create-ecdh": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + } + } + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "requires": { + "boom": "2.x.x" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=" + }, + "dargs": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-5.1.0.tgz", + "integrity": "sha1-7H6lDHhWTNNsnV7Bj2Yyn63ieCk=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "date-fns": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz", + "integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw==" + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=" + }, + "dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", + "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=" + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=" + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "detect-conflict": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/detect-conflict/-/detect-conflict-1.0.1.tgz", + "integrity": "sha1-CIZXpmqWHAUBnbfEIwiDsca0F24=" + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "requires": { + "repeating": "^2.0.0" + } + }, + "diff": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", + "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==" + }, + "diffie-hellman": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "dom-walk": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", + "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=" + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==" + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + }, + "duplexify": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.3.tgz", + "integrity": "sha512-g8ID9OroF9hKt2POf8YLayy+9594PzmM3scI00/uBXocX3TWNgoB67hjzkFe9ITAbQOne/lLdBxHXvYUM4ZgGA==", + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "~0.1.0" + } + }, + "editions": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", + "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==" + }, + "ejs": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.7.tgz", + "integrity": "sha1-zIcsFoiArjxxiXYv1f/ACJbJUYo=" + }, + "electron-to-chromium": { + "version": "1.3.35", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.35.tgz", + "integrity": "sha1-aTwXz7k4QdOMtZuN8BnRfjVphfA=" + }, + "elegant-spinner": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", + "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=" + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz", + "integrity": "sha512-jox/62b2GofV1qTUQTMPEJSDIGycS43evqYzD/KVtEb9OCoki9cnacUPxCrZa7JfPzZSYOCZhu9O9luaMxAX8g==", + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "tapable": "^1.0.0" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "~1.0.1" + } + }, + "error": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", + "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", + "requires": { + "string-template": "~0.2.1", + "xtend": "~4.0.0" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", + "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=" + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=" + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "requires": { + "fill-range": "^2.1.0" + }, + "dependencies": { + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^1.1.3", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "requires": { + "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "first-chunk-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", + "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", + "requires": { + "readable-stream": "^2.0.2" + } + }, + "flow-parser": { + "version": "0.66.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.66.0.tgz", + "integrity": "sha1-vlg/77ARkqpRZEFdMaYkGzVxiYM=" + }, + "flush-write-stream": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.2.tgz", + "integrity": "sha1-yBuQ2HRnZvGmCaRoCZRsRd2K5Bc=", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "requires": { + "for-in": "^1.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "optional": true, + "requires": { + "nan": "^2.3.0", + "node-pre-gyp": "^0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "optional": true, + "requires": { + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "requires": { + "inherits": "~2.0.0" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "requires": { + "hoek": "2.x.x" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "requires": { + "balanced-match": "^0.4.1", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "requires": { + "boom": "2.x.x" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true, + "requires": { + "jsbn": "~0.1.0" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "optional": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "optional": true, + "requires": { + "fstream": "^1.0.0", + "inherits": "2", + "minimatch": "^3.0.0" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "optional": true, + "requires": { + "ajv": "^4.9.1", + "har-schema": "^1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "requires": { + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "optional": true, + "requires": { + "jsbn": "~0.1.0" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "optional": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "requires": { + "mime-db": "~1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "hawk": "3.1.3", + "mkdirp": "^0.5.1", + "nopt": "^4.0.1", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "request": "2.81.0", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^2.2.1", + "tar-pack": "^3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "~0.4.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "requires": { + "buffer-shims": "~1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~1.0.0", + "util-deprecate": "~1.0.1" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "optional": true, + "requires": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "requires": { + "hoek": "2.x.x" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "optional": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jodid25519": "^1.0.0", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "requires": { + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "^2.2.0", + "fstream": "^1.0.10", + "fstream-ignore": "^1.0.5", + "once": "^1.3.3", + "readable-stream": "^2.1.4", + "rimraf": "^2.5.1", + "tar": "^2.2.1", + "uid-number": "^0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "optional": true, + "requires": { + "punycode": "^1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + } + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "gh-got": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gh-got/-/gh-got-6.0.0.tgz", + "integrity": "sha512-F/mS+fsWQMo1zfgG9MD8KWvTWPPzzhuVwY++fhQ5Ggd+0P+CAMHtzMZhNxG+TqGfHDChJKsbh6otfMGqO2AKBw==", + "requires": { + "got": "^7.0.0", + "is-plain-obj": "^1.1.0" + } + }, + "github-username": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/github-username/-/github-username-4.1.0.tgz", + "integrity": "sha1-y+KABBiDIG2kISrp5LXxacML9Bc=", + "requires": { + "gh-got": "^6.0.0" + } + }, + "glob-all": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-all/-/glob-all-3.1.0.tgz", + "integrity": "sha1-iRPd+17hrHgSZWJBsD1SF8ZLAqs=", + "requires": { + "glob": "^7.0.5", + "yargs": "~1.2.6" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.1.0.tgz", + "integrity": "sha1-md9lelJXTCHJBXSX33QnkLK0wN4=" + }, + "yargs": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-1.2.6.tgz", + "integrity": "sha1-nHtKgv1dWVsr8Xq23MQxNUMv40s=", + "requires": { + "minimist": "^0.1.0" + } + } + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "global": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", + "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "requires": { + "min-document": "^2.19.0", + "process": "~0.5.1" + }, + "dependencies": { + "process": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=" + } + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "grouped-queue": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/grouped-queue/-/grouped-queue-0.3.3.tgz", + "integrity": "sha1-wWfSpTGcWg4JZO9qJbfC34mWyFw=", + "requires": { + "lodash": "^4.17.2" + } + }, + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=" + }, + "har-validator": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "requires": { + "ajv": "^4.9.1", + "har-schema": "^1.0.5" + }, + "dependencies": { + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "requires": { + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" + } + } + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + } + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==" + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "requires": { + "inherits": "^2.0.1" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "requires": { + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "requires": { + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "ieee754": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=" + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=" + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "requires": { + "repeating": "^2.0.0" + } + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" + }, + "invariant": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.3.tgz", + "integrity": "sha512-7Z5PPegwDTyjbaeCnV0efcyS6vdKAU51kpEmS7QFib3P4822l8ICYyMn7qvJnc+WzLoDsuI9gPMKbJ8pCu8XtA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + } + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" + }, + "is-scoped": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-scoped/-/is-scoped-1.0.0.tgz", + "integrity": "sha1-RJypgpnnEwOCViieyytUDcQ3yzA=", + "requires": { + "scoped-regex": "^1.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istextorbinary": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-2.2.1.tgz", + "integrity": "sha512-TS+hoFl8Z5FAFMK38nhBkdLt44CclNRgDHWeMgsV8ko3nDlr/9UI2Sf839sW7enijf8oKsZYXRvM8g0it9Zmcw==", + "requires": { + "binaryextensions": "2", + "editions": "^1.3.3", + "textextensions": "2" + } + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "jscodeshift": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.4.1.tgz", + "integrity": "sha512-iOX6If+hsw0q99V3n31t4f5VlD1TQZddH08xbT65ZqA7T4Vkx68emrDZMUOLVvCEAJ6NpAk7DECe3fjC/t52AQ==", + "requires": { + "async": "^1.5.0", + "babel-plugin-transform-flow-strip-types": "^6.8.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-stage-1": "^6.5.0", + "babel-register": "^6.9.0", + "babylon": "^6.17.3", + "colors": "^1.1.2", + "flow-parser": "^0.*", + "lodash": "^4.13.1", + "micromatch": "^2.3.7", + "node-dir": "0.1.8", + "nomnom": "^1.8.1", + "recast": "^0.12.5", + "temp": "^0.8.1", + "write-file-atomic": "^1.2.0" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "recast": { + "version": "0.12.9", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.12.9.tgz", + "integrity": "sha512-y7ANxCWmMW8xLOaiopiRDlyjQ9ajKRENBH+2wjntIbk3A6ZR1+BLQttkmSHMY7Arl+AAZFwJ10grg2T6f1WI8A==", + "requires": { + "ast-types": "0.10.1", + "core-js": "^2.4.1", + "esprima": "~4.0.0", + "private": "~0.1.5", + "source-map": "~0.6.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "just-extend": { + "version": "1.1.27", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", + "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==" + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, + "lazy-cache": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-2.0.2.tgz", + "integrity": "sha1-uRkKT5EzVGlIQIWfio9whNiCImQ=", + "requires": { + "set-getter": "^0.1.0" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "listr": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/listr/-/listr-0.12.0.tgz", + "integrity": "sha1-a84sD1YD+klYDqF81qAMwOX6RRo=", + "requires": { + "chalk": "^1.1.3", + "cli-truncate": "^0.2.1", + "figures": "^1.7.0", + "indent-string": "^2.1.0", + "is-promise": "^2.1.0", + "is-stream": "^1.1.0", + "listr-silent-renderer": "^1.1.1", + "listr-update-renderer": "^0.2.0", + "listr-verbose-renderer": "^0.4.0", + "log-symbols": "^1.0.2", + "log-update": "^1.0.2", + "ora": "^0.2.3", + "p-map": "^1.1.1", + "rxjs": "^5.0.0-beta.11", + "stream-to-observable": "^0.1.0", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } + } + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "requires": { + "chalk": "^1.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "listr-silent-renderer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz", + "integrity": "sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4=" + }, + "listr-update-renderer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz", + "integrity": "sha1-yoDhd5tOcCZoB+ju0a1qvjmFUPk=", + "requires": { + "chalk": "^1.1.3", + "cli-truncate": "^0.2.1", + "elegant-spinner": "^1.0.1", + "figures": "^1.7.0", + "indent-string": "^3.0.0", + "log-symbols": "^1.0.2", + "log-update": "^1.0.2", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "requires": { + "chalk": "^1.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "listr-verbose-renderer": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz", + "integrity": "sha1-ggb0z21S3cWCfl/RSYng6WWTOjU=", + "requires": { + "chalk": "^1.1.3", + "cli-cursor": "^1.0.2", + "date-fns": "^1.27.2", + "figures": "^1.7.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "loader-runner": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", + "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=" + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, + "log-symbols": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.1.0.tgz", + "integrity": "sha512-zLeLrzMA1A2vRF1e/0Mo+LNINzi6jzBylHj5WqvQ/WK/5WCZt8si9SyN4p9llr/HRYvVR1AoXHRHl4WTHyQAzQ==", + "requires": { + "chalk": "^2.0.1" + } + }, + "log-update": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-1.0.2.tgz", + "integrity": "sha1-GZKfZMQJPS0ucHWh2tivWcKWuNE=", + "requires": { + "ansi-escapes": "^1.0.0", + "cli-cursor": "^1.0.2" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + } + } + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "requires": { + "js-tokens": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" + }, + "make-dir": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", + "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", + "requires": { + "pify": "^3.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + } + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "mem-fs": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/mem-fs/-/mem-fs-1.1.3.tgz", + "integrity": "sha1-uK6NLj/Lb10/kWXBLUVRoGXZicw=", + "requires": { + "through2": "^2.0.0", + "vinyl": "^1.1.0", + "vinyl-file": "^2.0.0" + }, + "dependencies": { + "clone": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", + "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=" + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=" + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=" + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "requires": { + "clone": "^1.0.0", + "clone-stats": "^0.0.1", + "replace-ext": "0.0.1" + } + } + } + }, + "mem-fs-editor": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mem-fs-editor/-/mem-fs-editor-3.0.2.tgz", + "integrity": "sha1-3Qpuryu4prN3QAZ6pUnrUwEFr58=", + "requires": { + "commondir": "^1.0.1", + "deep-extend": "^0.4.0", + "ejs": "^2.3.1", + "glob": "^7.0.3", + "globby": "^6.1.0", + "mkdirp": "^0.5.0", + "multimatch": "^2.0.0", + "rimraf": "^2.2.8", + "through2": "^2.0.0", + "vinyl": "^2.0.1" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.9.tgz", + "integrity": "sha512-SlIz6sv5UPaAVVFRKodKjCg48EbNoIhgetzfK/Cy0v5U52Z6zB136M8tp0UC9jM53LYbmIRihJszvvqpKkfm9g==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "~1.33.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, + "mimic-response": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.0.tgz", + "integrity": "sha1-3z02Uqc/3ta5sLJBRub9BSNTRY4=" + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "requires": { + "dom-walk": "^0.1.0" + } + }, + "minimalistic-assert": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mississippi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^2.0.1", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.1.tgz", + "integrity": "sha512-SpwyojlnE/WRBNGtvJSNfllfm5PqEDFxcWluSIgLeSBJtXG4DmoX2NNAeEA7rP5kK+79VgtVq8nG6HskaL1ykg==", + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.3.1", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + }, + "dependencies": { + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "diff": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", + "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "growl": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==" + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "requires": { + "has-flag": "^2.0.0" + } + } + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "requires": { + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" + }, + "nan": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.9.2.tgz", + "integrity": "sha512-ltW65co7f3PQWBDbqVvaU1WtFJUsNW7sWWm4HINhbMQIyVyzIeyZ8toX5TC5eeooE6piZoaEh4cZkueSKG3KYw==", + "optional": true + }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "neo-async": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.0.tgz", + "integrity": "sha512-nJmSswG4As/MkRq7QZFuH/sf/yuv8ODdMZrY4Bedjp77a5MK4A6s7YbBB64c9u79EBUOfXUXBvArmvzTD0X+6g==" + }, + "nise": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.2.7.tgz", + "integrity": "sha512-8LqP1pFLB1v5QU8KlT2WqWzhMRJ3o9LwnZHz+VCbVB8rTsRTFCjtOYv/BatcmLOWp21NedTrErVGinfxe6XYtA==", + "requires": { + "@sinonjs/formatio": "^2.0.0", + "just-extend": "^1.1.27", + "lolex": "^2.3.2", + "path-to-regexp": "^1.7.0", + "text-encoding": "^0.6.4" + }, + "dependencies": { + "lolex": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.2.tgz", + "integrity": "sha512-A5pN2tkFj7H0dGIAM6MFvHKMJcPnjZsOMvR7ujCjfgW5TbV6H9vb1PgxLtHvjqNZTHsUolz+6/WEO0N1xNx2ng==" + } + } + }, + "node-dir": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.8.tgz", + "integrity": "sha1-VfuN62mQcHB/tn+RpGDwRIKUx30=" + }, + "node-libs-browser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^1.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.0", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.10.3", + "vm-browserify": "0.0.4" + } + }, + "nomnom": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", + "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", + "requires": { + "chalk": "~0.4.0", + "underscore": "~1.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=" + }, + "chalk": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "requires": { + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" + } + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=" + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=" + } + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "^3.0.0" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "ora": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/ora/-/ora-0.2.3.tgz", + "integrity": "sha1-N1J9Igrc1Tw5tzVx11QVbV22V6Q=", + "requires": { + "chalk": "^1.1.1", + "cli-cursor": "^1.0.2", + "cli-spinners": "^0.1.2", + "object-assign": "^4.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "os-shim": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", + "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=" + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==" + }, + "p-each-series": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", + "integrity": "sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=", + "requires": { + "p-reduce": "^1.0.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-lazy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-lazy/-/p-lazy-1.0.0.tgz", + "integrity": "sha1-7FPIAvLuOsKPFmzILQsrAt4nqDU=" + }, + "p-limit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-map": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", + "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==" + }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=" + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "requires": { + "p-finally": "^1.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==" + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "requires": { + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parse-asn1": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=" + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + } + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "requires": { + "pify": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, + "pbkdf2": { + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", + "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=" + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "requires": { + "find-up": "^2.1.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" + }, + "prettier": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.11.1.tgz", + "integrity": "sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw==" + }, + "pretty-bytes": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", + "integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=" + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" + }, + "promises-aplus-tests": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/promises-aplus-tests/-/promises-aplus-tests-2.1.2.tgz", + "integrity": "sha1-drfFY4locghhlpz7zYeVr9J0iFw=", + "requires": { + "mocha": "^2.5.3", + "sinon": "^1.10.3", + "underscore": "~1.8.3" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "public-encrypt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz", + "integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==", + "requires": { + "duplexify": "^3.5.3", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=" + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "read-chunk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/read-chunk/-/read-chunk-2.1.0.tgz", + "integrity": "sha1-agTAkoAF7Z1C4aasVgDhnLx/9lU=", + "requires": { + "pify": "^3.0.0", + "safe-buffer": "^5.1.1" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "readable-stream": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", + "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "requires": { + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "recast": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.13.2.tgz", + "integrity": "sha512-Xqo0mKljGUWGUhnkdbODk7oJGFrMcpgKQ9cCyZ4y+G9VfoTKdum8nHbf/SxIdKx5aBSZ29VpVy20bTyt7jyC8w==", + "requires": { + "ast-types": "0.10.2", + "esprima": "~4.0.0", + "private": "~0.1.5", + "source-map": "~0.6.1" + }, + "dependencies": { + "ast-types": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.10.2.tgz", + "integrity": "sha512-ufWX953VU1eIuWqxS0nRDMYlGyFH+yxln5CsmIHlpzEt3fdYqUnRtsFt0XAsQot8OaVCwFqxT1RiwvtzYjeYeg==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "^1.1.6" + } + }, + "regenerate": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", + "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "requires": { + "jsesc": "~0.5.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "requires": { + "is-finite": "^1.0.0" + } + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "requires": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "^7.0.5" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "requires": { + "hash-base": "^2.0.0", + "inherits": "^2.0.1" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "requires": { + "is-promise": "^2.1.0" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "requires": { + "aproba": "^1.1.1" + } + }, + "rx": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", + "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=" + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=" + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "requires": { + "rx-lite": "*" + } + }, + "rxjs": { + "version": "5.5.6", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.6.tgz", + "integrity": "sha512-v4Q5HDC0FHAQ7zcBX7T2IL6O5ltl1a2GX4ENjPXg6SjDY69Cmx9v4113C99a4wGF16ClPv5Z8mghuYorVkg/kg==", + "requires": { + "symbol-observable": "1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "~0.1.10" + } + }, + "schema-utils": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz", + "integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==", + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + }, + "scoped-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/scoped-regex/-/scoped-regex-1.0.0.tgz", + "integrity": "sha1-o0a7Gs1CB65wvXwMfKnlZra63bg=" + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + }, + "serialize-javascript": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.4.0.tgz", + "integrity": "sha1-fJWFFNtqwkQ6irwGLcn3iGp/YAU=" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "set-getter": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/set-getter/-/set-getter-0.1.0.tgz", + "integrity": "sha1-12nBgsnVpR9AkUXy+6guXoboA3Y=", + "requires": { + "to-object-path": "^0.3.0" + } + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sha.js": { + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.10.tgz", + "integrity": "sha512-vnwmrFDlOExK4Nm16J2KMWHLrp14lBrjxMxBJpu++EnsuBmpiYaM/MEs46Vxxm/4FvdP5yTwuCTO9it5FSjrqA==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "sinon": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.4.2.tgz", + "integrity": "sha512-cpOHpnRyY3Dk9dTHBYMfVBB0HUCSKIpxW07X6OGW2NiYPovs4AkcL8Q8MzecbAROjbfRA9esJCmlZgikxDz7DA==", + "requires": { + "@sinonjs/formatio": "^2.0.0", + "diff": "^3.1.0", + "lodash.get": "^4.4.2", + "lolex": "^2.2.0", + "nise": "^1.2.0", + "supports-color": "^5.1.0", + "type-detect": "^4.0.5" + }, + "dependencies": { + "lolex": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.2.tgz", + "integrity": "sha512-A5pN2tkFj7H0dGIAM6MFvHKMJcPnjZsOMvR7ujCjfgW5TbV6H9vb1PgxLtHvjqNZTHsUolz+6/WEO0N1xNx2ng==" + } + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=" + }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" + }, + "snapdragon": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.1.tgz", + "integrity": "sha1-4StUh/re0+PeoKyR6UAL91tAE3A=", + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^2.0.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "requires": { + "hoek": "2.x.x" + } + }, + "source-list-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-resolve": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", + "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "requires": { + "atob": "^2.0.0", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "requires": { + "source-map": "^0.5.6" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "spawn-sync": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", + "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "requires": { + "concat-stream": "^1.4.7", + "os-shim": "^0.1.2" + } + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==" + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==" + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "ssri": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.2.4.tgz", + "integrity": "sha512-UnEAgMZa15973iH7cUi0AHjJn1ACDIkaMyZILoqwN6yzt+4P81I8tBc5Hl+qwi5auMplZtPQsHrPBR5vJLcQtQ==", + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", + "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.0.tgz", + "integrity": "sha512-sZOFxI/5xw058XIRHl4dU3dZ+TTOIGJR78Dvo0oEAejIt4ou27k+3ne1zYmCV+v7UucbxIFQuOgnkTVHh8YPnw==", + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.3", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "stream-to-observable": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-to-observable/-/stream-to-observable-0.1.0.tgz", + "integrity": "sha1-Rb8dny19wJvtgfHDB8Qw5ouEz/4=" + }, + "string-template": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + }, + "strip-bom-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz", + "integrity": "sha1-+H217yYT9paKpUWr/h7HKLaoKco=", + "requires": { + "first-chunk-stream": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "supports-color": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-observable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", + "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=" + }, + "tapable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz", + "integrity": "sha512-dQRhbNQkRnaqauC7WqSJ21EEksgT0fYZX2lqXzGkpo8JNig9zGZTYoMGvyI2nWmXlE2VSVXVDu7wLVGu/mQEsg==" + }, + "temp": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", + "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", + "requires": { + "os-tmpdir": "^1.0.0", + "rimraf": "~2.2.6" + }, + "dependencies": { + "rimraf": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" + } + } + }, + "text-encoding": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", + "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=" + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + }, + "textextensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-2.2.0.tgz", + "integrity": "sha512-j5EMxnryTvKxwH2Cq+Pb43tsf6sdEgw6Pdwxk83mPaq0ToeFJt6WE4J3s5BqY7vmjlLgkgXvhtXUxo80FyBhCA==" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" + }, + "timers-browserify": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.6.tgz", + "integrity": "sha512-HQ3nbYRAowdVd0ckGFvmJPPCOH/CHleFN/Y0YQCX1DVaB7t+KFvisuyN09fuP8Jtp1CpfSh8O8bMkHbdbPe6Pw==", + "requires": { + "setimmediate": "^1.0.4" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=" + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "requires": { + "punycode": "^1.4.1" + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "requires": { + "commander": "~2.13.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "uglifyjs-webpack-plugin": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.2.tgz", + "integrity": "sha512-CG/NvzXfemUAm5Y4Guh5eEaJYHtkG7kKNpXEJHp9QpxsFVB5/qKvYWoMaq4sa99ccZ0hM3MK8vQV9XPZB4357A==", + "requires": { + "cacache": "^10.0.1", + "find-cache-dir": "^1.0.0", + "schema-utils": "^0.4.2", + "serialize-javascript": "^1.4.0", + "source-map": "^0.6.1", + "uglify-es": "^3.3.4", + "webpack-sources": "^1.1.0", + "worker-farm": "^1.5.2" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unique-filename": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz", + "integrity": "sha1-0F8v5AMlYIcfMOk8vnNe6iAVFPM=", + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz", + "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "untildify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-2.1.0.tgz", + "integrity": "sha1-F+soB5h/dpUunASF/DEdBqgmouA=", + "requires": { + "os-homedir": "^1.0.0" + } + }, + "upath": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.0.4.tgz", + "integrity": "sha512-d4SJySNBXDaQp+DPrziv3xGS6w3d2Xt69FijJr86zMPBy23JEloMCEOUBBzuN7xCtjLCnmB9tI/z7SBCahHBOw==" + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + } + } + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "requires": { + "prepend-http": "^1.0.1" + } + }, + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" + }, + "urlgrey": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", + "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=" + }, + "use": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/use/-/use-2.0.2.tgz", + "integrity": "sha1-riig1y+TvyJCKhii43mZMRLeyOg=", + "requires": { + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "lazy-cache": "^2.0.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + }, + "v8-compile-cache": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-1.1.2.tgz", + "integrity": "sha512-ejdrifsIydN1XDH7EuR2hn8ZrkRKUYF7tUcBjBy/lhrCvs2K+zRlbW9UHc0IQ9RsYFZJFqJrieoIHfkCa0DBRA==" + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } + } + }, + "vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "vinyl-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vinyl-file/-/vinyl-file-2.0.0.tgz", + "integrity": "sha1-p+v1/779obfRjRQPyweyI++2dRo=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.3.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0", + "strip-bom-stream": "^2.0.0", + "vinyl": "^1.1.0" + }, + "dependencies": { + "clone": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", + "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=" + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=" + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "requires": { + "clone": "^1.0.0", + "clone-stats": "^0.0.1", + "replace-ext": "0.0.1" + } + } + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "requires": { + "indexof": "0.0.1" + } + }, + "watchpack": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.5.0.tgz", + "integrity": "sha512-RSlipNQB1u48cq0wH/BNfCu1tD/cJ8ydFIkNYhp9o+3d+8unClkIovpW5qpFPgmL9OE48wfAnlZydXByWP82AA==", + "requires": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + } + }, + "webpack": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.0.1.tgz", + "integrity": "sha512-jHQNMmKPElreOYLCxR7SHfPnbhcqRT9O7lYPOMDR6Gt5XueJ7tH7JReXm4uMFstBKf7rj2Y7AD3LiMKR2zexYA==", + "requires": { + "acorn": "^5.0.0", + "acorn-dynamic-import": "^3.0.0", + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0", + "chrome-trace-event": "^0.1.1", + "enhanced-resolve": "^4.0.0", + "eslint-scope": "^3.7.1", + "loader-runner": "^2.3.0", + "loader-utils": "^1.1.0", + "memory-fs": "~0.4.1", + "micromatch": "^3.1.8", + "mkdirp": "~0.5.0", + "neo-async": "^2.5.0", + "node-libs-browser": "^2.0.0", + "schema-utils": "^0.4.2", + "tapable": "^1.0.0", + "uglifyjs-webpack-plugin": "^1.1.1", + "watchpack": "^1.4.0", + "webpack-sources": "^1.0.1" + } + }, + "webpack-addons": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/webpack-addons/-/webpack-addons-1.1.5.tgz", + "integrity": "sha512-MGO0nVniCLFAQz1qv22zM02QPjcpAoJdy7ED0i3Zy7SY1IecgXCm460ib7H/Wq7e9oL5VL6S2BxaObxwIcag0g==", + "requires": { + "jscodeshift": "^0.4.0" + } + }, + "webpack-cli": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-2.0.9.tgz", + "integrity": "sha512-KIkOFHhrq8W7ovg5u8M7Xbduzr1aQ1Ch1aGGY0TvL5neO81T6/aCZ/NeG7R92UaXIF/BK4KCkla35wtoOoxyDQ==", + "requires": { + "chalk": "^2.0.1", + "codecov": "^3.0.0", + "cross-spawn": "^5.1.0", + "diff": "^3.3.0", + "enhanced-resolve": "^3.4.1", + "glob-all": "^3.1.0", + "global": "^4.3.2", + "global-modules": "^1.0.0", + "got": "^7.1.0", + "inquirer": "^3.2.0", + "interpret": "^1.0.4", + "jscodeshift": "^0.4.0", + "listr": "^0.12.0", + "loader-utils": "^1.1.0", + "lodash": "^4.17.4", + "log-symbols": "2.1.0", + "mkdirp": "^0.5.1", + "p-each-series": "^1.0.0", + "p-lazy": "^1.0.0", + "prettier": "^1.5.3", + "recast": "^0.13.0", + "resolve-cwd": "^2.0.0", + "supports-color": "^4.4.0", + "uglifyjs-webpack-plugin": "^1.2.2", + "v8-compile-cache": "^1.1.0", + "webpack-addons": "^1.1.5", + "webpack-fork-yeoman-generator": "^1.1.1", + "yargs": "9.0.1", + "yeoman-environment": "^2.0.0" + }, + "dependencies": { + "diff": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", + "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==" + }, + "enhanced-resolve": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", + "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "object-assign": "^4.0.1", + "tapable": "^0.2.7" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "requires": { + "has-flag": "^2.0.0" + } + }, + "tapable": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", + "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=" + } + } + }, + "webpack-fork-yeoman-generator": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/webpack-fork-yeoman-generator/-/webpack-fork-yeoman-generator-1.1.1.tgz", + "integrity": "sha512-TrLT6Bw6gl9rJA7iZw+YJ+4xHhEUzfOQB3tHpyINBFdZDmO0tlDW9MtMSMZ5rsUNjHxcEba5yuGaAW86J84j/w==", + "requires": { + "async": "^2.0.0", + "chalk": "^1.0.0", + "cli-table": "^0.3.1", + "cross-spawn": "^5.0.1", + "dargs": "^5.1.0", + "dateformat": "^2.0.0", + "debug": "^2.1.0", + "detect-conflict": "^1.0.0", + "error": "^7.0.2", + "find-up": "^2.1.0", + "github-username": "^4.0.0", + "istextorbinary": "^2.1.0", + "lodash": "^4.11.1", + "mem-fs-editor": "^3.0.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.0", + "pretty-bytes": "^4.0.2", + "read-chunk": "^2.0.0", + "read-pkg-up": "^2.0.0", + "rimraf": "^2.2.0", + "run-async": "^2.0.0", + "shelljs": "^0.7.0", + "text-table": "^0.2.0", + "through2": "^2.0.0", + "yeoman-environment": "^1.1.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "^4.14.0" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "requires": { + "restore-cursor": "^1.0.1" + } + }, + "diff": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/diff/-/diff-2.2.3.tgz", + "integrity": "sha1-YOr9DSjukG5Oj/ClLBIpUhAzv5k=" + }, + "external-editor": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-1.1.1.tgz", + "integrity": "sha1-Etew24UPf/fnCBuvQAVwAGDEYAs=", + "requires": { + "extend": "^3.0.0", + "spawn-sync": "^1.0.15", + "tmp": "^0.0.29" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } + } + }, + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globby": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-4.1.0.tgz", + "integrity": "sha1-CA9UVJ7BuCpsYOYx/ILhIR2+lfg=", + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^6.0.1", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "inquirer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-1.2.3.tgz", + "integrity": "sha1-TexvMvN+97sLLtPx0aXD9UUHSRg=", + "requires": { + "ansi-escapes": "^1.1.0", + "chalk": "^1.0.0", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", + "external-editor": "^1.1.0", + "figures": "^1.3.5", + "lodash": "^4.3.0", + "mute-stream": "0.0.6", + "pinkie-promise": "^2.0.0", + "run-async": "^2.2.0", + "rx": "^4.1.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "requires": { + "chalk": "^1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mute-stream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.6.tgz", + "integrity": "sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s=" + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "requires": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "tmp": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.29.tgz", + "integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=", + "requires": { + "os-tmpdir": "~1.0.1" + } + }, + "yeoman-environment": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/yeoman-environment/-/yeoman-environment-1.6.6.tgz", + "integrity": "sha1-zYX6Z9FWBg5EDXgH1+988NLR1nE=", + "requires": { + "chalk": "^1.0.0", + "debug": "^2.0.0", + "diff": "^2.1.2", + "escape-string-regexp": "^1.0.2", + "globby": "^4.0.0", + "grouped-queue": "^0.3.0", + "inquirer": "^1.0.2", + "lodash": "^4.11.1", + "log-symbols": "^1.0.1", + "mem-fs": "^1.1.0", + "text-table": "^0.2.0", + "untildify": "^2.0.0" + } + } + } + }, + "webpack-sources": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz", + "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "worker-farm": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.5.4.tgz", + "integrity": "sha512-ITyClEvcfv0ozqJl1vmWFWhvI+OIrkbInYqkEPE50wFPXj8J9Gd3FYf8+CkZJXJJsQBYe+2DvmoK9Zhx5w8W+w==", + "requires": { + "errno": "~0.1.7", + "xtend": "~4.0.1" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-9.0.1.tgz", + "integrity": "sha1-UqzCP+7Kw0BCB47njAwAf1CF20w=", + "requires": { + "camelcase": "^4.1.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "read-pkg-up": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^7.0.0" + }, + "dependencies": { + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + } + } + }, + "yargs-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", + "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", + "requires": { + "camelcase": "^4.1.0" + } + }, + "yeoman-environment": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/yeoman-environment/-/yeoman-environment-2.0.5.tgz", + "integrity": "sha512-6/W7/B54OPHJXob0n0+pmkwFsirC8cokuQkPSmT/D0lCcSxkKtg/BA6ZnjUBIwjuGqmw3DTrT4en++htaUju5g==", + "requires": { + "chalk": "^2.1.0", + "debug": "^3.1.0", + "diff": "^3.3.1", + "escape-string-regexp": "^1.0.2", + "globby": "^6.1.0", + "grouped-queue": "^0.3.3", + "inquirer": "^3.3.0", + "is-scoped": "^1.0.0", + "lodash": "^4.17.4", + "log-symbols": "^2.1.0", + "mem-fs": "^1.1.0", + "text-table": "^0.2.0", + "untildify": "^3.0.2" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "diff": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", + "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "untildify": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.2.tgz", + "integrity": "sha1-fx8wIFWz/qDz6B3HjrNnZstl4/E=" + } + } + } + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/package.json b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/package.json new file mode 100644 index 0000000..6d2b0e6 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/package.json @@ -0,0 +1,17 @@ +{ + "scripts": { + "build": "webpack-cli", + "watch": "webpack-cli --watch --mode development" + }, + "dependencies": { + "babel-core": "^6.26.0", + "babel-loader": "^7.1.3", + "babel-preset-env": "^1.6.1", + "lodash": "^4.17.5", + "mocha": "^5.0.1", + "promises-aplus-tests": "^2.1.2", + "sinon": "^4.4.2", + "webpack": "^4.0.1", + "webpack-cli": "^2.0.9" + } +} diff --git a/Carthage/Checkouts/PromiseKit/Tests/JS-A+/webpack.config.js b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/webpack.config.js new file mode 100644 index 0000000..74f46ed --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/JS-A+/webpack.config.js @@ -0,0 +1,29 @@ +var webpack = require('webpack'); + +module.exports = { + mode: 'development', + context: __dirname, + entry: './index.js', + output: { + path: __dirname + '/build', + filename: 'build.js', + library: 'runTests' + }, + module: { + rules: [ + { + test: /\.js$/, + exclude: /(node_modules)/, + use: { + loader: 'babel-loader', + options: { + presets: ['env'] + } + } + } + ] + }, + node: { + fs: 'empty' + }, +}; diff --git a/Carthage/Checkouts/PromiseKit/Tests/LinuxMain.swift b/Carthage/Checkouts/PromiseKit/Tests/LinuxMain.swift new file mode 100644 index 0000000..fcc9728 --- /dev/null +++ b/Carthage/Checkouts/PromiseKit/Tests/LinuxMain.swift @@ -0,0 +1,288 @@ +// Generated using Sourcery 0.10.0 — https://github.com/krzysztofzablocki/Sourcery +// DO NOT EDIT + + +@testable import CorePromise +@testable import A_ +import XCTest + +//TODO get this to run on CI and don’t have it committed +//NOTE problem is Sourcery doesn’t support Linux currently +//USAGE: cd PromiseKit/Sources/.. && sourcery --config .github/sourcery.yml + +extension AfterTests { + static var allTests = [ + ("testZero", AfterTests.testZero), + ("testNegative", AfterTests.testNegative), + ("testPositive", AfterTests.testPositive), + ] +} + +extension CancellationTests { + static var allTests = [ + ("testCancellation", CancellationTests.testCancellation), + ("testThrowCancellableErrorThatIsNotCancelled", CancellationTests.testThrowCancellableErrorThatIsNotCancelled), + ("testRecoverWithCancellation", CancellationTests.testRecoverWithCancellation), + ("testFoundationBridging1", CancellationTests.testFoundationBridging1), + ("testFoundationBridging2", CancellationTests.testFoundationBridging2), + ("testIsCancelled", CancellationTests.testIsCancelled), + ("testIsCancelled", CancellationTests.testIsCancelled), + ] +} + +extension CatchableTests { + static var allTests = [ + ("testFinally", CatchableTests.testFinally), + ("testCauterize", CatchableTests.testCauterize), + ("test__void_specialized_full_recover", CatchableTests.test__void_specialized_full_recover), + ("test__void_specialized_full_recover__fulfilled_path", CatchableTests.test__void_specialized_full_recover__fulfilled_path), + ("test__void_specialized_conditional_recover", CatchableTests.test__void_specialized_conditional_recover), + ("test__void_specialized_conditional_recover__no_recover", CatchableTests.test__void_specialized_conditional_recover__no_recover), + ("test__void_specialized_conditional_recover__ignores_cancellation_but_fed_cancellation", CatchableTests.test__void_specialized_conditional_recover__ignores_cancellation_but_fed_cancellation), + ("test__void_specialized_conditional_recover__fulfilled_path", CatchableTests.test__void_specialized_conditional_recover__fulfilled_path), + ("test__full_recover", CatchableTests.test__full_recover), + ("test__full_recover__fulfilled_path", CatchableTests.test__full_recover__fulfilled_path), + ("test__conditional_recover", CatchableTests.test__conditional_recover), + ("test__conditional_recover__no_recover", CatchableTests.test__conditional_recover__no_recover), + ("test__conditional_recover__ignores_cancellation_but_fed_cancellation", CatchableTests.test__conditional_recover__ignores_cancellation_but_fed_cancellation), + ("test__conditional_recover__fulfilled_path", CatchableTests.test__conditional_recover__fulfilled_path), + ] +} + +extension GuaranteeTests { + static var allTests = [ + ("testInit", GuaranteeTests.testInit), + ("testWait", GuaranteeTests.testWait), + ] +} + +extension HangTests { + static var allTests = [ + ("test", HangTests.test), + ("testError", HangTests.testError), + ] +} + +extension JoinTests { + static var allTests = [ + ("testImmediates", JoinTests.testImmediates), + ("testFulfilledAfterAllResolve", JoinTests.testFulfilledAfterAllResolve), + ] +} + +extension PMKDefaultDispatchQueueTest { + static var allTests = [ + ("testOverrodeDefaultThenQueue", PMKDefaultDispatchQueueTest.testOverrodeDefaultThenQueue), + ("testOverrodeDefaultCatchQueue", PMKDefaultDispatchQueueTest.testOverrodeDefaultCatchQueue), + ("testOverrodeDefaultAlwaysQueue", PMKDefaultDispatchQueueTest.testOverrodeDefaultAlwaysQueue), + ] +} + +extension PMKErrorTests { + static var allTests = [ + ("testCustomStringConvertible", PMKErrorTests.testCustomStringConvertible), + ("testCustomDebugStringConvertible", PMKErrorTests.testCustomDebugStringConvertible), + ] +} + +extension PromiseTests { + static var allTests = [ + ("testIsPending", PromiseTests.testIsPending), + ("testIsResolved", PromiseTests.testIsResolved), + ("testIsFulfilled", PromiseTests.testIsFulfilled), + ("testIsRejected", PromiseTests.testIsRejected), + ("testDispatchQueueAsyncExtensionReturnsPromise", PromiseTests.testDispatchQueueAsyncExtensionReturnsPromise), + ("testDispatchQueueAsyncExtensionCanThrowInBody", PromiseTests.testDispatchQueueAsyncExtensionCanThrowInBody), + ("testCustomStringConvertible", PromiseTests.testCustomStringConvertible), + ("testCannotFulfillWithError", PromiseTests.testCannotFulfillWithError), + ("testCanMakeVoidPromise", PromiseTests.testCanMakeVoidPromise), + ("testCanMakeVoidPromise", PromiseTests.testCanMakeVoidPromise), + ("testThrowInInitializer", PromiseTests.testThrowInInitializer), + ("testThrowInFirstly", PromiseTests.testThrowInFirstly), + ("testWait", PromiseTests.testWait), + ("testPipeForResolved", PromiseTests.testPipeForResolved), + ] +} + +extension RaceTests { + static var allTests = [ + ("test1", RaceTests.test1), + ("test2", RaceTests.test2), + ("test1Array", RaceTests.test1Array), + ("test2Array", RaceTests.test2Array), + ("testEmptyArray", RaceTests.testEmptyArray), + ] +} + +extension RegressionTests { + static var allTests = [ + ("testReturningPreviousPromiseWorks", RegressionTests.testReturningPreviousPromiseWorks), + ] +} + +extension StressTests { + static var allTests = [ + ("testThenDataRace", StressTests.testThenDataRace), + ("testThensAreSequentialForLongTime", StressTests.testThensAreSequentialForLongTime), + ("testZalgoDataRace", StressTests.testZalgoDataRace), + ] +} + +extension Test212 { + static var allTests = [ + ("test", Test212.test), + ] +} + +extension Test213 { + static var allTests = [ + ("test", Test213.test), + ] +} + +extension Test222 { + static var allTests = [ + ("test", Test222.test), + ] +} + +extension Test223 { + static var allTests = [ + ("test", Test223.test), + ] +} + +extension Test224 { + static var allTests = [ + ("test", Test224.test), + ] +} + +extension Test226 { + static var allTests = [ + ("test", Test226.test), + ] +} + +extension Test227 { + static var allTests = [ + ("test", Test227.test), + ] +} + +extension Test231 { + static var allTests = [ + ("test", Test231.test), + ] +} + +extension Test232 { + static var allTests = [ + ("test", Test232.test), + ] +} + +extension Test234 { + static var allTests = [ + ("test", Test234.test), + ] +} + +extension ThenableTests { + static var allTests = [ + ("testGet", ThenableTests.testGet), + ("testCompactMap", ThenableTests.testCompactMap), + ("testCompactMapThrows", ThenableTests.testCompactMapThrows), + ("testRejectedPromiseCompactMap", ThenableTests.testRejectedPromiseCompactMap), + ("testPMKErrorCompactMap", ThenableTests.testPMKErrorCompactMap), + ("testCompactMapValues", ThenableTests.testCompactMapValues), + ("testThenMap", ThenableTests.testThenMap), + ("testThenFlatMap", ThenableTests.testThenFlatMap), + ("testLastValueForEmpty", ThenableTests.testLastValueForEmpty), + ("testFirstValueForEmpty", ThenableTests.testFirstValueForEmpty), + ("testThenOffRejected", ThenableTests.testThenOffRejected), + ] +} + +extension WhenConcurrentTestCase_Swift { + static var allTests = [ + ("testWhen", WhenConcurrentTestCase_Swift.testWhen), + ("testWhenEmptyGenerator", WhenConcurrentTestCase_Swift.testWhenEmptyGenerator), + ("testWhenGeneratorError", WhenConcurrentTestCase_Swift.testWhenGeneratorError), + ("testWhenConcurrency", WhenConcurrentTestCase_Swift.testWhenConcurrency), + ("testWhenConcurrencyLessThanZero", WhenConcurrentTestCase_Swift.testWhenConcurrencyLessThanZero), + ("testStopsDequeueingOnceRejected", WhenConcurrentTestCase_Swift.testStopsDequeueingOnceRejected), + ] +} + +extension WhenTests { + static var allTests = [ + ("testEmpty", WhenTests.testEmpty), + ("testInt", WhenTests.testInt), + ("testDoubleTuple", WhenTests.testDoubleTuple), + ("testTripleTuple", WhenTests.testTripleTuple), + ("testQuadrupleTuple", WhenTests.testQuadrupleTuple), + ("testQuintupleTuple", WhenTests.testQuintupleTuple), + ("testVoid", WhenTests.testVoid), + ("testRejected", WhenTests.testRejected), + ("testProgress", WhenTests.testProgress), + ("testProgressDoesNotExceed100Percent", WhenTests.testProgressDoesNotExceed100Percent), + ("testUnhandledErrorHandlerDoesNotFire", WhenTests.testUnhandledErrorHandlerDoesNotFire), + ("testUnhandledErrorHandlerDoesNotFireForStragglers", WhenTests.testUnhandledErrorHandlerDoesNotFireForStragglers), + ("testAllSealedRejectedFirstOneRejects", WhenTests.testAllSealedRejectedFirstOneRejects), + ("testGuaranteeWhen", WhenTests.testGuaranteeWhen), + ] +} + +extension WrapTests { + static var allTests = [ + ("testSuccess", WrapTests.testSuccess), + ("testError", WrapTests.testError), + ("testInvalidCallingConvention", WrapTests.testInvalidCallingConvention), + ("testInvertedCallingConvention", WrapTests.testInvertedCallingConvention), + ("testNonOptionalFirstParameter", WrapTests.testNonOptionalFirstParameter), + ("testVoidCompletionValue", WrapTests.testVoidCompletionValue), + ("testVoidCompletionValue", WrapTests.testVoidCompletionValue), + ("testIsFulfilled", WrapTests.testIsFulfilled), + ("testPendingPromiseDeallocated", WrapTests.testPendingPromiseDeallocated), + ] +} + +extension ZalgoTests { + static var allTests = [ + ("test1", ZalgoTests.test1), + ("test2", ZalgoTests.test2), + ("test3", ZalgoTests.test3), + ("test4", ZalgoTests.test4), + ] +} + +XCTMain([ + testCase(AfterTests.allTests), + testCase(CancellationTests.allTests), + testCase(CatchableTests.allTests), + testCase(GuaranteeTests.allTests), + testCase(HangTests.allTests), + testCase(JoinTests.allTests), + testCase(PMKDefaultDispatchQueueTest.allTests), + testCase(PMKErrorTests.allTests), + testCase(PromiseTests.allTests), + testCase(RaceTests.allTests), + testCase(RegressionTests.allTests), + testCase(StressTests.allTests), + testCase(Test212.allTests), + testCase(Test213.allTests), + testCase(Test222.allTests), + testCase(Test223.allTests), + testCase(Test224.allTests), + testCase(Test226.allTests), + testCase(Test227.allTests), + testCase(Test231.allTests), + testCase(Test232.allTests), + testCase(Test234.allTests), + testCase(ThenableTests.allTests), + testCase(WhenConcurrentTestCase_Swift.allTests), + testCase(WhenTests.allTests), + testCase(WrapTests.allTests), + testCase(ZalgoTests.allTests), +]) diff --git a/Jot.xcodeproj/project.pbxproj b/Jot.xcodeproj/project.pbxproj index 56edf8a..0c83e45 100644 --- a/Jot.xcodeproj/project.pbxproj +++ b/Jot.xcodeproj/project.pbxproj @@ -12,6 +12,8 @@ 82AE32D1219E57250078EBDC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 82AE32D0219E57250078EBDC /* Assets.xcassets */; }; 82AE32D4219E57250078EBDC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 82AE32D2219E57250078EBDC /* Main.storyboard */; }; 82AE32E0219E57250078EBDC /* JotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82AE32DF219E57250078EBDC /* JotTests.swift */; }; + 82AE32EF219E5C7D0078EBDC /* PromiseKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 82AE32ED219E5C7D0078EBDC /* PromiseKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 82AE32F3219E5CAF0078EBDC /* PromiseKit.framework.dSYM in CopyFiles */ = {isa = PBXBuildFile; fileRef = 82AE32F2219E5CAF0078EBDC /* PromiseKit.framework.dSYM */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -24,6 +26,30 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 82AE32F0219E5C7D0078EBDC /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 82AE32EF219E5C7D0078EBDC /* PromiseKit.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + 82AE32F1219E5C930078EBDC /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 16; + files = ( + 82AE32F3219E5CAF0078EBDC /* PromiseKit.framework.dSYM in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 82AE32C9219E57210078EBDC /* Jot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Jot.app; sourceTree = BUILT_PRODUCTS_DIR; }; 82AE32CC219E57210078EBDC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -35,6 +61,8 @@ 82AE32DB219E57250078EBDC /* JotTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JotTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 82AE32DF219E57250078EBDC /* JotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JotTests.swift; sourceTree = ""; }; 82AE32E1219E57250078EBDC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 82AE32ED219E5C7D0078EBDC /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PromiseKit.framework; path = Carthage/Build/Mac/PromiseKit.framework; sourceTree = ""; }; + 82AE32F2219E5CAF0078EBDC /* PromiseKit.framework.dSYM */ = {isa = PBXFileReference; lastKnownFileType = wrapper.dsym; name = PromiseKit.framework.dSYM; path = Carthage/Build/Mac/PromiseKit.framework.dSYM; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -58,6 +86,8 @@ 82AE32C0219E57210078EBDC = { isa = PBXGroup; children = ( + 82AE32F2219E5CAF0078EBDC /* PromiseKit.framework.dSYM */, + 82AE32ED219E5C7D0078EBDC /* PromiseKit.framework */, 82AE32CB219E57210078EBDC /* Jot */, 82AE32DE219E57250078EBDC /* JotTests */, 82AE32CA219E57210078EBDC /* Products */, @@ -105,6 +135,8 @@ 82AE32C5219E57210078EBDC /* Sources */, 82AE32C6219E57210078EBDC /* Frameworks */, 82AE32C7219E57210078EBDC /* Resources */, + 82AE32F0219E5C7D0078EBDC /* Embed Frameworks */, + 82AE32F1219E5C930078EBDC /* CopyFiles */, ); buildRules = ( ); @@ -353,6 +385,10 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = TQ65TXGTY3; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); INFOPLIST_FILE = Jot/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -372,6 +408,10 @@ CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = TQ65TXGTY3; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); INFOPLIST_FILE = Jot/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)",