Skip to content

Commit

Permalink
Merge pull request #4 from felginep/feature/logs
Browse files Browse the repository at this point in the history
Feature/logs
  • Loading branch information
davidahouse authored Oct 7, 2019
2 parents bcfaf47 + 6e1abdc commit a3c5976
Show file tree
Hide file tree
Showing 14 changed files with 2,459 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Sources/XCResultKit/ActivityLogAnalyzerControlFlowStep.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// ActivityLogAnalyzerControlFlowStep.swift
// XCResultKit
//
// Created by Pierre Felgines on 05/10/2019.
//

import Foundation

//- ActivityLogAnalyzerStep
// * Kind: object
// * Properties:
// + parentIndex: Int
//
// - ActivityLogAnalyzerControlFlowStep
// * Supertype: ActivityLogAnalyzerStep
// * Kind: object
// * Properties:
// + title: String
// + startLocation: DocumentLocation?
// + endLocation: DocumentLocation?
// + edges: [ActivityLogAnalyzerControlFlowStepEdge]

public struct ActivityLogAnalyzerControlFlowStep: XCResultObject {
public let parentIndex: Int
public let title: String
public let startLocation: DocumentLocation?
public let endLocation: DocumentLocation?
public let edges: [ActivityLogAnalyzerControlFlowStepEdge]

public init?(_ json: [String : AnyObject]) {
do {
parentIndex = try xcRequired(element: "parentIndex", from: json)
title = try xcRequired(element: "title", from: json)
startLocation = xcOptional(element: "startLocation", from: json)
endLocation = xcOptional(element: "endLocation", from: json)
edges = xcArray(element: "edges", from: json)
.ofType(ActivityLogAnalyzerControlFlowStepEdge.self)
} catch {
debug("Error parsing ActivityLogAnalyzerControlFlowStep: \(error.localizedDescription)")
return nil
}
}
}
24 changes: 24 additions & 0 deletions Sources/XCResultKit/ActivityLogAnalyzerControlFlowStepEdge.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// ActivityLogAnalyzerControlFlowStepEdge.swift
// XCResultKit
//
// Created by Pierre Felgines on 05/10/2019.
//

import Foundation

//- ActivityLogAnalyzerControlFlowStepEdge
// * Kind: object
// * Properties:
// + startLocation: DocumentLocation?
// + endLocation: DocumentLocation?

public struct ActivityLogAnalyzerControlFlowStepEdge: XCResultObject {
public let startLocation: DocumentLocation?
public let endLocation: DocumentLocation?

public init?(_ json: [String : AnyObject]) {
startLocation = xcOptional(element: "startLocation", from: json)
endLocation = xcOptional(element: "endLocation", from: json)
}
}
43 changes: 43 additions & 0 deletions Sources/XCResultKit/ActivityLogAnalyzerEventStep.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// ActivityLogAnalyzerEventStep.swift
// XCResultKit
//
// Created by Pierre Felgines on 05/10/2019.
//

import Foundation

//- ActivityLogAnalyzerStep
// * Kind: object
// * Properties:
// + parentIndex: Int
//
// - ActivityLogAnalyzerEventStep
// * Supertype: ActivityLogAnalyzerStep
// * Kind: object
// * Properties:
// + title: String
// + location: DocumentLocation?
// + description: String
// + callDepth: Int

public struct ActivityLogAnalyzerEventStep: XCResultObject {
public let parentIndex: Int
public let title: String
public let location: DocumentLocation?
public let description: String
public let callDepth: Int

public init?(_ json: [String : AnyObject]) {
do {
parentIndex = try xcRequired(element: "parentIndex", from: json)
title = try xcRequired(element: "title", from: json)
location = xcOptional(element: "location", from: json)
description = try xcRequired(element: "description", from: json)
callDepth = try xcRequired(element: "callDepth", from: json)
} catch {
debug("Error parsing ActivityLogAnalyzerEventStep: \(error.localizedDescription)")
return nil
}
}
}
52 changes: 52 additions & 0 deletions Sources/XCResultKit/ActivityLogAnalyzerResultMessage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// ActivityLogAnalyzerResultMessage.swift
// XCResultKit
//
// Created by Pierre Felgines on 05/10/2019.
//

import Foundation

//- ActivityLogAnalyzerResultMessage
//* Supertype: ActivityLogMessage
//* Kind: object
//* Properties:
// + steps: [ActivityLogAnalyzerStep]
// + resultType: String?
// + keyEventIndex: Int

