Skip to content

Commit

Permalink
Extended definition for older swift
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrzej Michnia committed May 3, 2018
1 parent 5505d8d commit 5ea3d55
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 48 deletions.
16 changes: 2 additions & 14 deletions Mocky.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand All @@ -1482,7 +1481,6 @@
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand All @@ -1508,7 +1506,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_tvOS.app/Mocky_Example_tvOS";
TVOS_DEPLOYMENT_TARGET = 11.0;
Expand All @@ -1533,7 +1530,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_tvOS.app/Mocky_Example_tvOS";
TVOS_DEPLOYMENT_TARGET = 11.0;
Expand Down Expand Up @@ -1592,6 +1588,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1639,6 +1636,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -1657,7 +1655,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -1675,7 +1672,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -1700,7 +1696,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_iOS.app/Mocky_Example_iOS";
};
name = Debug;
Expand All @@ -1722,7 +1717,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_iOS.app/Mocky_Example_iOS";
};
name = Release;
Expand Down Expand Up @@ -1753,7 +1747,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1781,7 +1774,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down Expand Up @@ -1809,7 +1801,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_macOS.app/Contents/MacOS/Mocky_Example_macOS";
};
name = Debug;
Expand All @@ -1836,7 +1827,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.cocoapods.org.demo.Mocky-Example-macOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_macOS.app/Contents/MacOS/Mocky_Example_macOS";
};
name = Release;
Expand Down Expand Up @@ -1877,7 +1867,6 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1918,7 +1907,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.swiftymocky.SwiftyMocky;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ SPEC CHECKSUMS:
Sourcery: d78d3b68aa565a7194e57ccd6995c1368fda9cb0
SwiftyMocky: 184fc088388e0e59cf0c0cd9288c4db885a340a1

PODFILE CHECKSUM: 71c85b79b35b28e80d11a137d918ed3d63d9e119
PODFILE CHECKSUM: 06778e14f0a1d260b889612657d3594731029e26

COCOAPODS: 1.5.0
68 changes: 35 additions & 33 deletions Sources/Classes/Matcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,38 +121,38 @@ public class Matcher {
register(UInt64?.self)
register(Data?.self)
#else
register([Bool].self) { $0 == $1 }
register([String].self) { $0 == $1 }
register([Float].self) { $0 == $1 }
register([Double].self) { $0 == $1 }
register([Character].self) { $0 == $1 }
register([Int].self) { $0 == $1 }
register([Int8].self) { $0 == $1 }
register([Int16].self) { $0 == $1 }
register([Int32].self) { $0 == $1 }
register([Int64].self) { $0 == $1 }
register([UInt].self) { $0 == $1 }
register([UInt8].self) { $0 == $1 }
register([UInt16].self) { $0 == $1 }
register([UInt32].self) { $0 == $1 }
register([UInt64].self) { $0 == $1 }
register([Data].self) { $0 == $1 }
register([Bool?].self) { $0 == $1 }
register([String?].self) { $0 == $1 }
register([Float?].self) { $0 == $1 }
register([Double?].self) { $0 == $1 }
register([Character?].self) { $0 == $1 }
register([Int?].self) { $0 == $1 }
register([Int8?].self) { $0 == $1 }
register([Int16?].self) { $0 == $1 }
register([Int32?].self) { $0 == $1 }
register([Int64?].self) { $0 == $1 }
register([UInt?].self) { $0 == $1 }
register([UInt8?].self) { $0 == $1 }
register([UInt16?].self) { $0 == $1 }
register([UInt32?].self) { $0 == $1 }
register([UInt64?].self) { $0 == $1 }
register([Data?].self) { $0 == $1 }
register([Bool].self) { (a: Bool, b: Bool) in return a == b }
register([String].self) { (a: String, b: String) in return a == b }
register([Float].self) { (a: Float, b: Float) in return a == b }
register([Double].self) { (a: Double, b: Double) in return a == b }
register([Character].self) { (a: Character, b: Character) in return a == b }
register([Int].self) { (a: Int, b: Int) in return a == b }
register([Int8].self) { (a: Int8, b: Int8) in return a == b }
register([Int16].self) { (a: Int16, b: Int16) in return a == b }
register([Int32].self) { (a: Int32, b: Int32) in return a == b }
register([Int64].self) { (a: Int64, b: Int64) in return a == b }
register([UInt].self) { (a: UInt, b: UInt) in return a == b }
register([UInt8].self) { (a: UInt8, b: UInt8) in return a == b }
register([UInt16].self) { (a: UInt16, b: UInt16) in return a == b }
register([UInt32].self) { (a: UInt32, b: UInt32) in return a == b }
register([UInt64].self) { (a: UInt64, b: UInt64) in return a == b }
register([Data].self) { (a: Data, b: Data) in return a == b }
register([Bool?].self) { (a: Bool?, b: Bool?) in return a == b }
register([String?].self) { (a: String?, b: String?) in return a == b }
register([Float?].self) { (a: Float?, b: Float?) in return a == b }
register([Double?].self) { (a: Double?, b: Double?) in return a == b }
register([Character?].self) { (a: Character?, b: Character?) in return a == b }
register([Int?].self) { (a: Int?, b: Int?) in return a == b }
register([Int8?].self) { (a: Int8?, b: Int8?) in return a == b }
register([Int16?].self) { (a: Int16?, b: Int16?) in return a == b }
register([Int32?].self) { (a: Int32?, b: Int32?) in return a == b }
register([Int64?].self) { (a: Int64?, b: Int64?) in return a == b }
register([UInt?].self) { (a: UInt?, b: UInt?) in return a == b }
register([UInt8?].self) { (a: UInt8?, b: UInt8?) in return a == b }
register([UInt16?].self) { (a: UInt16?, b: UInt16?) in return a == b }
register([UInt32?].self) { (a: UInt32?, b: UInt32?) in return a == b }
register([UInt64?].self) { (a: UInt64?, b: UInt64?) in return a == b }
register([Data?].self) { (a: Data?, b: Data?) in return a == b }
#endif

// Types
Expand Down Expand Up @@ -214,7 +214,9 @@ public class Matcher {
self.register(valueType, match: { _, _ in return true })
}

#if swift(>=3.2)
#if swift(>=4.1)
// Use equatable
#elseif swift(>=3.2)
/// Register sequence comparator, based on elements comparing.
///
/// - Parameters:
Expand Down

0 comments on commit 5ea3d55

Please sign in to comment.