Skip to content

FileUtils

rockbruno edited this page May 9, 2020 · 1 revision

FileUtils

Wraps utilities for opening and saving files needed by SwiftInfo.

public struct FileUtils

Initializers

init(fileManager:fileOpener:)

public init(fileManager: FileManager = .default, fileOpener: FileOpener = .init())

Properties

supportedInfofilePaths

let supportedInfofilePaths

buildLogFilePath

The path to the Xcode build log.

var buildLogFilePath

testLogFilePath

The path to the Xcode test log.

var testLogFilePath

buckLogFilePath

The path to the Buck log.

var buckLogFilePath

outputFileName

let outputFileName

infofileName

let infofileName

fileManager

A file manager.

let fileManager: FileManager

fileOpener

The utility that opens and saves files.

let fileOpener: FileOpener

toolFolder

The working path that is containing the SwiftInfo binary.

var toolFolder: String

Methods

infofileFolder()

The path where Infofile.swift is located.

public func infofileFolder() throws -> String

testLog()

The contents of the test log located in the testLogFilePath path.

public func testLog() throws -> String

buckLog()

The contents of the buck log located in the buckLogFilePath path.

public func buckLog() throws -> String

buildLog()

The contents of the build log located in the buildLogFilePath path.

public func buildLog() throws -> String

outputFileFolder()

The folder where the output should be stored.

public func outputFileFolder() throws -> String

outputFileURL()

The desired file path of the output.

public func outputFileURL() throws -> URL

fullOutput()

Opens the current output JSON in outputFileURL() and returns it as a dictionary.

public func fullOutput() throws -> [String: Any]

outputArray()

Opens the current output JSON in outputFileURL() and returns the array of SwiftInfo executions.

public func outputArray() throws -> [[String: Any]]

lastOutput()

Opens the current output JSON in outputFileURL() and returns the latest SwiftInfo execution.

public func lastOutput() throws -> Output

save(output:)

Saves an output dictionary to the outputFileURL().

public func save(output: [[String: Any]]) throws
Clone this wiki locally