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

adapt swift 3 #5

Merged
merged 1 commit into from
Apr 20, 2017
Merged
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: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ playground.xcworkspace
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Checkouts

Carthage/Build

Expand All @@ -61,3 +61,5 @@ Carthage/Build

fastlane/report.xml
fastlane/screenshots

.DS_Store
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "Carthage/Checkouts/Nimble"]
path = Carthage/Checkouts/Nimble
url = https://github.com/Quick/Nimble.git
[submodule "Carthage/Checkouts/Quick"]
path = Carthage/Checkouts/Quick
url = https://github.com/Quick/Quick.git
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Quick/Nimble" "v3.1.0"
github "Quick/Quick" "v0.9.1"
github "Quick/Nimble" "v6.1.0"
github "Quick/Quick" "v1.1.0"
1 change: 0 additions & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble deleted from 72878d
1 change: 0 additions & 1 deletion Carthage/Checkouts/Quick
Submodule Quick deleted from 2f0375
69 changes: 0 additions & 69 deletions MyPlayground.playground/Contents.swift

This file was deleted.

4 changes: 0 additions & 4 deletions MyPlayground.playground/contents.xcplayground

This file was deleted.

59 changes: 27 additions & 32 deletions SemanticVersion.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@

/* Begin PBXBuildFile section */
0D3425EB1C8C6C5900D32DE1 /* SemanticVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D3425EA1C8C6C5900D32DE1 /* SemanticVersion.h */; settings = {ATTRIBUTES = (Public, ); }; };
0D3425F21C8C6C5900D32DE1 /* SemanticVersion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D3425E71C8C6C5900D32DE1 /* SemanticVersion.framework */; };
0D3425F71C8C6C5900D32DE1 /* SemanticVersionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D3425F61C8C6C5900D32DE1 /* SemanticVersionTests.swift */; };
0D3426171C8C703800D32DE1 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D3426161C8C703800D32DE1 /* Nimble.framework */; };
0D3426191C8C704400D32DE1 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D3426181C8C704400D32DE1 /* Quick.framework */; };
0D34261B1C8C719900D32DE1 /* SemanticVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D34261A1C8C719900D32DE1 /* SemanticVersion.swift */; };
0D34261E1C8C880300D32DE1 /* Regexp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D34261D1C8C880300D32DE1 /* Regexp.swift */; };
0D3426201C8C8B9400D32DE1 /* RegexpTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D34261F1C8C8B9400D32DE1 /* RegexpTests.swift */; };
0D3426211C8C8C1F00D32DE1 /* Regexp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D34261D1C8C880300D32DE1 /* Regexp.swift */; };
0DCEEC7D1C9409F000504CDE /* SemanticVersionParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DCEEC7C1C9409F000504CDE /* SemanticVersionParser.swift */; };
0DCEEC7F1C940CC900504CDE /* SemanticVersionParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DCEEC7E1C940CC900504CDE /* SemanticVersionParserTests.swift */; };
0DCEEC811C940F7800504CDE /* SemanticVersionParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DCEEC7C1C9409F000504CDE /* SemanticVersionParser.swift */; };
4F78DD461EA8E61E005C3573 /* Regexp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D34261D1C8C880300D32DE1 /* Regexp.swift */; };
4F78DD471EA8E621005C3573 /* SemanticVersionParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DCEEC7C1C9409F000504CDE /* SemanticVersionParser.swift */; };
4F78DD481EA8E627005C3573 /* SemanticVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D34261A1C8C719900D32DE1 /* SemanticVersion.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -32,20 +30,17 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
0D3425E71C8C6C5900D32DE1 /* SemanticVersion.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SemanticVersion.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0D3425EA1C8C6C5900D32DE1 /* SemanticVersion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SemanticVersion.h; sourceTree = "<group>"; };
0D3425EC1C8C6C5900D32DE1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0D3425F11C8C6C5900D32DE1 /* SemanticVersionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SemanticVersionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
0D3425F61C8C6C5900D32DE1 /* SemanticVersionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SemanticVersionTests.swift; sourceTree = "<group>"; };
0D3425F81C8C6C5900D32DE1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0D3426161C8C703800D32DE1 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = "Carthage/Checkouts/Nimble/build/Debug-iphoneos/Nimble.framework"; sourceTree = "<group>"; };
0D3426181C8C704400D32DE1 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = "Carthage/Checkouts/Quick/build/Debug-iphoneos/Quick.framework"; sourceTree = "<group>"; };
0D34261A1C8C719900D32DE1 /* SemanticVersion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SemanticVersion.swift; sourceTree = "<group>"; };
0D34261D1C8C880300D32DE1 /* Regexp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Regexp.swift; sourceTree = "<group>"; };
0D34261F1C8C8B9400D32DE1 /* RegexpTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegexpTests.swift; sourceTree = "<group>"; };
0DCA81941CA640490076F9EB /* MyPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = MyPlayground.playground; sourceTree = "<group>"; };
0DCEEC7C1C9409F000504CDE /* SemanticVersionParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SemanticVersionParser.swift; sourceTree = "<group>"; };
0DCEEC7E1C940CC900504CDE /* SemanticVersionParserTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SemanticVersionParserTests.swift; sourceTree = "<group>"; };
4FB43BFE1EA8E860003AFA4E /* SemanticVersion.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SemanticVersion.framework; path = "/Users/atsushi.sakai/Workspace/SemanticVersion/build/Debug-iphoneos/SemanticVersion.framework"; sourceTree = "<absolute>"; };
4FB43BFF1EA8E860003AFA4E /* SemanticVersionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = SemanticVersionTests.xctest; path = "/Users/atsushi.sakai/Workspace/SemanticVersion/build/Debug-iphoneos/SemanticVersionTests.xctest"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -60,9 +55,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0D3426191C8C704400D32DE1 /* Quick.framework in Frameworks */,
0D3426171C8C703800D32DE1 /* Nimble.framework in Frameworks */,
0D3425F21C8C6C5900D32DE1 /* SemanticVersion.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -72,24 +64,11 @@
0D3425DD1C8C6C5900D32DE1 = {
isa = PBXGroup;
children = (
0DCA81941CA640490076F9EB /* MyPlayground.playground */,
0D3426181C8C704400D32DE1 /* Quick.framework */,
0D3426161C8C703800D32DE1 /* Nimble.framework */,
0D3425E91C8C6C5900D32DE1 /* SemanticVersion */,
0D3425F51C8C6C5900D32DE1 /* SemanticVersionTests */,
0D3425E81C8C6C5900D32DE1 /* Products */,
);
sourceTree = "<group>";
};
0D3425E81C8C6C5900D32DE1 /* Products */ = {
isa = PBXGroup;
children = (
0D3425E71C8C6C5900D32DE1 /* SemanticVersion.framework */,
0D3425F11C8C6C5900D32DE1 /* SemanticVersionTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
0D3425E91C8C6C5900D32DE1 /* SemanticVersion */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -150,7 +129,7 @@
);
name = SemanticVersion;
productName = SemanticVersion;
productReference = 0D3425E71C8C6C5900D32DE1 /* SemanticVersion.framework */;
productReference = 4FB43BFE1EA8E860003AFA4E /* SemanticVersion.framework */;
productType = "com.apple.product-type.framework";
};
0D3425F01C8C6C5900D32DE1 /* SemanticVersionTests */ = {
Expand All @@ -168,7 +147,7 @@
);
name = SemanticVersionTests;
productName = SemanticVersionTests;
productReference = 0D3425F11C8C6C5900D32DE1 /* SemanticVersionTests.xctest */;
productReference = 4FB43BFF1EA8E860003AFA4E /* SemanticVersionTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
Expand All @@ -178,14 +157,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = "Atsushi Sakai";
TargetAttributes = {
0D3425E61C8C6C5900D32DE1 = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0830;
};
0D3425F01C8C6C5900D32DE1 = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0830;
};
};
};
Expand All @@ -197,7 +178,7 @@
en,
);
mainGroup = 0D3425DD1C8C6C5900D32DE1;
productRefGroup = 0D3425E81C8C6C5900D32DE1 /* Products */;
productRefGroup = 0D3425DD1C8C6C5900D32DE1;
projectDirPath = "";
projectRoot = "";
targets = (
Expand Down Expand Up @@ -239,11 +220,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4F78DD481EA8E627005C3573 /* SemanticVersion.swift in Sources */,
0D3426201C8C8B9400D32DE1 /* RegexpTests.swift in Sources */,
0DCEEC811C940F7800504CDE /* SemanticVersionParser.swift in Sources */,
4F78DD471EA8E621005C3573 /* SemanticVersionParser.swift in Sources */,
0D3425F71C8C6C5900D32DE1 /* SemanticVersionTests.swift in Sources */,
4F78DD461EA8E61E005C3573 /* Regexp.swift in Sources */,
0DCEEC7F1C940CC900504CDE /* SemanticVersionParserTests.swift in Sources */,
0D3426211C8C8C1F00D32DE1 /* Regexp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -271,8 +253,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 @@ -300,6 +284,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -319,8 +304,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 @@ -340,6 +327,8 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -351,6 +340,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 @@ -362,13 +352,15 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
0D3425FD1C8C6C5900D32DE1 /* 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 @@ -379,6 +371,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.radioboo.SemanticVersion;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -394,6 +387,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.radioboo.SemanticVersionTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -409,6 +403,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.radioboo.SemanticVersionTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
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 = "0720"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
18 changes: 9 additions & 9 deletions SemanticVersion/Regexp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Regexp.swift
// SemanticVersion
//
// Created by 酒井篤 on 2016/03/07.
// Created by atsushi.sakai on 2016/03/07.
// Copyright © 2016年 Atsushi Sakai. All rights reserved.
//

Expand All @@ -24,30 +24,30 @@ class Regexp {
}
}

func isMatch(input: String) -> Bool {
func isMatch(_ input: String) -> Bool {
let inputAsNSString = input as NSString
let matches = self.internalRegexp.matchesInString(
input,
let matches = self.internalRegexp.matches(
in: input,
options: [],
range:NSMakeRange(0, inputAsNSString.length)
)
return matches.count > 0
}

func matches(input: String) -> [String]? {
func matches(_ input: String) -> [String]? {
if self.isMatch(input) {
let inputAsNSString = input as NSString
let matches = self.internalRegexp.matchesInString(
input,
let matches = self.internalRegexp.matches(
in: input,
options: [],
range:NSMakeRange(0, inputAsNSString.length)
)
var results: [String] = []
for i in 0 ..< matches.count {
results.append( inputAsNSString.substringWithRange(matches[i].range) )
results.append( inputAsNSString.substring(with: matches[i].range) )
}
return results
}
return nil
}
}
}
2 changes: 1 addition & 1 deletion SemanticVersion/SemanticVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SemanticVersion.h
// SemanticVersion
//
// Created by 酒井篤 on 2016/03/06.
// Created by atsushi.sakai on 2016/03/06.
// Copyright © 2016年 Atsushi Sakai. All rights reserved.
//

Expand Down
Loading