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.*/
//MARK: Functions
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() {
var state = CarolineState(test: self)
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 @@
:name "caroline_static_tool"
:sources ["caroline-static-tool/**.swift"]
:publish-product true
:link-options ["-static-stdlib"]
}
:debug {
:dependencies ["statictool"]
......
......@@ -105,11 +105,11 @@ extension String {
///The location of the directory for the item.
var directoryPath: String {
var position = self.characters.endIndex
for (x,c) in self.characters.reversed().enumerated() {
for c in self.characters.reversed() {
if c == "/" {
return String(self.characters[self.characters.startIndex..<position])
}
position = position.predecessor()
position = self.characters.index(before: position)
}
return self
}
......
......@@ -192,7 +192,7 @@ struct Match : CustomStringConvertible, CustomDebugStringConvertible {
///The part of the string that matched this expression
var region: String {
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) {
if start == -1 && end == -1 {return nil}
......@@ -234,7 +234,7 @@ class FindResultGenerator: IteratorProtocol {
internal func next() -> FindResultGenerator.Element? {
let startPosition = lastStart + (lastMatch?.end ?? 0) + 1
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 result = try! regex.findFirst(inString: abbreviatedString)
lastMatch = result?.entireMatch
......
......@@ -35,7 +35,7 @@ import Darwin
func env_(_ variable: String) -> String? {
let env = getenv(variable)
if env == nil { return nil }
return String(validatingUTF8: env)
return String(validatingUTF8: env!)
}
///Performs XCTest integration
......@@ -121,7 +121,7 @@ func parseXcodeProj(_ fileName: String, targetName: String) -> [String] {
guard var path = try! pathRegex.findFirst(inString: file)?.groups[0]?.description else {
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
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