XCMetrics

public struct XCMetrics : ParsableCommand

The entry point for XCMetrics that parses all argument if executed standalone or by another package that depends on it.

  • The default configuration for the command.

    Declaration

    Swift

    public static var configuration: CommandConfiguration
  • The value of the Xcode $BUILD_DIR environment variable provided as argument. If not provided directly, XCMetrics will try to fetch it from the environment.

    Declaration

    Swift

    @Option
    public var buildDir: String? { get set }
  • The name of the current project provided as argument.

    Declaration

    Swift

    @Option
    public var name: String { get set }
  • The timeout to wait for the Xcode’s log to appear provided as argument. Default value is 5 seconds.

    Declaration

    Swift

    @Option
    public var timeout: Int { get set }
  • The URL of the service where to send metrics to provided as argument. In debug builds, this argument can be ommitted and the default local URL will be used (http://localhost:8080/v1/metrics) in order to avoid uploading local data to the production service.

    Declaration

    Swift

    @Option
    public var serviceURL: String? { get set }
  • If the metrics collected are coming from CI or not provided as argument. Default value is false.

    Declaration

    Swift

    @Option
    public var isCI: Bool { get set }
  • If the Notes found in log should be skipped. Useful when there are thousands of notes to reduce the size of the Database.

    Declaration

    Swift

    @Option
    public var skipNotes: Bool { get set }
  • An optional authorization/token header key to be included in the upload request. Must be used in conjunction with authorizationValue.

    Declaration

    Swift

    @Option
    public var authorizationKey: String? { get set }
  • An optional authorization/token header value to be included in the upload request. Must be used in conjunction with authorizationKey.

    Declaration

    Swift

    @Option
    public var authorizationValue: String? { get set }
  • If an individual task have more than a 100 issues (Warnings, Notes and/or Errors) this flag will instruct the parser to truncate them to a 100. This is useful to fix memory issues in the backend and speed up log processing.

    Declaration

    Swift

    @Option
    public var truncLargeIssues: Bool { get set }
  • Declaration

    Swift

    @Option
    public var additionalHeaderJson: [String : String] { get set }
  • The default initializer for the XCMetrics object.

    Declaration

    Swift

    public init()
  • Runs XCMetrics with the provided configuration containing the optional custom plugins to be executed.

    Declaration

    Swift

    public func run(with configuration: XCMetricsConfiguration)

    Parameters

    configuration
  • Runs XCMetrics.

    Throws

    Throws an error in case of missing or invalid required arguments.

    Declaration

    Swift

    public func run() throws