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

Changes podspec version to 10.10, converts to Swift 5 #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions Sources/XMLParsing/Decoder/DecodingErrorExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal extension DecodingError {
/// - parameter expectation: The type expected to be encountered.
/// - parameter reality: The value that was encountered instead of the expected type.
/// - returns: A `DecodingError` with the appropriate path and debug description.
internal static func _typeMismatch(at path: [CodingKey], expectation: Any.Type, reality: Any) -> DecodingError {
static func _typeMismatch(at path: [CodingKey], expectation: Any.Type, reality: Any) -> DecodingError {
let description = "Expected to decode \(expectation) but found \(_typeDescription(of: reality)) instead."
return .typeMismatch(expectation, Context(codingPath: path, debugDescription: description))
}
Expand All @@ -29,7 +29,7 @@ internal extension DecodingError {
/// - parameter value: The value whose type to describe.
/// - returns: A string describing `value`.
/// - precondition: `value` is one of the types below.
internal static func _typeDescription(of value: Any) -> String {
static func _typeDescription(of value: Any) -> String {
if value is NSNull {
return "a null value"
} else if value is NSNumber /* FIXME: If swift-corelibs-foundation isn't updated to use NSNumber, this check will be necessary: || value is Int || value is Double */ {
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMLParsing/Decoder/XMLDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ open class XMLDecoder {
guard !stringKey.isEmpty else { return stringKey }

// Find the first non-underscore character
guard let firstNonUnderscore = stringKey.index(where: { $0 != "_" }) else {
guard let firstNonUnderscore = stringKey.firstIndex(where: { $0 != "_" }) else {
// Reached the end without finding an _
return stringKey
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMLParsing/Encoder/EncodingErrorExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal extension EncodingError {
/// - parameter value: The value that was invalid to encode.
/// - parameter path: The path of `CodingKey`s taken to encode this value.
/// - returns: An `EncodingError` with the appropriate path and debug description.
internal static func _invalidFloatingPointValue<T : FloatingPoint>(_ value: T, at codingPath: [CodingKey]) -> EncodingError {
static func _invalidFloatingPointValue<T : FloatingPoint>(_ value: T, at codingPath: [CodingKey]) -> EncodingError {
let valueDescription: String
if value == T.infinity {
valueDescription = "\(T.self).infinity"
Expand Down
2 changes: 1 addition & 1 deletion XMLParsing.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pod::Spec.new do |s|
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Shawn Moore" => "[email protected]" }
s.ios.deployment_target = "10.0"
s.osx.deployment_target = "10.12"
s.osx.deployment_target = "10.10"
s.source = { :git => "https://github.com/ShawnMoore/XMLParsing.git", :tag => s.version.to_s }
s.source_files = "Sources/XMLParsing/**/*.swift"
s.requires_arc = true
Expand Down
20 changes: 11 additions & 9 deletions XMLParsing.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
name = Products;
sourceTree = BUILT_PRODUCTS_DIR;
};
OBJ_5 /* */ = {
OBJ_5 = {
isa = PBXGroup;
children = (
OBJ_6 /* Package.swift */,
Expand All @@ -140,7 +140,6 @@
OBJ_26 /* Sample XML */,
OBJ_27 /* Products */,
);
name = "";
sourceTree = "<group>";
};
OBJ_7 /* Sources */ = {
Expand Down Expand Up @@ -235,10 +234,10 @@
LastUpgradeCheck = 9999;
TargetAttributes = {
"XMLParsing::XMLParsing" = {
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
"XMLParsing::XMLParsingTests" = {
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
};
};
Expand All @@ -247,9 +246,10 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = OBJ_5 /* */;
mainGroup = OBJ_5;
productRefGroup = OBJ_27 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -367,7 +367,7 @@
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGET_NAME = XMLParsingTests;
};
name = Debug;
Expand All @@ -385,7 +385,7 @@
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGET_NAME = XMLParsingTests;
};
name = Release;
Expand Down Expand Up @@ -421,13 +421,14 @@
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = XMLParsing.xcodeproj/XMLParsing_Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
MACOSX_DEPLOYMENT_TARGET = 10.10;
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = XMLParsing;
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGET_NAME = XMLParsing;
};
name = Debug;
Expand All @@ -443,13 +444,14 @@
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = XMLParsing.xcodeproj/XMLParsing_Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
MACOSX_DEPLOYMENT_TARGET = 10.10;
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = XMLParsing;
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGET_NAME = XMLParsing;
};
name = Release;
Expand Down