in Sources/Mockolo/Executor.swift [168:217]
mutating func run() throws {
let shouldOutputRunStatusMessages: Bool = loggingLevel < 3
if shouldOutputRunStatusMessages {
print("Start...")
}
defer {
if shouldOutputRunStatusMessages {
print("Done.")
}
}
let outputFilePath = fullPath(self.outputFilePath)
var mockFilePaths: [String]?
// First see if a list of mock files are stored in a file
if let mockList = self.mockFileList {
let text = try? String(contentsOfFile: mockList, encoding: String.Encoding.utf8)
mockFilePaths = text?.components(separatedBy: "\n").filter{!$0.isEmpty}.map(fullPath)
} else {
// If not, see if a list of mock files are directly passed in
mockFilePaths = self.mockFilePaths.map(fullPath)
}
do {
try generate(sourceDirs: srcDirs,
sourceFiles: srcs,
parser: SourceParser(),
exclusionSuffixes: exclusionSuffixes,
mockFilePaths: mockFilePaths,
annotation: annotation,
header: header,
macro: macro,
declType: mockAll ? .all : .protocolType,
useTemplateFunc: useTemplateFunc,
allowSetCallCount: allowSetCallCount,
enableFuncArgsHistory: enableArgsHistory,
disableCombineDefaultValues: disableCombineDefaultValues,
mockFinal: mockFinal,
testableImports: testableImports,
customImports: customImports,
excludeImports: excludeImports,
to: outputFilePath,
loggingLevel: loggingLevel,
concurrencyLimit: concurrencyLimit)
log("Done. Exiting program.", level: .info)
} catch {
fatalError("Generation error: \(error)")
}
}