Skip to content

Commit

Permalink
Merge pull request #84 from venmo/xcode-10
Browse files Browse the repository at this point in the history
Fix Swift 4.1.5 build errors and warnings
  • Loading branch information
hyperspacemark authored Sep 1, 2018
2 parents 9711fab + 687e8f4 commit f1c9376
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 47 deletions.
44 changes: 0 additions & 44 deletions DVR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,18 @@
3690A0981B33AA9400731222 /* URLResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3647AFBF1B33602A00EF10D4 /* URLResponse.swift */; };
3690A0991B33AA9400731222 /* HTTPURLResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3647AFC11B3363C400EF10D4 /* HTTPURLResponse.swift */; };
B19D62651CB1860400E16D11 /* SessionUploadTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = B19D62641CB1860400E16D11 /* SessionUploadTask.swift */; };
ED7862851F7D42B800CB2625 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = ED7862811F7D42B800CB2625 /* Info.plist */; };
ED7862871F7D42C200CB2625 /* SessionUploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED7862821F7D42B800CB2625 /* SessionUploadTests.swift */; };
ED7862881F7D42C200CB2625 /* SessionUploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED7862821F7D42B800CB2625 /* SessionUploadTests.swift */; };
ED7862891F7D42C300CB2625 /* SessionUploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED7862821F7D42B800CB2625 /* SessionUploadTests.swift */; };
ED78628A1F7D42C700CB2625 /* SessionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED78627F1F7D42B700CB2625 /* SessionTests.swift */; };
ED78628B1F7D42C700CB2625 /* SessionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED78627F1F7D42B700CB2625 /* SessionTests.swift */; };
ED78628C1F7D42C800CB2625 /* SessionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED78627F1F7D42B700CB2625 /* SessionTests.swift */; };
ED78629F1F7D44EA00CB2625 /* example.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862911F7D44E200CB2625 /* example.json */; };
ED7862A01F7D44EA00CB2625 /* json-example.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862971F7D44E200CB2625 /* json-example.json */; };
ED7862A11F7D44EA00CB2625 /* multiple.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862951F7D44E200CB2625 /* multiple.json */; };
ED7862A21F7D44EA00CB2625 /* testfile.txt in Resources */ = {isa = PBXBuildFile; fileRef = ED7862921F7D44E200CB2625 /* testfile.txt */; };
ED7862A31F7D44EA00CB2625 /* text.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862961F7D44E200CB2625 /* text.json */; };
ED7862A41F7D44EA00CB2625 /* upload-data.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862941F7D44E200CB2625 /* upload-data.json */; };
ED7862A51F7D44EA00CB2625 /* upload-file.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862931F7D44E200CB2625 /* upload-file.json */; };
ED7862A61F7D44EB00CB2625 /* example.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862911F7D44E200CB2625 /* example.json */; };
ED7862A71F7D44EB00CB2625 /* json-example.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862971F7D44E200CB2625 /* json-example.json */; };
ED7862A81F7D44EB00CB2625 /* multiple.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862951F7D44E200CB2625 /* multiple.json */; };
ED7862A91F7D44EB00CB2625 /* testfile.txt in Resources */ = {isa = PBXBuildFile; fileRef = ED7862921F7D44E200CB2625 /* testfile.txt */; };
ED7862AA1F7D44EB00CB2625 /* text.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862961F7D44E200CB2625 /* text.json */; };
ED7862AB1F7D44EB00CB2625 /* upload-data.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862941F7D44E200CB2625 /* upload-data.json */; };
ED7862AC1F7D44EB00CB2625 /* upload-file.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862931F7D44E200CB2625 /* upload-file.json */; };
ED7862AD1F7D44EB00CB2625 /* example.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862911F7D44E200CB2625 /* example.json */; };
ED7862AE1F7D44EB00CB2625 /* json-example.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862971F7D44E200CB2625 /* json-example.json */; };
ED7862AF1F7D44EB00CB2625 /* multiple.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862951F7D44E200CB2625 /* multiple.json */; };
ED7862B01F7D44EB00CB2625 /* testfile.txt in Resources */ = {isa = PBXBuildFile; fileRef = ED7862921F7D44E200CB2625 /* testfile.txt */; };
ED7862B11F7D44EB00CB2625 /* text.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862961F7D44E200CB2625 /* text.json */; };
ED7862B21F7D44EB00CB2625 /* upload-data.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862941F7D44E200CB2625 /* upload-data.json */; };
ED7862B31F7D44EB00CB2625 /* upload-file.json in Resources */ = {isa = PBXBuildFile; fileRef = ED7862931F7D44E200CB2625 /* upload-file.json */; };
EDC4065920D9ABE900A5D1F7 /* upload-file.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065120D9ABE800A5D1F7 /* upload-file.json */; };
EDC4065A20D9ABE900A5D1F7 /* upload-file.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065120D9ABE800A5D1F7 /* upload-file.json */; };
EDC4065B20D9ABE900A5D1F7 /* upload-file.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065120D9ABE800A5D1F7 /* upload-file.json */; };
Expand All @@ -74,9 +58,6 @@
EDC4065F20D9ABE900A5D1F7 /* multiple.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065320D9ABE800A5D1F7 /* multiple.json */; };
EDC4066020D9ABE900A5D1F7 /* multiple.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065320D9ABE800A5D1F7 /* multiple.json */; };
EDC4066120D9ABE900A5D1F7 /* multiple.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065320D9ABE800A5D1F7 /* multiple.json */; };
EDC4066220D9ABE900A5D1F7 /* example.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065420D9ABE800A5D1F7 /* example.json */; };
EDC4066320D9ABE900A5D1F7 /* example.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065420D9ABE800A5D1F7 /* example.json */; };
EDC4066420D9ABE900A5D1F7 /* example.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065420D9ABE800A5D1F7 /* example.json */; };
EDC4066520D9ABE900A5D1F7 /* json-example.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065520D9ABE800A5D1F7 /* json-example.json */; };
EDC4066620D9ABE900A5D1F7 /* json-example.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065520D9ABE800A5D1F7 /* json-example.json */; };
EDC4066720D9ABE900A5D1F7 /* json-example.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065520D9ABE800A5D1F7 /* json-example.json */; };
Expand All @@ -86,9 +67,6 @@
EDC4066B20D9ABE900A5D1F7 /* text.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065720D9ABE800A5D1F7 /* text.json */; };
EDC4066C20D9ABE900A5D1F7 /* text.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065720D9ABE800A5D1F7 /* text.json */; };
EDC4066D20D9ABE900A5D1F7 /* text.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065720D9ABE800A5D1F7 /* text.json */; };
EDC4066E20D9ABE900A5D1F7 /* upload-data.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065820D9ABE800A5D1F7 /* upload-data.json */; };
EDC4066F20D9ABE900A5D1F7 /* upload-data.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065820D9ABE800A5D1F7 /* upload-data.json */; };
EDC4067020D9ABE900A5D1F7 /* upload-data.json in Resources */ = {isa = PBXBuildFile; fileRef = EDC4065820D9ABE800A5D1F7 /* upload-data.json */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -513,19 +491,12 @@
buildActionMask = 2147483647;
files = (
EDC4066720D9ABE900A5D1F7 /* json-example.json in Resources */,
ED7862AE1F7D44EB00CB2625 /* json-example.json in Resources */,
EDC4066D20D9ABE900A5D1F7 /* text.json in Resources */,
ED7862AD1F7D44EB00CB2625 /* example.json in Resources */,
EDC4065B20D9ABE900A5D1F7 /* upload-file.json in Resources */,
EDC4066A20D9ABE900A5D1F7 /* testfile.txt in Resources */,
ED7862B21F7D44EB00CB2625 /* upload-data.json in Resources */,
ED7862B31F7D44EB00CB2625 /* upload-file.json in Resources */,
EDC4066420D9ABE900A5D1F7 /* example.json in Resources */,
EDC4066120D9ABE900A5D1F7 /* multiple.json in Resources */,
ED7862B11F7D44EB00CB2625 /* text.json in Resources */,
EDC4067020D9ABE900A5D1F7 /* upload-data.json in Resources */,
ED7862B01F7D44EB00CB2625 /* testfile.txt in Resources */,
ED7862AF1F7D44EB00CB2625 /* multiple.json in Resources */,
EDC4065E20D9ABE900A5D1F7 /* failed-request-example.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -534,7 +505,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
ED7862851F7D42B800CB2625 /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -543,19 +513,12 @@
buildActionMask = 2147483647;
files = (
EDC4066520D9ABE900A5D1F7 /* json-example.json in Resources */,
ED7862A01F7D44EA00CB2625 /* json-example.json in Resources */,
EDC4066B20D9ABE900A5D1F7 /* text.json in Resources */,
ED78629F1F7D44EA00CB2625 /* example.json in Resources */,
EDC4065920D9ABE900A5D1F7 /* upload-file.json in Resources */,
EDC4066820D9ABE900A5D1F7 /* testfile.txt in Resources */,
ED7862A41F7D44EA00CB2625 /* upload-data.json in Resources */,
ED7862A51F7D44EA00CB2625 /* upload-file.json in Resources */,
EDC4066220D9ABE900A5D1F7 /* example.json in Resources */,
EDC4065F20D9ABE900A5D1F7 /* multiple.json in Resources */,
ED7862A31F7D44EA00CB2625 /* text.json in Resources */,
EDC4066E20D9ABE900A5D1F7 /* upload-data.json in Resources */,
ED7862A21F7D44EA00CB2625 /* testfile.txt in Resources */,
ED7862A11F7D44EA00CB2625 /* multiple.json in Resources */,
EDC4065C20D9ABE900A5D1F7 /* failed-request-example.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -572,19 +535,12 @@
buildActionMask = 2147483647;
files = (
EDC4066620D9ABE900A5D1F7 /* json-example.json in Resources */,
ED7862A71F7D44EB00CB2625 /* json-example.json in Resources */,
EDC4066C20D9ABE900A5D1F7 /* text.json in Resources */,
ED7862A61F7D44EB00CB2625 /* example.json in Resources */,
EDC4065A20D9ABE900A5D1F7 /* upload-file.json in Resources */,
EDC4066920D9ABE900A5D1F7 /* testfile.txt in Resources */,
ED7862AB1F7D44EB00CB2625 /* upload-data.json in Resources */,
ED7862AC1F7D44EB00CB2625 /* upload-file.json in Resources */,
EDC4066320D9ABE900A5D1F7 /* example.json in Resources */,
EDC4066020D9ABE900A5D1F7 /* multiple.json in Resources */,
ED7862AA1F7D44EB00CB2625 /* text.json in Resources */,
EDC4066F20D9ABE900A5D1F7 /* upload-data.json in Resources */,
ED7862A91F7D44EB00CB2625 /* testfile.txt in Resources */,
ED7862A81F7D44EB00CB2625 /* multiple.json in Resources */,
EDC4065D20D9ABE900A5D1F7 /* failed-request-example.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
10 changes: 7 additions & 3 deletions Sources/DVR/Session.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ open class Session: URLSession {

// MARK: - Properties

public static var defaultTestBundle: Bundle? {
return Bundle.allBundles.first { $0.bundlePath.hasSuffix(".xctest") }
}

open var outputDirectory: String
open let cassetteName: String
open let backingSession: URLSession
public let cassetteName: String
public let backingSession: URLSession
open var recordingEnabled = true

private let testBundle: Bundle
Expand All @@ -23,7 +27,7 @@ open class Session: URLSession {

// MARK: - Initializers

public init(outputDirectory: String = "~/Desktop/DVR/", cassetteName: String, testBundle: Bundle = Bundle.allBundles.filter() { $0.bundlePath.hasSuffix(".xctest") }.first!, backingSession: URLSession = URLSession.shared) {
public init(outputDirectory: String = "~/Desktop/DVR/", cassetteName: String, testBundle: Bundle = Session.defaultTestBundle!, backingSession: URLSession = URLSession.shared) {
self.outputDirectory = outputDirectory
self.cassetteName = cassetteName
self.testBundle = testBundle
Expand Down

0 comments on commit f1c9376

Please sign in to comment.