Commit 1d9ee8bf authored by Drew's avatar Drew

Update to swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a

parent e3a7a9f4
...@@ -27,7 +27,7 @@ POSSIBILITY OF SUCH DAMAGE.*/ ...@@ -27,7 +27,7 @@ POSSIBILITY OF SUCH DAMAGE.*/
//MARK: Functions //MARK: Functions
extension CarolineTest { extension CarolineTest {
public final func assert(@autoclosure _ condition: () -> Bool, @autoclosure _ message: () -> String = "Test failed", file: String = #file, line: Int = #line) { public final func assert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = "Test failed", file: String = #file, line: Int = #line) {
if !condition() { if !condition() {
var state = CarolineState(test: self) var state = CarolineState(test: self)
state.outcome = .Failed state.outcome = .Failed
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>CarolineCore</string>
<key>CFBundleIdentifier</key>
<string>com.sealedabstract.CarolineCore</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CarolineCore</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Drew Crawford. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
:name "caroline_static_tool" :name "caroline_static_tool"
:sources ["caroline-static-tool/**.swift"] :sources ["caroline-static-tool/**.swift"]
:publish-product true :publish-product true
:link-options ["-static-stdlib"]
} }
:debug { :debug {
:dependencies ["statictool"] :dependencies ["statictool"]
......
...@@ -105,11 +105,11 @@ extension String { ...@@ -105,11 +105,11 @@ extension String {
///The location of the directory for the item. ///The location of the directory for the item.
var directoryPath: String { var directoryPath: String {
var position = self.characters.endIndex var position = self.characters.endIndex
for (x,c) in self.characters.reversed().enumerated() { for c in self.characters.reversed() {
if c == "/" { if c == "/" {
return String(self.characters[self.characters.startIndex..<position]) return String(self.characters[self.characters.startIndex..<position])
} }
position = position.predecessor() position = self.characters.index(before: position)
} }
return self return self
} }
......
...@@ -192,7 +192,7 @@ struct Match : CustomStringConvertible, CustomDebugStringConvertible { ...@@ -192,7 +192,7 @@ struct Match : CustomStringConvertible, CustomDebugStringConvertible {
///The part of the string that matched this expression ///The part of the string that matched this expression
var region: String { var region: String {
let utf8 = self.underlyingString.utf8 let utf8 = self.underlyingString.utf8
return String(utf8[utf8.startIndex.advanced(by: start)..<utf8.startIndex.advanced(by: end)]) return String(utf8[utf8.index(utf8.startIndex, offsetBy: start)..<utf8.index(utf8.startIndex, offsetBy:end)])
} }
private init?(start: Int, end: Int, underlyingString: String) { private init?(start: Int, end: Int, underlyingString: String) {
if start == -1 && end == -1 {return nil} if start == -1 && end == -1 {return nil}
...@@ -234,7 +234,7 @@ class FindResultGenerator: IteratorProtocol { ...@@ -234,7 +234,7 @@ class FindResultGenerator: IteratorProtocol {
internal func next() -> FindResultGenerator.Element? { internal func next() -> FindResultGenerator.Element? {
let startPosition = lastStart + (lastMatch?.end ?? 0) + 1 let startPosition = lastStart + (lastMatch?.end ?? 0) + 1
lastStart = startPosition lastStart = startPosition
let proposedStartIndex = string.utf8.startIndex.advanced(by: startPosition, limit: string.utf8.endIndex) let proposedStartIndex = string.utf8.index(string.utf8.startIndex, offsetBy: startPosition, limitedBy: string.utf8.endIndex)!
let abbreviatedString = String(string.utf8[proposedStartIndex..<string.utf8.endIndex])! let abbreviatedString = String(string.utf8[proposedStartIndex..<string.utf8.endIndex])!
let result = try! regex.findFirst(inString: abbreviatedString) let result = try! regex.findFirst(inString: abbreviatedString)
lastMatch = result?.entireMatch lastMatch = result?.entireMatch
......
...@@ -35,7 +35,7 @@ import Darwin ...@@ -35,7 +35,7 @@ import Darwin
func env_(_ variable: String) -> String? { func env_(_ variable: String) -> String? {
let env = getenv(variable) let env = getenv(variable)
if env == nil { return nil } if env == nil { return nil }
return String(validatingUTF8: env) return String(validatingUTF8: env!)
} }
///Performs XCTest integration ///Performs XCTest integration
...@@ -121,7 +121,7 @@ func parseXcodeProj(_ fileName: String, targetName: String) -> [String] { ...@@ -121,7 +121,7 @@ func parseXcodeProj(_ fileName: String, targetName: String) -> [String] {
guard var path = try! pathRegex.findFirst(inString: file)?.groups[0]?.description else { guard var path = try! pathRegex.findFirst(inString: file)?.groups[0]?.description else {
fatalError("Can't find path for file \(fileRef)") fatalError("Can't find path for file \(fileRef)")
} }
if path.hasSuffix("\"") { path.remove(at: path.characters.endIndex.predecessor())} if path.hasSuffix("\"") { path.remove(at: path.characters.index(before: path.characters.endIndex))}
//this is cheating; the targetName may not be the same as the group, but fuck it //this is cheating; the targetName may not be the same as the group, but fuck it
paths.append("\(pathToXcodeProject)/\(targetName)/\(path)") paths.append("\(pathToXcodeProject)/\(targetName)/\(path)")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment