Skip to content

Commit 23870fe

Browse files
author
Malcolm Jarvis
committed
Update project for Swift 2.3
* Updates to recommended project settings * Updates Quick & Nimble for swift 2.3 * Ensured tests are running successfully.
1 parent ffaa656 commit 23870fe

6 files changed

Lines changed: 39 additions & 10 deletions

File tree

Cartfile.private

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "Quick/Quick"
2-
github "Quick/Nimble"
1+
github "Quick/Quick" ~> 0.9.3
2+
github "Quick/Nimble" ~> 4.1.0

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
github "mogstad/CommonCrypto" "v0.1.1"
2-
github "Quick/Nimble" "v4.0.1"
3-
github "Quick/Quick" "v0.9.2"
2+
github "Quick/Nimble" "v4.1.0"
3+
github "Quick/Quick" "v0.9.3"

MultipartDataBuilder.xcodeproj/project.pbxproj

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
2DE906341CBFCD08003008A6 /* write_output_stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE906331CBFCD08003008A6 /* write_output_stream.swift */; };
4545
2DF25AB91CB7CB4C0086EB8E /* walter.png in Copy Fixtures */ = {isa = PBXBuildFile; fileRef = 2DF25AB71CB7CB310086EB8E /* walter.png */; };
4646
2DF25ABB1CB804AF0086EB8E /* text.txt in Copy Fixtures */ = {isa = PBXBuildFile; fileRef = 2DF25ABA1CB803940086EB8E /* text.txt */; };
47+
D4F19CBC1D9ACD4E002048D1 /* multipart_field.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DBAA74D1CC0E666007F02FB /* multipart_field.swift */; };
48+
D4F19CBD1D9ACD5D002048D1 /* chunk_datasource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DBAA7531CC0E86C007F02FB /* chunk_datasource.swift */; };
49+
D4F19CBE1D9ACD6C002048D1 /* stream_data_source.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE906311CBFBEBC003008A6 /* stream_data_source.swift */; };
50+
D4F19CBF1D9ACD7C002048D1 /* read_stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DA112951CC29D8900B5D1C4 /* read_stream.swift */; };
51+
D4F19CC01D9ACD84002048D1 /* write_output_stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE906331CBFCD08003008A6 /* write_output_stream.swift */; };
52+
D4F19CC11D9ACD8A002048D1 /* multipart_static_field.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DBAA74F1CC0E747007F02FB /* multipart_static_field.swift */; };
53+
D4F19CC21D9ACD95002048D1 /* multipart_stream_field.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DBAA7571CC0F02C007F02FB /* multipart_stream_field.swift */; };
4754
/* End PBXBuildFile section */
4855

