                 if let url = findProjectDirectory(at: parent.path) {
                     return url
                 }
+                _projectDirectory = url
                 return url
             }
         }
         return findProjectDirectory(at: parent.path)
     }
 
-    private func findSourceURL(forRelativePath path: String, in directory: URL) -> URL? {
+    private func findSourceURL(forRelativePath path: String, in directory: URL, usingCache: Bool = true) -> URL? {
+        if let url = _sourceURLCache[path], FileManager.default.fileExists(atPath: url.path) {
+            return url
+        }
         guard let files = try? FileManager.default.contentsOfDirectory(atPath: directory.path) else {
             return nil
         }

        }
        return [:]
    }

    #if arch(i386) || arch(x86_64)

    // MARK: Only applicable when running in the simulator

    private func findProjectDirectory(at path: String) -> URL? {
        var url = URL(fileURLWithPath: path)
        if !url.pathExtension.isEmpty {
            url = url.deletingLastPathComponent()

            let directory = directory.appendingPathComponent(file)
            if file == parts[0] {
                if parts.count == 1 {
                    if usingCache {
                        _sourceURLCache[path] = directory
                    }
                    return directory // Not actually a directory
                }
                if let result = findSourceURL(
                    forRelativePath: parts.dropFirst().joined(separator: "/"),
                    in: directory,
                    usingCache: false
                ) {
                    if usingCache {
                        _sourceURLCache[path] = result
                    }
                    return result
                }
            }
            if let result = findSourceURL(
                forRelativePath: path,
                in: directory,
                usingCache: false
            ) {
                if usingCache {
                    _sourceURLCache[path] = result
                }
                return result
            }
        }
        return nil
    }

#else

    private func findProjectDirectory(at path: String) -> URL? { return nil }
    private func findSourceURL(forRelativePath path: String, in directory: URL) -> URL? { return nil }
    
#endif
