 
 let dirs = ["swift", "swift/macosx/x86_64"]
 for dir in dirs {
-    mkdir(NSURL(fileURLWithPath: builtProductsDir).URLByAppendingPathComponent(dir).path!)
+    mkdir(URL(fileURLWithPath: builtProductsDir).appendingPathComponent(dir).path)
 }
 
 let frameworkPath: String
-switch dict["CONFIGURATION"]!.lowercaseString {
+switch dict["CONFIGURATION"]!.lowercased() {
 case "debug":
 	frameworkPath = "/build/Ninja-DebugAssert/swift-macosx-x86_64/lib"
 case "release":

    fatalError("Unsupported build configuration")
}

func from(path: String) -> String {
	return NSURL(fileURLWithPath: srcRoot).URLByAppendingPathComponent(frameworkPath).URLByAppendingPathComponent(path).path!
}
print("Copying debug files")
for path in files {
	copy(from(path), to: NSURL(fileURLWithPath: builtProductsDir).URLByAppendingPathComponent(path).path!)
}
for path in paths {
	copy(from(path.from), to: NSURL(fileURLWithPath: builtProductsDir).URLByAppendingPathComponent(path.to).path!)
}

    }
}

func mkdir(_ path: String) {
    let task = Task()
    task.launchPath = "/bin/mkdir"
    task.arguments = ["-p", path]
    task.launch()
