diff --git a/Sources/Generator/Processing/FileGenerator.swift b/Sources/Generator/Processing/FileGenerator.swift index 3546460..66fbb9b 100644 --- a/Sources/Generator/Processing/FileGenerator.swift +++ b/Sources/Generator/Processing/FileGenerator.swift @@ -61,26 +61,6 @@ final class FileGenerator { print("") } - func writeResultsToFile(file: URL) throws { - var lines: [String] = [] - func add(_ name: String, _ property: S, convert: (S.Element) -> String) where S: Sequence { - let elements = property.map { " " + convert($0) }.sorted() - guard !elements.isEmpty else { - return - } - lines.append("\(name):") - lines.append(contentsOf: elements) - } - add("Missing files", missingFiles) { "\($0.key) (required by \($0.value))" } - add("Unreadable files", unreadableFiles) { "\($0.key) (required by \($0.value.source)): \($0.value.message)" } - add("Unreadable files", unreadableFiles) { "\($0.key) (required by \($0.value.source)): \($0.value.message)" } - add("Unwritable files", unwritableFiles) { "\($0.key) (required by \($0.value.source)): \($0.value.message)" } - add("External files", files.external) { "\($0.key) (from \($0.value))" } - - let data = lines.joined(separator: "\n").data(using: .utf8)! - try data.createFolderAndWrite(to: file) - } - private func didCopyFile() { numberOfCopiedFiles += 1 print(" Copied files: \(numberOfCopiedFiles)/\(numberOfFilesToCopy) \r", terminator: "") diff --git a/Sources/Generator/run.swift b/Sources/Generator/run.swift index 3104578..f413496 100644 --- a/Sources/Generator/run.swift +++ b/Sources/Generator/run.swift @@ -113,6 +113,8 @@ private func copyFiles(files: FileData, configuration: Configuration, runFolder: runFolder: runFolder, files: files) generator.generate() + let file = runFolder.appendingPathComponent("files.txt") + generator.writeResults(to: file) } private func finish(start: Date, complete: Bool) {