-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
896 additions
and
61 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
# 📊 SwiftInfo | ||
|
||
SwiftInfo is a simple CLI tool that extracts and analyzes useful metrics of Swift apps such as number of dependencies, `.ipa` size, number of tests, code coverage and much more. Besides the tracking options that are provided by default, you can customize SwiftInfo to track pretty much anything that can be conveyed in a simple `.swift` script. | ||
<img src="https://i.imgur.com/Y6z0xij.png" height="200"> | ||
|
||
SwiftInfo is a simple CLI tool that extracts and analyzes metrics that are useful for Swift apps. Besides the default tracking options that are shipped with the tool, you can also customize SwiftInfo to track pretty much anything that can be conveyed in a simple `.swift` script. | ||
|
||
## Usage | ||
|
||
SwiftInfo requires the raw logs of a succesful test/archive build combo to work, so it's better used as the last step of a CI pipeline. | ||
|
||
--WIP-- |
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
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
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
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
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 @@ | ||
import Foundation | ||
|
||
public final class Network { | ||
public static let shared = Network() | ||
let client = URLSession.shared | ||
let group = DispatchGroup() | ||
|
||
func syncPost(urlString: String, json: [String: Any]) { | ||
guard let url = URL(string: urlString) else { | ||
return | ||
} | ||
var request = URLRequest(url: url) | ||
request.httpMethod = "POST" | ||
request.allHTTPHeaderFields = ["Content-Type": "application/json"] | ||
let data = try! JSONSerialization.data(withJSONObject: json, options: []) | ||
request.httpBody = data | ||
group.enter() | ||
let task = client.dataTask(with: request) { [weak self] _, _, _ in | ||
self?.group.leave() | ||
} | ||
task.resume() | ||
group.wait() | ||
} | ||
} |
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
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
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
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
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
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
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,13 @@ | ||
import Foundation | ||
|
||
public struct SlackFormatter { | ||
|
||
public init() {} | ||
|
||
public func format(output: Output) -> [String: Any] { | ||
print(output.summaries.map { $0.text }.joined(separator: "\n")) | ||
let data = try! JSONEncoder().encode(output.summaries) | ||
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [[String: Any]] | ||
return ["text": "SwiftInfo results for MyApp 1.10.11:", "attachments": 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,29 @@ | ||
import Foundation | ||
|
||
public struct Summary: Codable, Hashable { | ||
|
||
public enum Style { | ||
case positive | ||
case neutral | ||
case negative | ||
|
||
var hexColor: String { | ||
switch self { | ||
case .positive: | ||
return "#36a64f" | ||
case .neutral: | ||
return "#757575" | ||
case .negative: | ||
return "#c41919" | ||
} | ||
} | ||
} | ||
|
||
let text: String | ||
let color: String | ||
|
||
public init(text: String, style: Style) { | ||
self.text = text | ||
self.color = style.hexColor | ||
} | ||
} |
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,11 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'SwiftInfo' | ||
s.module_name = 'SwiftInfo' | ||
s.version = '0.0.1' | ||
s.license = { type: 'GNU GPL v3.0', file: 'LICENSE.md' } | ||
s.summary = 'Extract and analyze the evolution of an iOS app\'s code.' | ||
s.homepage = 'https://github.com/rockbruno/SwiftInfo' | ||
s.authors = { 'Bruno Rocha' => '[email protected]' } | ||
s.social_media_url = 'https://twitter.com/rockthebruno' | ||
s.source = { http: "https://github.com/rockbruno/SwiftInfo/releases/download/#{s.version}/SwiftInfo.zip" } | ||
end |