Skip to content

Commit

Permalink
Swift 5 (#22)
Browse files Browse the repository at this point in the history
* Test Swift 5

* Updates for Xcode 10.2
  • Loading branch information
mxcl committed Apr 6, 2019
1 parent ca36a82 commit e5c5d84
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 53 deletions.
73 changes: 40 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
os: osx
language: swift

branches:
only:
- master
stages:
- lint
- compile
- swiftpm
- 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
gem install cocoapods --prerelease --version 1.7.0.beta.3
install:
carthage bootstrap --no-build PromiseKit
script: |
Expand All @@ -27,30 +28,27 @@ jobs:
- <<: *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: xcode10
# env: SWIFT=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
- <<: *pod
osx_image: xcode10.2
env: SWIFT=5.0

- &linux
stage: compile
stage: swiftpm
env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.0
# ^^ we have some source-conditionals for this version
name: Linux / Swift 3.2.0
Expand Down Expand Up @@ -85,11 +83,11 @@ jobs:
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.2
name: Linux / Swift 4.2
- <<: *linux
env: SWIFT_BUILD_VERSION=5 SWIFT_VERSION=5.0-DEVELOPMENT-SNAPSHOT-2019-01-22-a
name: Linux / Swift 5.0 (2019-01-22)
env: SWIFT_BUILD_VERSION=5 SWIFT_VERSION=5.0
name: Linux / Swift 5.0

- &swiftpm
stage: compile
stage: swiftpm
name: Xcode 8.3 / SwiftPM
os: osx
osx_image: xcode8.3
Expand All @@ -101,28 +99,37 @@ jobs:
- <<: *swiftpm
name: Xcode 10.0 / SwiftPM
osx_image: xcode10

- &carthage
stage: carthage
osx_image: xcode9.2
script: |
carthage bootstrap --cache-builds
carthage build --no-skip-current
cache:
directories:
- Carthage
- <<: *carthage
osx_image: xcode9.4
- <<: *carthage
osx_image: xcode10.1
- <<: *carthage
osx_image: xcode10.2

- &test
stage: test
osx_image: xcode10
name: macOS Tests
env: DST='arch=x86_64' PLAT=macOS
os: osx
language: objective-c
xcode_scheme: PMKFoundation
xcode_project: PMKFoundation.xcodeproj
xcode_destination: 'platform=macOS'
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
before_install: |
carthage bootstrap --cache-builds --no-use-binaries
sed -i '' "s/SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;/SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;/" *.xcodeproj/project.pbxproj
after_success:
bash <(curl -s https://codecov.io/bash);
- <<: *test
env: DST='OS=12.0,name=iPhone SE' PLAT=iOS
name: iOS Tests
xcode_destination: 'platform=iOS Simulator,OS=12.0,name=iPhone SE'
- <<: *test
env: DST='OS=12.0,name=Apple TV' PLAT=tvOS
name: tvOS Tests
xcode_destination: 'platform=Apple TV Simulator,OS=12.0,name=Apple TV'
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "mxcl/PromiseKit" ~> 6.3
github "mxcl/PromiseKit" ~> 6.8.4
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "AliSoftware/OHHTTPStubs" ~> 6.0
github "AliSoftware/OHHTTPStubs" ~> 7.0
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "AliSoftware/OHHTTPStubs" "6.1.0"
github "mxcl/PromiseKit" "6.5.0"
github "AliSoftware/OHHTTPStubs" "7.0.0"
github "mxcl/PromiseKit" "6.8.4"
11 changes: 6 additions & 5 deletions PMKFoundation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Max Howell";
TargetAttributes = {
63C7FFA61D5BEE09003BAE60 = {
Expand All @@ -204,17 +204,18 @@
};
63C7FFF11D5C020D003BAE60 = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKFoundation" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 63C7FF9D1D5BEE09003BAE60;
productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */;
Expand Down Expand Up @@ -424,6 +425,7 @@
PRODUCT_MODULE_NAME = "${TARGET_NAME}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
};
name = Debug;
};
Expand All @@ -440,6 +442,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_MODULE_NAME = "${TARGET_NAME}";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
};
name = Release;
};
Expand All @@ -453,7 +456,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SUPPRESS_WARNINGS = YES;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -466,7 +468,6 @@
"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;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/mxcl/PromiseKit.git",
"state": {
"branch": null,
"revision": "adb7de9d36d86fdcc13f2710cf38c574914e6c2e",
"version": "6.8.3"
"revision": "e0176e7886b3bef5b9a546bcc6b357f6f569f222",
"version": "6.8.4"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Package@swift-4.2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkg.products = [
pkg.dependencies = [
.package(url: "https://github.com/mxcl/PromiseKit.git", .upToNextMajor(from: "6.0.0"))
]
pkg.swiftLanguageVersions = [.v3, .v4, .v4_2]
pkg.swiftLanguageVersions = [.v3, .v4, .v4_2, .version("5")]

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

This project adds promises to the Swift Foundation framework.

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

## CococaPods

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

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

## Carthage

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

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

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


Expand Down

0 comments on commit e5c5d84

Please sign in to comment.