Skip to content

Commit 6febeda

Browse files
author
Vlad Paraschiv
committed
Feature: Add per file compile time aggregation.
1 parent f0b32a8 commit 6febeda

3 files changed

Lines changed: 105 additions & 29 deletions

File tree

BuildTimeAnalyzer/CMCompileMeasure.swift

100644100755
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct CMCompileMeasure {
1616
var filename: String
1717
var references: Int
1818

19-
private var locationArray: [Int]
19+
var locationArray: [Int]
2020

2121
var fileAndLine: String {
2222
return "\(filename):\(locationArray[0])"
@@ -51,7 +51,22 @@ struct CMCompileMeasure {
5151
self.locationArray = locations
5252
self.references = references
5353
}
54-
54+
55+
init?(rawPath: String, time: Double) {
56+
let untrimmedFilename = rawPath.characters.split("/").map(String.init).last
57+
58+
guard let filepath = rawPath.characters.split(":").map(String.init).first else { return nil }
59+
guard let filename = untrimmedFilename?.characters.split(":").map(String.init).first else { return nil }
60+
61+
self.time = time
62+
self.code = ""
63+
self.path = filepath
64+
self.filename = filename
65+
self.locationArray = [0,0]
66+
self.references = 1
67+
}
68+
69+
5570
subscript(column: Int) -> String {
5671
get {
5772
switch column {

0 commit comments

Comments
 (0)