Переглянути джерело

Ready for XCODE 7.2 beta and Swift 2.

Damian Kołakowski 11 роки тому
батько
коміт
a4f037c8dd

+ 1 - 2
Common/DemoServer.swift

@@ -27,7 +27,7 @@ func demoServer(publicDir: String?) -> HttpServer {
     }
     server["/params/(.+)/(.+)"] = { request in
         var capturedGroups = ""
-        for (index, group) in enumerate(request.capturedUrlGroups) {
+        for (index, group) in request.capturedUrlGroups.enumerate() {
             capturedGroups += "Expression group \(index) : \(group)<br>"
         }
         return .OK(.HTML("Url: \(request.url)<br>Method: \(request.method)<br>\(capturedGroups)"))
@@ -72,7 +72,6 @@ func demoServer(publicDir: String?) -> HttpServer {
     }
     server["/"] = { request in
         var listPage = "Available services:<br><ul>"
-        enumerate(server.routes())
         for item in server.routes() {
             listPage += "<li><a href=\"\(item)\">\(item)</a></li>"
         }

+ 5 - 2
Common/HttpHandlers.swift

@@ -28,11 +28,14 @@ class HttpHandlers {
                 var isDir: ObjCBool = false;
                 if ( fileManager.fileExistsAtPath(filePath, isDirectory: &isDir) ) {
                     if ( isDir ) {
-                        if let files = fileManager.contentsOfDirectoryAtPath(filePath, error: nil) {
+                        do {
+                            let files = try fileManager.contentsOfDirectoryAtPath(filePath)
                             var response = "<h3>\(filePath)</h3></br><table>"
-                            response += join("", map(files, { "<tr><td><a href=\"\(request.url)/\($0)\">\($0)</a></td></tr>"}))
+                            response += "".join(files.map { "<tr><td><a href=\"\(request.url)/\($0)\">\($0)</a></td></tr>"} )
                             response += "</table>"
                             return HttpResponse.OK(.HTML(response))
+                        } catch  {
+                            return HttpResponse.NotFound
                         }
                     } else {
                         if let fileBody = NSData(contentsOfFile: filePath) {

+ 10 - 10
Common/HttpParser.swift

@@ -14,8 +14,8 @@ class HttpParser {
     
     func nextHttpRequest(socket: CInt, error:NSErrorPointer = nil) -> HttpRequest? {
         if let statusLine = nextLine(socket, error: error) {
-            let statusTokens = split(statusLine, isSeparator: { $0 == " " })
-            println(statusTokens)
+            let statusTokens = statusLine.componentsSeparatedByString(" ")
+            print(statusTokens)
             if ( statusTokens.count < 3 ) {
                 if error != nil { error.memory = err("Invalid status line: \(statusLine)") }
                 return nil
@@ -28,8 +28,8 @@ class HttpParser {
                 // TODO detect content-type and handle:
                 // 'application/x-www-form-urlencoded' -> Dictionary
                 // 'multipart' -> Dictionary
-                if let contentSize = headers["content-length"]?.toInt() {
-                    let body = nextBody(socket, size: contentSize, error: error)
+                if let contentLength = headers["content-length"], let contentLengthValue = Int(contentLength) {
+                    let body = nextBody(socket, size: contentLengthValue, error: error)
                     return HttpRequest(url: path, urlParams: urlParams, method: method, headers: headers, body: body, capturedUrlGroups: [], address: nil)
                 }
                 return HttpRequest(url: path, urlParams: urlParams, method: method, headers: headers, body: nil, capturedUrlGroups: [], address: nil)
@@ -39,16 +39,16 @@ class HttpParser {
     }
     
     private func extractUrlParams(url: String) -> [(String, String)] {
-        if let query = split(url, isSeparator: { $0 == "?" }).last {
-            return map(split(query, isSeparator: { $0 == "&" }), { (param:String) -> (String, String) in
-                let tokens = split(param, isSeparator: { $0 == "=" })
+        if let query = url.componentsSeparatedByString("?").last {
+            return query.componentsSeparatedByString("&").map { (param:String) -> (String, String) in
+                let tokens = param.componentsSeparatedByString("=")
                 if tokens.count >= 2 {
                     let key = tokens[0].stringByRemovingPercentEncoding
                     let value = tokens[1].stringByRemovingPercentEncoding
                     if key != nil && value != nil { return (key!, value!) }
                 }
                 return ("","")
-            })
+            }
         }
         return []
     }
@@ -74,7 +74,7 @@ class HttpParser {
             if ( headerLine.isEmpty ) {
                 return headers
             }
-            let headerTokens = split(headerLine, isSeparator: { $0 == ":" })
+            let headerTokens = headerLine.componentsSeparatedByString(":")
             if ( headerTokens.count >= 2 ) {
                 // RFC 2616 - "Hypertext Transfer Protocol -- HTTP/1.1", paragraph 4.2, "Message Headers":
                 // "Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive."
@@ -99,7 +99,7 @@ class HttpParser {
     private func nextLine(socket: CInt, error:NSErrorPointer) -> String? {
         var characters: String = ""
         var n = 0
-        do {
+        repeat {
             n = nextInt8(socket)
             if ( n > 13 /* CR */ ) { characters.append(Character(UnicodeScalar(n))) }
         } while ( n > 0 && n != 10 /* NL */)

+ 10 - 8
Common/HttpResponse.swift

@@ -18,27 +18,29 @@ enum HttpResponseBody {
         switch self {
         case .JSON(let object):
             if NSJSONSerialization.isValidJSONObject(object) {
-                var serializationError: NSError?
-                if let json = NSJSONSerialization.dataWithJSONObject(object, options: NSJSONWritingOptions.PrettyPrinted, error: &serializationError) {
+                do {
+                    let json = try NSJSONSerialization.dataWithJSONObject(object, options: NSJSONWritingOptions.PrettyPrinted)
                     if let nsString = NSString(data: json, encoding: NSUTF8StringEncoding) {
                         return nsString as String
                     }
+                } catch let serializationError as NSError {
+                    return "Serialisation error: \(serializationError)"
                 }
-                return "Serialisation error: \(serializationError)"
             }
             return "Invalid object to serialise."
-        case .XML(let data):
+        case .XML(_):
             return "XML serialization not supported."
         case .PLIST(let object):
             let format = NSPropertyListFormat.XMLFormat_v1_0
             if NSPropertyListSerialization.propertyList(object, isValidForFormat: format) {
-                var serializationError: NSError?
-                if let plist = NSPropertyListSerialization.dataWithPropertyList(object, format: format, options: 0, error: &serializationError) {
-                    if let nsString = NSString(data: plist, encoding: NSUTF8StringEncoding)  {
+                do {
+                    let plist = try NSPropertyListSerialization.dataWithPropertyList(object, format: format, options: 0)
+                    if let nsString = NSString(data: plist, encoding: NSUTF8StringEncoding) {
                         return nsString as String
                     }
+                } catch let serializationError as NSError {
+                    return "Serialisation error: \(serializationError)"
                 }
-                return "Serialisation error: \(serializationError)"
             }
             return "Invalid object to serialise."
         case .RAW(let body):

+ 10 - 7
Common/HttpServer.swift

@@ -15,27 +15,30 @@ class HttpServer
     let clientSocketsLock = 0
     var acceptSocket: CInt = -1
     
-    let matchingOptions = NSMatchingOptions(0)
-    let expressionOptions = NSRegularExpressionOptions(0)
+    let matchingOptions = NSMatchingOptions(rawValue: 0)
+    let expressionOptions = NSRegularExpressionOptions(rawValue: 0)
     
     subscript (path: String) -> Handler? {
         get {
             return nil
         }
         set ( newValue ) {
-            if let regex = NSRegularExpression(pattern: path, options: expressionOptions, error: nil) {
+            do {
+                let regex = try NSRegularExpression(pattern: path, options: expressionOptions)
                 if let newHandler = newValue {
                     handlers.append(expression: regex, handler: newHandler)
                 }
+            } catch {
+                    
             }
         }
     }
     
-    func routes() -> [String] { return map(handlers, { $0.0.pattern }) }
+    func routes() -> [String] { return handlers.map { $0.0.pattern } }
     
     func start(listenPort: in_port_t = 8080, error: NSErrorPointer = nil) -> Bool {
         stop()
-        if let socket = Socket.tcpForListen(port: listenPort, error: error) {
+        if let socket = Socket.tcpForListen(listenPort, error: error) {
             self.acceptSocket = socket
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {
                 while let socket = Socket.acceptClientSocket(self.acceptSocket) {
@@ -71,9 +74,9 @@ class HttpServer
     }
     
     func findHandler(url:String) -> (NSRegularExpression, Handler)? {
-        return filter(self.handlers, {
+        return self.handlers.filter {
             $0.0.numberOfMatchesInString(url, options: self.matchingOptions, range: HttpServer.asciiRange(url)) > 0
-        }).first
+        }.first
     }
     
     func captureExpressionGroups(expression: NSRegularExpression, value: String) -> [String] {

+ 5 - 1
Swifter.xcodeproj/project.pbxproj

@@ -203,7 +203,8 @@
 		7C839B6619422CFF003A6950 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0600;
+				LastSwiftUpdateCheck = 0700;
+				LastUpgradeCheck = 0700;
 				ORGANIZATIONNAME = "Damian Kołakowski";
 				TargetAttributes = {
 					7C839B6D19422CFF003A6950 = {
@@ -314,6 +315,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_OPTIMIZATION_LEVEL = 0;
@@ -382,6 +384,7 @@
 				CLANG_ENABLE_MODULES = YES;
 				INFOPLIST_FILE = Swifter/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				PRODUCT_BUNDLE_IDENTIFIER = "pl.kolakowski..${PRODUCT_NAME:rfc1034identifier}";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -396,6 +399,7 @@
 				CLANG_ENABLE_MODULES = YES;
 				INFOPLIST_FILE = Swifter/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				PRODUCT_BUNDLE_IDENTIFIER = "pl.kolakowski..${PRODUCT_NAME:rfc1034identifier}";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_OBJC_BRIDGING_HEADER = "";
 			};

BIN
Swifter.xcodeproj/project.xcworkspace/xcuserdata/damiankolakowski.xcuserdatad/UserInterfaceState.xcuserstate


+ 43 - 139
Swifter.xcodeproj/xcuserdata/damiankolakowski.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -195,54 +195,6 @@
             landmarkType = "3">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "Common/HttpResponse.swift"
-            timestampString = "445393931.571581"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "40"
-            endingLineNumber = "40"
-            landmarkName = "data()"
-            landmarkType = "5">
-            <Locations>
-               <Location
-                  shouldBeEnabled = "No"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "SwifterOSX.HttpResponseBody.data (SwifterOSX.HttpResponseBody)() -&gt; Swift.Optional&lt;Swift.String&gt;"
-                  moduleName = "SwifterOSX"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/damiankolakowski/Desktop/Swifter/Common/HttpResponse.swift"
-                  timestampString = "430110038.833456"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "35"
-                  endingLineNumber = "35"
-                  offsetFromSymbolStart = "3084">
-               </Location>
-               <Location
-                  shouldBeEnabled = "No"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "SwifterOSX.HttpResponseBody.data (SwifterOSX.HttpResponseBody)() -&gt; Swift.Optional&lt;Swift.String&gt;"
-                  moduleName = "SwifterOSX"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/damiankolakowski/Desktop/Swifter/Common/HttpResponse.swift"
-                  timestampString = "430110038.833645"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "35"
-                  endingLineNumber = "35"
-                  offsetFromSymbolStart = "3643">
-               </Location>
-            </Locations>
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -250,12 +202,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456067822.690759"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "41"
-            endingLineNumber = "41"
-            landmarkName = "start(listenPort:error:)"
+            startingLineNumber = "44"
+            endingLineNumber = "44"
+            landmarkName = "start(_:error:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -266,12 +218,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "48"
-            endingLineNumber = "48"
-            landmarkName = "start(listenPort:error:)"
+            startingLineNumber = "51"
+            endingLineNumber = "51"
+            landmarkName = "start(_:error:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -282,12 +234,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "50"
-            endingLineNumber = "50"
-            landmarkName = "start(listenPort:error:)"
+            startingLineNumber = "53"
+            endingLineNumber = "53"
+            landmarkName = "start(_:error:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -298,12 +250,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "52"
-            endingLineNumber = "52"
-            landmarkName = "start(listenPort:error:)"
+            startingLineNumber = "55"
+            endingLineNumber = "55"
+            landmarkName = "start(_:error:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -314,12 +266,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "56"
-            endingLineNumber = "56"
-            landmarkName = "start(listenPort:error:)"
+            startingLineNumber = "59"
+            endingLineNumber = "59"
+            landmarkName = "start(_:error:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -330,12 +282,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "57"
-            endingLineNumber = "57"
-            landmarkName = "start(listenPort:error:)"
+            startingLineNumber = "60"
+            endingLineNumber = "60"
+            landmarkName = "start(_:error:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -362,11 +314,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "80"
-            endingLineNumber = "80"
+            startingLineNumber = "83"
+            endingLineNumber = "83"
             landmarkName = "captureExpressionGroups(_:value:)"
             landmarkType = "5">
          </BreakpointContent>
@@ -394,12 +346,12 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "53"
-            endingLineNumber = "53"
-            landmarkName = "start(listenPort:error:)"
+            startingLineNumber = "56"
+            endingLineNumber = "56"
+            landmarkName = "start(_:error:)"
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
@@ -451,54 +403,6 @@
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "Common/HttpParser.swift"
-            timestampString = "438134345.357079"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "32"
-            endingLineNumber = "32"
-            landmarkName = "nextHttpRequest(_:error:)"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "Common/HttpParser.swift"
-            timestampString = "438134345.357079"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "33"
-            endingLineNumber = "33"
-            landmarkName = "nextHttpRequest(_:error:)"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "Common/HttpParser.swift"
-            timestampString = "438134345.357079"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "34"
-            endingLineNumber = "34"
-            landmarkName = "nextHttpRequest(_:error:)"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -554,11 +458,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "113"
-            endingLineNumber = "113"
+            startingLineNumber = "116"
+            endingLineNumber = "116"
             landmarkName = "respond(_:response:keepAlive:)"
             landmarkType = "5">
          </BreakpointContent>
@@ -570,11 +474,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpServer.swift"
-            timestampString = "456081779.082475"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "114"
-            endingLineNumber = "114"
+            startingLineNumber = "117"
+            endingLineNumber = "117"
             landmarkName = "respond(_:response:keepAlive:)"
             landmarkType = "5">
          </BreakpointContent>
@@ -634,11 +538,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpHandlers.swift"
-            timestampString = "438295102.201212"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "39"
-            endingLineNumber = "39"
+            startingLineNumber = "42"
+            endingLineNumber = "42"
             landmarkName = "directoryBrowser(_:)"
             landmarkType = "5">
          </BreakpointContent>
@@ -650,11 +554,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "Common/HttpHandlers.swift"
-            timestampString = "438295103.268347"
+            timestampString = "456827105.421335"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "40"
-            endingLineNumber = "40"
+            startingLineNumber = "43"
+            endingLineNumber = "43"
             landmarkName = "directoryBrowser(_:)"
             landmarkType = "5">
          </BreakpointContent>

+ 8 - 3
Swifter.xcodeproj/xcuserdata/damiankolakowski.xcuserdatad/xcschemes/Swifter.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0600"
+   LastUpgradeVersion = "0700"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -72,6 +72,8 @@
             ReferencedContainer = "container:Swifter.xcodeproj">
          </BuildableReference>
       </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
    </TestAction>
    <LaunchAction
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
@@ -81,8 +83,10 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
       allowLocationSimulation = "YES">
-      <BuildableProductRunnable>
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "7C839B6D19422CFF003A6950"
@@ -100,7 +104,8 @@
       useCustomWorkingDirectory = "NO"
       buildConfiguration = "Release"
       debugDocumentVersioning = "YES">
-      <BuildableProductRunnable>
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "7C839B6D19422CFF003A6950"

+ 8 - 3
Swifter.xcodeproj/xcuserdata/damiankolakowski.xcuserdatad/xcschemes/SwifterOSX.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0600"
+   LastUpgradeVersion = "0700"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -38,6 +38,8 @@
             ReferencedContainer = "container:Swifter.xcodeproj">
          </BuildableReference>
       </MacroExpansion>
+      <AdditionalOptions>
+      </AdditionalOptions>
    </TestAction>
    <LaunchAction
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
@@ -47,8 +49,10 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
       allowLocationSimulation = "YES">
-      <BuildableProductRunnable>
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "7CA4813A19A2EA8D0030B30D"
@@ -66,7 +70,8 @@
       useCustomWorkingDirectory = "NO"
       buildConfiguration = "Release"
       debugDocumentVersioning = "YES">
-      <BuildableProductRunnable>
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "7CA4813A19A2EA8D0030B30D"

+ 1 - 1
Swifter/Info.plist

@@ -7,7 +7,7 @@
 	<key>CFBundleExecutable</key>
 	<string>${EXECUTABLE_NAME}</string>
 	<key>CFBundleIdentifier</key>
-	<string>pl.kolakowski..${PRODUCT_NAME:rfc1034identifier}</string>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>

+ 3 - 3
SwifterOSX/main.swift

@@ -10,10 +10,10 @@ import Foundation
 var error: NSError?
 let server = demoServer(NSBundle.mainBundle().resourcePath)
 
-if !server.start(listenPort: 9080, error: &error) {
-    println("Server start error: \(error)")
+if !server.start(9080, error: &error) {
+    print("Server start error: \(error)")
 } else {
-    println("Server started. Try a connection now...")
+    print("Server started. Try a connection now...")
     while ( true ) { };
 }