4956
/* Begin PBXContainerItemProxy section */
@@ -415,14 +422,16 @@
415422
attributes = {
416423
LastSwiftMigration = 0700;
417424
LastSwiftUpdateCheck = 0700;
418-
LastUpgradeCheck = 0700;
425+
LastUpgradeCheck = 0800;
419426
ORGANIZATIONNAME = Flow;
420427
TargetAttributes = {
421428
2DD5B78C1B1B7C9100238EA1 = {
422429
CreatedOnToolsVersion = 6.3.2;
430+
LastSwiftMigration = 0800;
423431
};
424432
2DD5B7971B1B7C9100238EA1 = {
425433
CreatedOnToolsVersion = 6.3.2;
434+
LastSwiftMigration = 0800;
426435
};
427436
2DD5B7AD1B1B7CB500238EA1 = {
428437
CreatedOnToolsVersion = 6.3.2;
@@ -486,11 +495,18 @@
486495
isa = PBXSourcesBuildPhase;
487496
buildActionMask = 2147483647;
488497
files = (
498+
D4F19CC01D9ACD84002048D1 /* write_output_stream.swift in Sources */,
499+
D4F19CBE1D9ACD6C002048D1 /* stream_data_source.swift in Sources */,
500+
D4F19CBD1D9ACD5D002048D1 /* chunk_datasource.swift in Sources */,
501+
D4F19CC21D9ACD95002048D1 /* multipart_stream_field.swift in Sources */,
489502
2D1EAFD31BEFC50D006AA9A0 /* utilities.swift in Sources */,
503+
D4F19CBF1D9ACD7C002048D1 /* read_stream.swift in Sources */,
490504
2DD5B7D01B1B7DC600238EA1 /* multipart_form.swift in Sources */,
491505
2DD5B7DD1B1B829400238EA1 /* NSMutableURLRequest+MultipartDataBuilder.swift in Sources */,
506+
D4F19CC11D9ACD8A002048D1 /* multipart_static_field.swift in Sources */,
492507
2DD5B7D31B1B7E3600238EA1 /* NSCharacterSet+MIME.swift in Sources */,
493508
2D2395D11CA0A80E003C2A65 /* multipart_form_builder.swift in Sources */,
509+
D4F19CBC1D9ACD4E002048D1 /* multipart_field.swift in Sources */,
494510
);
495511
runOnlyForDeploymentPostprocessing = 0;
496512
};
@@ -518,8 +534,10 @@
518534
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
519535
CLANG_WARN_EMPTY_BODY = YES;
520536
CLANG_WARN_ENUM_CONVERSION = YES;
537+
CLANG_WARN_INFINITE_RECURSION = YES;
521538
CLANG_WARN_INT_CONVERSION = YES;
522539
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
540+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
523541
CLANG_WARN_UNREACHABLE_CODE = YES;
524542
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
525543
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -567,8 +585,10 @@
567585
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
568586
CLANG_WARN_EMPTY_BODY = YES;
569587
CLANG_WARN_ENUM_CONVERSION = YES;
588+
CLANG_WARN_INFINITE_RECURSION = YES;
570589
CLANG_WARN_INT_CONVERSION = YES;
571590
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
591+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
572592
CLANG_WARN_UNREACHABLE_CODE = YES;
573593
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
574594
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -588,6 +608,7 @@
588608
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
589609
MTL_ENABLE_DEBUG_INFO = NO;
590610
SDKROOT = iphoneos;
611+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
591612
TARGETED_DEVICE_FAMILY = "1,2";
592613
VALIDATE_PRODUCT = YES;
593614
VERSIONING_SYSTEM = "apple-generic";
@@ -599,6 +620,7 @@
599620
isa = XCBuildConfiguration;
600621
buildSettings = {
601622
CLANG_ENABLE_MODULES = YES;
623+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
602624
DEFINES_MODULE = YES;
603625
DYLIB_COMPATIBILITY_VERSION = 1;
604626
DYLIB_CURRENT_VERSION = 1;
@@ -615,13 +637,15 @@
615637
PRODUCT_NAME = MultipartDataBuilder;
616638
SKIP_INSTALL = YES;
617639
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
640+
SWIFT_VERSION = 2.3;
618641
};
619642
name = Debug;
620643
};
621644
2DD5B7A51B1B7C9100238EA1 /* Release */ = {
622645
isa = XCBuildConfiguration;
623646
buildSettings = {
624647
CLANG_ENABLE_MODULES = YES;
648+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
625649
DEFINES_MODULE = YES;
626650
DYLIB_COMPATIBILITY_VERSION = 1;
627651
DYLIB_CURRENT_VERSION = 1;
@@ -637,6 +661,7 @@
637661
PRODUCT_BUNDLE_IDENTIFIER = "com.getflow.$(PRODUCT_NAME:rfc1034identifier)";
638662
PRODUCT_NAME = MultipartDataBuilder;
639663
SKIP_INSTALL = YES;
664+
SWIFT_VERSION = 2.3;
640665
};
641666
name = Release;
642667
};
@@ -655,6 +680,7 @@
655680
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
656681
PRODUCT_BUNDLE_IDENTIFIER = com.getflow.tests;
657682
PRODUCT_NAME = "$(TARGET_NAME)";
683+
SWIFT_VERSION = 2.3;
658684
};
659685
name = Debug;
660686
};
@@ -669,6 +695,7 @@
669695
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
670696
PRODUCT_BUNDLE_IDENTIFIER = com.getflow.tests;
671697
PRODUCT_NAME = "$(TARGET_NAME)";
698+
SWIFT_VERSION = 2.3;
672699
};
673700
name = Release;
674701
};
@@ -696,6 +723,7 @@
696723
SDKROOT = macosx;
697724
SKIP_INSTALL = YES;
698725
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
726+
SWIFT_VERSION = 2.3;
699727
};
700728
name = Debug;
701729
};
@@ -717,6 +745,7 @@
717745
PRODUCT_NAME = MultipartDataBuilder;
718746
SDKROOT = macosx;
719747
SKIP_INSTALL = YES;
748+
SWIFT_VERSION = 2.3;
720749
};
721750
name = Release;
722751
};

MultipartDataBuilder.xcodeproj/xcshareddata/xcschemes/Mac.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0700"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

MultipartDataBuilder.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0700"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

sources/asset_data_source.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class AssetDataSource: ChunkDataSource {
4545
exportSession.outputFileType = fileType
4646
let date = NSDate().timeIntervalSince1970
4747
let outputURL = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("temp-\(date).mov")
48-
if NSFileManager.defaultManager().fileExistsAtPath(outputURL.path!) {
49-
let _ = try? NSFileManager.defaultManager().removeItemAtURL(outputURL)
48+
if NSFileManager.defaultManager().fileExistsAtPath(outputURL!.path!) {
49+
let _ = try? NSFileManager.defaultManager().removeItemAtURL(outputURL!)
5050
}
5151
exportSession.outputURL = outputURL
5252
exportSession.exportAsynchronouslyWithCompletionHandler({
@@ -55,7 +55,7 @@ class AssetDataSource: ChunkDataSource {
5555
return completeHandler(Error.ExportSessionFailed)
5656
}
5757

58-
let inputStream = NSInputStream(URL: outputURL)!
58+
let inputStream = NSInputStream(URL: outputURL!)!
5959
do {
6060
try self.writePrologue(self.asset, contentType: contentTypeForUTI(fileType), outputStream: outputStream)
6161
try self.writeStream(inputStream, outputStream: outputStream)

0 commit comments

Comments
 (0)