public struct ActivityLogAnalyzerResultMessage: XCResultObject {
public let type: String
public let title: String
public let shortTitle: String?
public let category: String?
public let location: DocumentLocation
public let annotations: [ActivityLogMessageAnnotation]

public let controlFlowSteps: [ActivityLogAnalyzerControlFlowStep]
public let eventSteps: [ActivityLogAnalyzerEventStep]
public let resultType: String?
public let keyEventIndex: Int

public init?(_ json: [String : AnyObject]) {
do {
type = try xcRequired(element: "type", from: json)
title = try xcRequired(element: "title", from: json)
shortTitle = xcOptional(element: "shortTitle", from: json)
category = xcOptional(element: "category", from: json)
location = try xcRequired(element: "location", from: json)
annotations = xcArray(element: "annotation", from: json)
.ofType(ActivityLogMessageAnnotation.self)

controlFlowSteps = xcArray(element: "steps", from: json)
.ofType(ActivityLogAnalyzerControlFlowStep.self)
eventSteps = xcArray(element: "steps", from: json)
.ofType(ActivityLogAnalyzerEventStep.self)
resultType = xcOptional(element: "resultType", from: json)
keyEventIndex = try xcRequired(element: "keyEventIndex", from: json)
} catch {
debug("Error parsing ActivityLogAnalyzerResultMessage: \(error.localizedDescription)")
return nil
}
}
}
36 changes: 36 additions & 0 deletions Sources/XCResultKit/ActivityLogAnalyzerWarningMessage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// ActivityLogAnalyzerWarningMessage.swift
// XCResultKit
//
// Created by Pierre Felgines on 05/10/2019.
//

import Foundation

//- ActivityLogAnalyzerWarningMessage
// * Supertype: ActivityLogMessage
// * Kind: object

public struct ActivityLogAnalyzerWarningMessage: XCResultObject {
public let type: String
public let title: String
public let shortTitle: String?
public let category: String?
public let location: DocumentLocation
public let annotations: [ActivityLogMessageAnnotation]

public init?(_ json: [String : AnyObject]) {
do {
type = try xcRequired(element: "type", from: json)
title = try xcRequired(element: "title", from: json)
shortTitle = xcOptional(element: "shortTitle", from: json)
category = xcOptional(element: "category", from: json)
location = try xcRequired(element: "location", from: json)
annotations = xcArray(element: "annotation", from: json)
.ofType(ActivityLogMessageAnnotation.self)
} catch {
debug("Error parsing ActivityLogAnalyzerWarningMessage: \(error.localizedDescription)")
return nil
}
}
}
66 changes: 66 additions & 0 deletions Sources/XCResultKit/ActivityLogCommandInvocationSection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// ActivityLogCommandInvocationSection.swift
// XCResultKit
//
// Created by Pierre Felgines on 05/10/2019.
//

import Foundation

//- ActivityLogCommandInvocationSection
//* Supertype: ActivityLogSection
//* Kind: object
//* Properties:
// + commandDetails: String
// + emittedOutput: String
// + exitCode: Int?

public struct ActivityLogCommandInvocationSection: XCResultObject {
public let domainType: String
public let title: String
public let startTime: Date?
public let duration: Double
public let result: String?
public let subsections: [ActivityLogMajorSection]
public let unitTestSubsections: [ActivityLogUnitTestSection]
public let commandInvocationSubsections: [ActivityLogCommandInvocationSection]
public let targetBuildSubsections: [ActivityLogTargetBuildSection]
public let messages: [ActivityLogMessage]
public let resultMessages: [ActivityLogAnalyzerResultMessage]
public let warningMessage: [ActivityLogAnalyzerWarningMessage]

public let commandDetails: String
public let emittedOutput: String?
public let exitCode: Int?

public init?(_ json: [String : AnyObject]) {
do {
domainType = try xcRequired(element: "domainType", from: json)
title = try xcRequired(element: "title", from: json)
startTime = xcOptional(element: "startTime", from: json)
duration = try xcRequired(element: "duration", from: json)
result = xcOptional(element: "result", from: json)
subsections = xcArray(element: "subsections", from: json)
.ofType(ActivityLogMajorSection.self)
unitTestSubsections = xcArray(element: "subsections", from: json)
.ofType(ActivityLogUnitTestSection.self)
commandInvocationSubsections = xcArray(element: "subsections", from: json)
.ofType(ActivityLogCommandInvocationSection.self)
targetBuildSubsections = xcArray(element: "subsections", from: json)
.ofType(ActivityLogTargetBuildSection.self)
messages = xcArray(element: "messages", from: json)
.ofType(ActivityLogMessage.self)
resultMessages = xcArray(element: "messages", from: json)
.ofType(ActivityLogAnalyzerResultMessage.self)
warningMessage = xcArray(element: "messages", from: json)
.ofType(ActivityLogAnalyzerWarningMessage.self)

commandDetails = try xcRequired(element: "commandDetails", from: json)
emittedOutput = xcOptional(element: "emittedOutput", from: json)
exitCode = xcOptional(element: "exitCode", from: json)
} catch {
debug("Error parsing ActivityLogCommandInvocationSection: \(error.localizedDescription)")
return nil
}
}
}
60 changes: 60 additions & 0 deletions Sources/XCResultKit/ActivityLogMajorSection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// ActivityLogMajorSection.swift
// XCResultKitTests
//
// Created by Pierre Felgines on 05/10/2019.
//

