Skip to content

Commit

Permalink
Updates for Xcode 9.3 (Alamofire#2473)
Browse files Browse the repository at this point in the history
* Fix notification tests in Swift 4.1, add IDEWorkspace chcks.

* Update Travis for Xcode 9.3.

* Update project settings.

* Use Travis 9.3beta image.
  • Loading branch information
jshier authored Mar 31, 2018
1 parent ef48870 commit e6c26e0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode9.2
osx_image: xcode9.3beta
branches:
only:
- master
Expand All @@ -14,16 +14,16 @@ env:
- WATCHOS_FRAMEWORK_SCHEME="Alamofire watchOS"
- EXAMPLE_SCHEME="iOS Example"
matrix:
- DESTINATION="OS=4.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=4.3,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=3.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=2.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"

- DESTINATION="OS=11.2,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES"
- DESTINATION="OS=11.3,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES"
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
- DESTINATION="OS=9.3,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
- DESTINATION="OS=8.4,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"

- DESTINATION="OS=11.2,name=Apple TV 4K" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=11.3,name=Apple TV 4K" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=10.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
- DESTINATION="OS=9.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"

Expand Down
1 change: 0 additions & 1 deletion Alamofire.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 3.0;
Expand Down
8 changes: 8 additions & 0 deletions Alamofire.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
1 change: 0 additions & 1 deletion Example/iOS Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 3.0;
Expand Down
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.6)
CFPropertyList (3.0.0)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
Expand Down Expand Up @@ -48,7 +48,7 @@ GEM
ffi (1.9.23)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.2)
gh_inspector (1.1.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jazzy (0.9.1)
Expand All @@ -62,9 +62,9 @@ GEM
xcinvoke (~> 0.3.0)
liferaft (0.0.6)
minitest (5.11.3)
molinillo (0.6.4)
molinillo (0.6.5)
mustache (0.99.8)
nanaimo (0.2.3)
nanaimo (0.2.4)
nap (1.1.0)
netrc (0.11.0)
open4 (1.3.4)
Expand All @@ -74,7 +74,7 @@ GEM
redcarpet (3.4.0)
rouge (3.1.1)
ruby-macho (1.1.0)
sass (3.5.5)
sass (3.5.6)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -85,12 +85,12 @@ GEM
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.5.6)
CFPropertyList (~> 2.3.3)
xcodeproj (1.5.7)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.2)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)
nanaimo (~> 0.2.4)

PLATFORMS
ruby
Expand Down
18 changes: 13 additions & 5 deletions Tests/SessionDelegateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,12 @@ class SessionDelegateTestCase: BaseTestCase {
// Given
var notificationCalledWithResponseData = false
var response: HTTPURLResponse?

let expectation = self.expectation(forNotification: Notification.Name.Task.DidComplete.rawValue, object: nil) { notif -> Bool in
#if swift(>=4.1)
let notification = Notification.Name.Task.DidComplete
#else
let notification = Notification.Name.Task.DidComplete.rawValue
#endif
let expectation = self.expectation(forNotification: notification, object: nil) { notif -> Bool in

// check that we are handling notif for a dataTask
guard let task = notif.userInfo?[Notification.Key.Task] as? URLSessionDataTask else {
Expand Down Expand Up @@ -557,8 +561,12 @@ class SessionDelegateTestCase: BaseTestCase {
// Given
var notificationCalledWithNilResponseData = false
var response: HTTPURLResponse?

let expectation = self.expectation(forNotification: Notification.Name.Task.DidComplete.rawValue, object: nil) { notif -> Bool in
#if swift(>=4.1)
let notification = Notification.Name.Task.DidComplete
#else
let notification = Notification.Name.Task.DidComplete.rawValue
#endif
let expectation = self.expectation(forNotification: notification, object: nil) { notif -> Bool in

// check that we are handling notif for a downloadTask
guard let task = notif.userInfo?[Notification.Key.Task] as? URLSessionDownloadTask else {
Expand All @@ -573,7 +581,7 @@ class SessionDelegateTestCase: BaseTestCase {
}

// When
manager.download("https://httpbin.org/get").response {resp in }
manager.download("https://httpbin.org/get").response { resp in }

wait(for: [expectation], timeout: timeout)

Expand Down

0 comments on commit e6c26e0

Please sign in to comment.