Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Xcode 10.2 and Swift 5 #71

Merged
merged 5 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
language: objective-c
osx_image: xcode10.1
osx_image: xcode10.2
env:
global:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
- WORKSPACE=Embassy.xcworkspace
- IOS_FRAMEWORK_SCHEME="Embassy-iOS"
- IOS_SDK=iphonesimulator12.1
- IOS_SDK=iphonesimulator12.2
- MACOS_FRAMEWORK_SCHEME="Embassy-macOS"
- MACOS_SDK=macosx10.14
matrix:
- DESTINATION="OS=12.1,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="OS=12.2,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"

script:
Expand Down
9 changes: 7 additions & 2 deletions Embassy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,11 @@
};
D85613E81CEE6B160060CCB7 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
D85613F21CEE6B160060CCB7 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
};
};
Expand All @@ -552,6 +552,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
LFabien marked this conversation as resolved.
Show resolved Hide resolved
);
mainGroup = D85613DF1CEE6B160060CCB7;
Expand Down Expand Up @@ -1072,6 +1073,7 @@
PRODUCT_NAME = Embassy;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1090,6 +1092,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.envoy.Embassy;
PRODUCT_NAME = Embassy;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -1100,6 +1103,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.envoy.Embassy-iOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1110,6 +1114,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.envoy.Embassy-iOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
10 changes: 5 additions & 5 deletions Sources/DefaultLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class DefaultLogger: Logger {
file: String = #file,
line: Int = #line
) {
log(level: .debug, message: message, caller: caller, file: file, line: line)
log(level: .debug, message: message(), caller: caller, file: file, line: line)
}

public func info(
Expand All @@ -44,7 +44,7 @@ public final class DefaultLogger: Logger {
file: String = #file,
line: Int = #line
) {
log(level: .info, message: message, caller: caller, file: file, line: line)
log(level: .info, message: message(), caller: caller, file: file, line: line)
}

public func warning(
Expand All @@ -53,7 +53,7 @@ public final class DefaultLogger: Logger {
file: String = #file,
line: Int = #line
) {
log(level: .warning, message: message, caller: caller, file: file, line: line)
log(level: .warning, message: message(), caller: caller, file: file, line: line)
}

public func error(
Expand All @@ -62,7 +62,7 @@ public final class DefaultLogger: Logger {
file: String = #file,
line: Int = #line
) {
log(level: .error, message: message, caller: caller, file: file, line: line)
log(level: .error, message: message(), caller: caller, file: file, line: line)
}

public func critical(
Expand All @@ -71,7 +71,7 @@ public final class DefaultLogger: Logger {
file: String = #file,
line: Int = #line
) {
log(level: .critical, message: message, caller: caller, file: file, line: line)
log(level: .critical, message: message(), caller: caller, file: file, line: line)
}

func log(
Expand Down
2 changes: 1 addition & 1 deletion Sources/HTTPHeaderParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public struct HTTPHeaderParser {
buffer[1..<buffer.count]
))
// ensure we have <CR><LF> in current buffer
guard let index = (charPairs).index(where: { $0 == HTTPHeaderParser.NEWLINE }) else {
guard let index = (charPairs).firstIndex(where: { $0 == HTTPHeaderParser.NEWLINE }) else {
// no <CR><LF> found, just return the current elements
return elements
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/TCPSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public final class TCPSocket {
}) else {
throw OSError.lastIOError()
}
if let index = address.index(of: 0) {
if let index = address.firstIndex(of: 0) {
address = address.subdata(in: 0 ..< index)
}
return String(data: address, encoding: .utf8)!
Expand Down