Skip to content

Commit

Permalink
Fix FoundationNetworking imports for Linux builds
Browse files Browse the repository at this point in the history
  • Loading branch information
freak4pc committed Mar 3, 2020
1 parent 4c87901 commit bc9b693
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,6 +20,7 @@ DerivedData
*.o

timeline.xctimeline
.vscode

# CocoaPods
#
Expand Down
4 changes: 4 additions & 0 deletions RxCocoa/Foundation/Logging.swift
Expand Up @@ -6,7 +6,11 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//

#if canImport(FoundationNetworking)
import struct FoundationNetworking.URLRequest
#else
import struct Foundation.URLRequest
#endif

/// Simple logging settings for RxCocoa library.
public struct Logging {
Expand Down
16 changes: 12 additions & 4 deletions RxCocoa/Foundation/URLSession+Rx.swift
Expand Up @@ -7,18 +7,26 @@
//

import struct Foundation.URL
import struct Foundation.URLRequest
import struct Foundation.Data
import struct Foundation.Date
import struct Foundation.TimeInterval
import class Foundation.HTTPURLResponse
import class Foundation.URLSession
import class Foundation.URLResponse
import class Foundation.JSONSerialization
import class Foundation.NSError
import var Foundation.NSURLErrorCancelled
import var Foundation.NSURLErrorDomain

#if canImport(FoundationNetworking)
import struct FoundationNetworking.URLRequest
import class FoundationNetworking.HTTPURLResponse
import class FoundationNetworking.URLSession
import class FoundationNetworking.URLResponse
#else
import struct Foundation.URLRequest
import class Foundation.HTTPURLResponse
import class Foundation.URLSession
import class Foundation.URLResponse
#endif

#if os(Linux)
// don't know why
import Foundation
Expand Down
Expand Up @@ -10,8 +10,8 @@ import RxSwift

import struct Foundation.URL
import struct Foundation.Data
import struct Foundation.URLRequest
import struct Foundation.NSRange
import struct Foundation.URLRequest
import class Foundation.HTTPURLResponse
import class Foundation.URLSession
import class Foundation.NSRegularExpression
Expand Down

0 comments on commit bc9b693

Please sign in to comment.