Skip to content

Commit

Permalink
Update project for Swift 2.3
Browse files Browse the repository at this point in the history
* Updates to recommended project settings
* Updates Quick & Nimble for swift 2.3
* Ensured tests are running successfully.
  • Loading branch information
Malcolm Jarvis committed Sep 27, 2016
1 parent ffaa656 commit 23870fe
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Quick/Quick"
github "Quick/Nimble"
github "Quick/Quick" ~> 0.9.3
github "Quick/Nimble" ~> 4.1.0
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "mogstad/CommonCrypto" "v0.1.1"
github "Quick/Nimble" "v4.0.1"
github "Quick/Quick" "v0.9.2"
github "Quick/Nimble" "v4.1.0"
github "Quick/Quick" "v0.9.3"
31 changes: 30 additions & 1 deletion MultipartDataBuilder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
2DE906341CBFCD08003008A6 /* write_output_stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE906331CBFCD08003008A6 /* write_output_stream.swift */; };
2DF25AB91CB7CB4C0086EB8E /* walter.png in Copy Fixtures */ = {isa = PBXBuildFile; fileRef = 2DF25AB71CB7CB310086EB8E /* walter.png */; };
2DF25ABB1CB804AF0086EB8E /* text.txt in Copy Fixtures */ = {isa = PBXBuildFile; fileRef = 2DF25ABA1CB803940086EB8E /* text.txt */; };
D4F19CBC1D9ACD4E002048D1 /* multipart_field.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DBAA74D1CC0E666007F02FB /* multipart_field.swift */; };
D4F19CBD1D9ACD5D002048D1 /* chunk_datasource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DBAA7531CC0E86C007F02FB /* chunk_datasource.swift */; };
D4F19CBE1D9ACD6C002048D1 /* stream_data_source.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE906311CBFBEBC003008A6 /* stream_data_source.swift */; };
D4F19CBF1D9ACD7C002048D1 /* read_stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DA112951CC29D8900B5D1C4 /* read_stream.swift */; };
D4F19CC01D9ACD84002048D1 /* write_output_stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DE906331CBFCD08003008A6 /* write_output_stream.swift */; };
D4F19CC11D9ACD8A002048D1 /* multipart_static_field.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DBAA74F1CC0E747007F02FB /* multipart_static_field.swift */; };
D4F19CC21D9ACD95002048D1 /* multipart_stream_field.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DBAA7571CC0F02C007F02FB /* multipart_stream_field.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -415,14 +422,16 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = Flow;
TargetAttributes = {
2DD5B78C1B1B7C9100238EA1 = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0800;
};
2DD5B7971B1B7C9100238EA1 = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0800;
};
2DD5B7AD1B1B7CB500238EA1 = {
CreatedOnToolsVersion = 6.3.2;
Expand Down Expand Up @@ -486,11 +495,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D4F19CC01D9ACD84002048D1 /* write_output_stream.swift in Sources */,
D4F19CBE1D9ACD6C002048D1 /* stream_data_source.swift in Sources */,
D4F19CBD1D9ACD5D002048D1 /* chunk_datasource.swift in Sources */,
D4F19CC21D9ACD95002048D1 /* multipart_stream_field.swift in Sources */,
2D1EAFD31BEFC50D006AA9A0 /* utilities.swift in Sources */,
D4F19CBF1D9ACD7C002048D1 /* read_stream.swift in Sources */,
2DD5B7D01B1B7DC600238EA1 /* multipart_form.swift in Sources */,
2DD5B7DD1B1B829400238EA1 /* NSMutableURLRequest+MultipartDataBuilder.swift in Sources */,
D4F19CC11D9ACD8A002048D1 /* multipart_static_field.swift in Sources */,
2DD5B7D31B1B7E3600238EA1 /* NSCharacterSet+MIME.swift in Sources */,
2D2395D11CA0A80E003C2A65 /* multipart_form_builder.swift in Sources */,
D4F19CBC1D9ACD4E002048D1 /* multipart_field.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -518,8 +534,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -567,8 +585,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -588,6 +608,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -599,6 +620,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -615,13 +637,15 @@
PRODUCT_NAME = MultipartDataBuilder;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
2DD5B7A51B1B7C9100238EA1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -637,6 +661,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.getflow.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = MultipartDataBuilder;
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand All @@ -655,6 +680,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.getflow.tests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -669,6 +695,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.getflow.tests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand Down Expand Up @@ -696,6 +723,7 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand All @@ -717,6 +745,7 @@
PRODUCT_NAME = MultipartDataBuilder;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
6 changes: 3 additions & 3 deletions sources/asset_data_source.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class AssetDataSource: ChunkDataSource {
exportSession.outputFileType = fileType
let date = NSDate().timeIntervalSince1970
let outputURL = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("temp-\(date).mov")
if NSFileManager.defaultManager().fileExistsAtPath(outputURL.path!) {
let _ = try? NSFileManager.defaultManager().removeItemAtURL(outputURL)
if NSFileManager.defaultManager().fileExistsAtPath(outputURL!.path!) {
let _ = try? NSFileManager.defaultManager().removeItemAtURL(outputURL!)
}
exportSession.outputURL = outputURL
exportSession.exportAsynchronouslyWithCompletionHandler({
Expand All @@ -55,7 +55,7 @@ class AssetDataSource: ChunkDataSource {
return completeHandler(Error.ExportSessionFailed)
}

let inputStream = NSInputStream(URL: outputURL)!
let inputStream = NSInputStream(URL: outputURL!)!
do {
try self.writePrologue(self.asset, contentType: contentTypeForUTI(fileType), outputStream: outputStream)
try self.writeStream(inputStream, outputStream: outputStream)
Expand Down

0 comments on commit 23870fe

Please sign in to comment.