From 92190d0a40e65d7f222665d3b519fd597542efa9 Mon Sep 17 00:00:00 2001 From: looseyi <13615033587@126.com> Date: Fri, 30 Mar 2018 16:35:29 +0800 Subject: [PATCH 1/2] update support iOS version to iOS 8.0; remove characters on Swift4 --- PySwiftyRegex.xcodeproj/project.pbxproj | 6 ++-- PySwiftyRegex/PySwiftyRegex.swift | 3 +- PySwiftyRegexTests/ReRegexObjectTests.swift | 34 ++++++++++----------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/PySwiftyRegex.xcodeproj/project.pbxproj b/PySwiftyRegex.xcodeproj/project.pbxproj index c9bf6c2..751f740 100644 --- a/PySwiftyRegex.xcodeproj/project.pbxproj +++ b/PySwiftyRegex.xcodeproj/project.pbxproj @@ -280,7 +280,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = PySwiftyRegex/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = me.cezheng.PySwiftyRegex; @@ -333,7 +334,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = PySwiftyRegex/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = me.cezheng.PySwiftyRegex; PRODUCT_NAME = "$(PROJECT_NAME)"; diff --git a/PySwiftyRegex/PySwiftyRegex.swift b/PySwiftyRegex/PySwiftyRegex.swift index 6892c38..67dcb60 100644 --- a/PySwiftyRegex/PySwiftyRegex.swift +++ b/PySwiftyRegex/PySwiftyRegex.swift @@ -270,8 +270,7 @@ public class re { guard let result = result, result.range.length > 0 else { return } - - end = string.characters.index(string.startIndex, offsetBy: result.range.location) + end = string.index(string.startIndex, offsetBy: result.range.location) results.append(String(string[start.. 0 { results += MatchObject(string: string, match: result).groups() diff --git a/PySwiftyRegexTests/ReRegexObjectTests.swift b/PySwiftyRegexTests/ReRegexObjectTests.swift index 65f18d7..fa6949f 100644 --- a/PySwiftyRegexTests/ReRegexObjectTests.swift +++ b/PySwiftyRegexTests/ReRegexObjectTests.swift @@ -33,9 +33,9 @@ class ReRegexObjectTests: XCTestCase { XCTAssertEqual(match.group()!, "this one is different from that") XCTAssertEqual(match.group(1)!, "this") XCTAssertEqual(match.group(2)!, "that") - XCTAssertEqual(match.span()!, string.startIndex.. Date: Wed, 15 Aug 2018 11:40:57 +0800 Subject: [PATCH 2/2] update project mach-o type static library --- PySwiftyRegex.xcodeproj/project.pbxproj | 6 ++++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 PySwiftyRegex.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/PySwiftyRegex.xcodeproj/project.pbxproj b/PySwiftyRegex.xcodeproj/project.pbxproj index 751f740..dcb55b6 100644 --- a/PySwiftyRegex.xcodeproj/project.pbxproj +++ b/PySwiftyRegex.xcodeproj/project.pbxproj @@ -281,6 +281,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = PySwiftyRegex/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -335,6 +336,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = PySwiftyRegex/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = me.cezheng.PySwiftyRegex; @@ -359,7 +361,7 @@ GCC_GENERATE_TEST_COVERAGE_FILES = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = mh_dylib; + MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.9; SKIP_INSTALL = YES; SWIFT_VERSION = 4.0; @@ -378,7 +380,7 @@ GCC_GENERATE_TEST_COVERAGE_FILES = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = mh_dylib; + MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.9; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/PySwiftyRegex.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/PySwiftyRegex.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/PySwiftyRegex.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + +