-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from felginep/feature/logs
Feature/logs
- Loading branch information
Showing
14 changed files
with
2,459 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
Sources/XCResultKit/ActivityLogAnalyzerControlFlowStep.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
24
Sources/XCResultKit/ActivityLogAnalyzerControlFlowStepEdge.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
52
Sources/XCResultKit/ActivityLogAnalyzerResultMessage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
36
Sources/XCResultKit/ActivityLogAnalyzerWarningMessage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
66
Sources/XCResultKit/ActivityLogCommandInvocationSection.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
Oops, something went wrong.