Skip to content

Commit

Permalink
Merge pull request #85 from ellneal/master
Browse files Browse the repository at this point in the history
Add Swift 5.1 support on Linux
  • Loading branch information
pietbrauer authored Dec 14, 2019
2 parents c51137d + 1149393 commit 9ad4d6e
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 12 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: generic
osx_image: xcode9.2
osx_image: xcode10.2
sudo: false
env:
global:
Expand All @@ -11,15 +11,19 @@ matrix:
- os: osx
env: FASTLANE_LANE=code_coverage FASTLANE_ENV=default
- os: osx
env: FASTLANE_ENV=ios93
env: FASTLANE_ENV=ios12_2
- os: osx
env: FASTLANE_ENV=tvos92
env: FASTLANE_ENV=tvos12_2
- os: osx
env: FASTLANE_ENV=osx
- os: linux
sudo: required
dist: trusty
env: SWIFT_VERSION=4.2
- os: linux
sudo: required
dist: trusty
env: SWIFT_VERSION=5.1
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./Script/travis-install-linux; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./Script/travis-install-macos; fi
Expand Down
11 changes: 10 additions & 1 deletion OctoKit/Configuration.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

public let githubBaseURL = "https://api.github.com"
public let githubWebURL = "https://github.com"
Expand Down Expand Up @@ -126,7 +129,13 @@ enum OAuthRouter: Router {
}
}

var URLRequest: Foundation.URLRequest? {
#if canImport(FoundationNetworking)
typealias FoundationURLRequestType = FoundationNetworking.URLRequest
#else
typealias FoundationURLRequestType = Foundation.URLRequest
#endif

var URLRequest: FoundationURLRequestType? {
switch self {
case .authorize(let config):
let url = URL(string: path, relativeTo: URL(string: config.webEndpoint)!)
Expand Down
3 changes: 3 additions & 0 deletions OctoKit/Follow.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

public extension Octokit {

Expand Down
3 changes: 3 additions & 0 deletions OctoKit/Gist.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

// MARK: model

Expand Down
3 changes: 3 additions & 0 deletions OctoKit/Issue.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

// MARK: model

Expand Down
3 changes: 3 additions & 0 deletions OctoKit/Label.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

open class Label: Codable {
open var url: URL?
Expand Down
3 changes: 3 additions & 0 deletions OctoKit/PublicKey.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

// MARK: request

Expand Down
3 changes: 3 additions & 0 deletions OctoKit/PullRequest.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

open class PullRequest: Codable {
private(set) open var id: Int = -1
Expand Down
3 changes: 3 additions & 0 deletions OctoKit/Repositories.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

// MARK: model
open class Repository: Codable {
Expand Down
3 changes: 3 additions & 0 deletions OctoKit/Stars.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

public extension Octokit {

Expand Down
3 changes: 3 additions & 0 deletions OctoKit/User.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import Foundation
import RequestKit
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

// MARK: model
open class User: Codable {
Expand Down
1 change: 0 additions & 1 deletion Script/travis-install-macos
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env sh
sudo gem install bundler
bundle install
make install
3 changes: 3 additions & 0 deletions Tests/OctoKitTests/OctoKitURLTestSession.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import RequestKit
import XCTest
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

class MockURLSessionDataTask: URLSessionDataTaskProtocol {
fileprivate (set) var resumeWasCalled = false
Expand Down
7 changes: 3 additions & 4 deletions fastlane/.env.default
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
AF_IOS_SDK=iphonesimulator11.2
AF_MAC_SDK=macosx10.13
AF_TVOS_SDK=appletvsimulator11.2
AF_IOS_SDK=iphonesimulator12.2
AF_MAC_SDK=macosx10.14
AF_TVOS_SDK=appletvsimulator12.2

AF_CONFIGURATION=Release

SCAN_SCHEME=$AF_IOS_FRAMEWORK_SCHEME
SCAN_SDK=$AF_IOS_SDK
SCAN_OUTPUT_DIRECTORY=fastlane/test-output
DEPLOY_PODSPEC=OctoKit.swift.podspec

EXAMPLE_WORKSPACE=$AF_WORKSPACE
EXAMPLE_SCHEME=$AF_IOS_EXAMPLE_SCHEME
Expand Down
3 changes: 3 additions & 0 deletions fastlane/.env.ios12_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SCAN_DEVICE="iPhone 8"
SCAN_SDK=$AF_IOS_SDK
EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8"
3 changes: 0 additions & 3 deletions fastlane/.env.ios93

This file was deleted.

File renamed without changes.

0 comments on commit 9ad4d6e

Please sign in to comment.