import Foundation

//- ActivityLogMajorSection
//* Supertype: ActivityLogSection
//* Kind: object
//* Properties:
// + subtitle: String

public struct ActivityLogMajorSection: XCResultObject {
public let domainType: String
public let title: String
public let startTime: Date?
public let duration: Double
public let result: String?
public let subsections: [ActivityLogMajorSection]
public let unitTestSubsections: [ActivityLogUnitTestSection]
public let commandInvocationSubsections: [ActivityLogCommandInvocationSection]
public let targetBuildSubsections: [ActivityLogTargetBuildSection]
public let messages: [ActivityLogMessage]
public let resultMessages: [ActivityLogAnalyzerResultMessage]
public let warningMessage: [ActivityLogAnalyzerWarningMessage]

public let subtitle: String

public init?(_ json: [String : AnyObject]) {
do {
domainType = try xcRequired(element: "domainType", from: json)
title = try xcRequired(element: "title", from: json)
startTime = xcOptional(element: "startTime", from: json)
duration = try xcRequired(element: "duration", from: json)
result = xcOptional(element: "result", from: json)
subsections = xcArray(element: "subsections", from: json)
.ofType(ActivityLogMajorSection.self)
unitTestSubsections = xcArray(element: "subsections", from: json)
.ofType(ActivityLogUnitTestSection.self)
commandInvocationSubsections = xcArray(element: "subsections", from: json)
.ofType(ActivityLogCommandInvocationSection.self)
targetBuildSubsections = xcArray(element: "subsections", from: json)
.ofType(ActivityLogTargetBuildSection.self)
messages = xcArray(element: "messages", from: json)
.ofType(ActivityLogMessage.self)
resultMessages = xcArray(element: "messages", from: json)
.ofType(ActivityLogAnalyzerResultMessage.self)
warningMessage = xcArray(element: "messages", from: json)
.ofType(ActivityLogAnalyzerWarningMessage.self)

subtitle = try xcRequired(element: "subtitle", from: json)
} catch {
debug("Error parsing ActivityLogTargetBuildSection: \(error.localizedDescription)")
return nil
}
}
}
42 changes: 42 additions & 0 deletions Sources/XCResultKit/ActivityLogMessage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// ActivityLogMessage.swift
// XCResultKit
//
// Created by Pierre Felgines on 03/10/2019.
//

import Foundation

//- ActivityLogMessage
// * Kind: object
// * Properties:
// + type: String
// + title: String
// + shortTitle: String?
// + category: String?
// + location: DocumentLocation?
// + annotations: [ActivityLogMessageAnnotation]

public struct ActivityLogMessage: XCResultObject {
public let type: String
public let title: String
public let shortTitle: String?
public let category: String?
public let location: DocumentLocation
public let annotations: [ActivityLogMessageAnnotation]

public init?(_ json: [String : AnyObject]) {
do {
type = try xcRequired(element: "type", from: json)
title = try xcRequired(element: "title", from: json)
shortTitle = xcOptional(element: "shortTitle", from: json)
category = xcOptional(element: "category", from: json)
location = try xcRequired(element: "location", from: json)
annotations = xcArray(element: "annotation", from: json)
.ofType(ActivityLogMessageAnnotation.self)
} catch {
debug("Error parsing ActivityLogMessage: \(error.localizedDescription)")
return nil
}
}
}
Loading

0 comments on commit a3c5976

Please sign in to comment.