Skip to content

Commit

Permalink
Update for swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkhanAlikhanov committed Nov 10, 2019
1 parent a507ee9 commit 47cea3d
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 53 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,6 @@ playground.xcworkspace
# ignore cocoapod generated files
Pods
Podfile.lock
*.xcworkspace
*.xcworkspace
Package.resolved
swiftpm
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

23 changes: 4 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,12 @@ matrix:
- sourceline: 'deb [trusted=yes] http://apt.orkhanalikhanov.com ./'
packages:
- libressl
install: eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
env: SWIFT_VERSION=5.0
install: eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
script: env LD_LIBRARY_PATH='/usr/local/lib:/usr/local/opt/libressl/lib:$LD_LIBRARY_PATH' swift test

- os: osx
osx_image: xcode9.3
osx_image: xcode11.2
dist: trusty
sudo: required
env: ACTION=test PLATFORM=Mac DESTINATION='platform=OS X'
script: set -o pipefail && xcodebuild -project RequestSwift.xcodeproj -scheme RequestSwift -destination "$DESTINATION" $ACTION | xcpretty

- os: osx
osx_image: xcode9.3
dist: trusty
sudo: required
env: ACTION=test PLATFORM=iOS DESTINATION='platform=iOS Simulator,name=iPhone 6S'
script: set -o pipefail && xcodebuild -project RequestSwift.xcodeproj -scheme RequestSwift -destination "$DESTINATION" $ACTION | xcpretty

- os: osx
osx_image: xcode9.3
dist: trusty
sudo: required
env: ACTION=test PLATFORM=tvOS DESTINATION='platform=tvOS Simulator,name=Apple TV'
script: set -o pipefail && xcodebuild -project RequestSwift.xcodeproj -scheme RequestSwift -destination "$DESTINATION" $ACTION | xcpretty

script: set -o pipefail && xcodebuild -scheme RequestSwift -destination "platform=OS X" test | xcpretty && xcodebuild -scheme RequestSwift -destination "platform=iOS Simulator,name=iPhone 11" test | xcpretty && xcodebuild -scheme RequestSwift -destination "platform=tvOS Simulator,name=Apple TV" test | xcpretty
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "BiAtoms/Socket.swift" ~> 2.2
github "BiAtoms/Socket.swift" ~> 2.4.0
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
targets: ["RequestSwift"]),
],
dependencies: [
.package(url: "https://github.com/BiAtoms/Socket.swift.git", from: "2.2.0")
.package(url: "https://github.com/BiAtoms/Socket.swift.git", .upToNextMinor(from: "2.4.0"))
],
targets: [
.target(
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To integrate Request.swift into your Xcode project using CocoaPods, specify it i
```ruby
source 'https://github.com/CocoaPods/Specs.git'
target '<Your Target Name>' do
pod 'Request.swift', '~> 2.2'
pod 'Request.swift', '~> 2.3.0'
end
```

Expand All @@ -65,7 +65,7 @@ $ brew install carthage
To integrate Request.swift into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "BiAtoms/Request.swift" ~> 2.2
github "BiAtoms/Request.swift" ~> 2.3.0
```

Run `carthage update` to build the framework and drag the built `RequestSwift.framework` into your Xcode project.
Expand All @@ -78,7 +78,7 @@ Once you have your Swift package set up, adding Request.swift as a dependency is

```swift
dependencies: [
.package(url: "https://github.com/BiAtoms/Request.swift.git", from: "2.0.0")
.package(url: "https://github.com/BiAtoms/Request.swift.git", from: "2.3.0")
]
```

Expand Down
5 changes: 3 additions & 2 deletions Request.swift.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Pod::Spec.new do |s|
s.name = 'Request.swift'
s.version = '2.2.3'
s.version = '2.3.0'
s.summary = 'A (sync/async) tiny http client written in swift.'
s.homepage = 'https://github.com/BiAtoms/Request.swift'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Orkhan Alikhanov' => 'orkhan.alikhanov@gmail.com' }
s.source = { :git => 'https://github.com/BiAtoms/Request.swift.git', :tag => s.version.to_s }
s.module_name = 'RequestSwift'

s.swift_versions = ['5.0']
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '9.0'
s.source_files = 'Sources/*.swift'
s.dependency 'Socket.swift', '~> 2.2'
s.dependency 'Socket.swift', '~> 2.4.0'
end
19 changes: 11 additions & 8 deletions RequestSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -229,27 +229,28 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1110;
ORGANIZATIONNAME = BiAtoms;
TargetAttributes = {
9DD75F1E1F14F3D100378CB7 = {
CreatedOnToolsVersion = 8.3.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1110;
ProvisioningStyle = Automatic;
};
9DD75F271F14F3D100378CB7 = {
CreatedOnToolsVersion = 8.3.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1110;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 9DD75F191F14F3D100378CB7 /* Build configuration list for PBXProject "RequestSwift" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 9DD75F151F14F3D100378CB7;
productRefGroup = 9DD75F201F14F3D100378CB7 /* Products */;
Expand Down Expand Up @@ -342,6 +343,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -407,6 +409,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -479,7 +482,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -500,7 +503,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -514,7 +517,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.biatoms.RequestSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -528,7 +531,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.biatoms.RequestSwiftTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
24 changes: 10 additions & 14 deletions RequestSwift.xcodeproj/xcshareddata/xcschemes/RequestSwift.xcscheme
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 = "1110"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9DD75F1E1F14F3D100378CB7"
BuildableName = "RequestSwift.framework"
BlueprintName = "RequestSwift"
ReferencedContainer = "container:RequestSwift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +48,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9DD75F1E1F14F3D100378CB7"
BuildableName = "RequestSwift.framework"
BlueprintName = "RequestSwift"
ReferencedContainer = "container:RequestSwift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -70,8 +68,6 @@
ReferencedContainer = "container:RequestSwift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
4 changes: 2 additions & 2 deletions Sources/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public typealias Headers = [String: String]

open class Client {
open var baseUrl: String?
open let queue = DispatchQueue(label: "com.biatoms.request-swift." + UUID().uuidString)
public let queue = DispatchQueue(label: "com.biatoms.request-swift." + UUID().uuidString)
open var firesImmediately: Bool = true
open var timeout: Int = 5000 // in ms

Expand All @@ -31,7 +31,7 @@ open class Client {
}

//https://forums.developer.apple.com/thread/65416
open static func getSystemProxy(for host: String) -> Proxy? {
public static func getSystemProxy(for host: String) -> Proxy? {
#if os(Linux) //CFNetworkCopySystemProxySettings hasn't been implemented. (see https://github.com/apple/swift-corelibs-foundation)
#else
guard let url = URL(string: host),
Expand Down

0 comments on commit 47cea3d

Please sign in to comment.