-
Notifications
You must be signed in to change notification settings - Fork 0
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
1,579 changed files
with
1,404 additions
and
0 deletions.
There are no files selected for viewing
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,9 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
/*.xcodeproj | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/config/registries.json | ||
.swiftpm/xcode | ||
.netrc |
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 @@ | ||
0.53.1 |
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,57 @@ | ||
excluded: | ||
- .build | ||
|
||
opt_in_rules: | ||
- discouraged_optional_collection | ||
- discouraged_optional_boolean | ||
|
||
disabled_rules: | ||
- function_body_length | ||
- type_body_length | ||
- unused_optional_binding | ||
- cyclomatic_complexity | ||
- function_parameter_count | ||
- force_cast | ||
- force_try | ||
- force_unwrapping | ||
- trailing_comma | ||
- large_tuple | ||
|
||
line_length: | ||
warning: 120 | ||
|
||
file_length: | ||
warning: 800 | ||
error: 1200 | ||
|
||
type_name: | ||
min_length: 2 | ||
max_length: | ||
warning: 45 | ||
error: 60 | ||
|
||
identifier_name: | ||
max_length: 45 | ||
allowed_symbols: | ||
- _ | ||
excluded: | ||
- id | ||
- vc | ||
- x | ||
- y | ||
- ok | ||
- on | ||
- os | ||
- by | ||
- qr | ||
- x1 | ||
- x2 | ||
- y1 | ||
- y2 | ||
- to | ||
- dp | ||
- up | ||
- pi | ||
- ps | ||
- i | ||
- j |
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 @@ | ||
14.2.0 |
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,23 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "swift-argument-parser", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-argument-parser", | ||
"state" : { | ||
"revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d", | ||
"version" : "1.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "xcresultkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/davidahouse/XCResultKit", | ||
"state" : { | ||
"revision" : "3c8206371aa630248afddd085cce036b625c1455", | ||
"version" : "1.0.1" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
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,41 @@ | ||
// swift-tools-version: 5.7 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "xcresult-to-json", | ||
platforms: [ | ||
.macOS(.v12), | ||
], | ||
products: [ | ||
.executable(name: "xcresult-to-json", targets: ["XCResultToJson"]) | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMajor(from: "1.2.0")), | ||
.package(url: "https://github.com/davidahouse/XCResultKit", exact: "1.0.1"), | ||
], | ||
targets: [ | ||
.executableTarget( | ||
name: "XCResultToJson", | ||
dependencies: [ | ||
.target(name: "XCResultToJsonLib"), | ||
] | ||
), | ||
.target( | ||
name: "XCResultToJsonLib", | ||
dependencies: [ | ||
.product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
.product(name: "XCResultKit", package: "XCResultKit"), | ||
] | ||
), | ||
.testTarget( | ||
name: "XCResultToJsonTests", | ||
dependencies: [ | ||
"XCResultToJson", | ||
"XCResultToJsonLib" | ||
], | ||
resources: [ | ||
.copy("Resources/xcresult"), | ||
] | ||
) | ||
] | ||
) |
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,26 @@ | ||
# xcresult-to-json | ||
|
||
A macOS command line tool that parses an Xcode-generated xcresult bundle and outputs a summarizing json for CI. | ||
|
||
## Example usage | ||
|
||
``` | ||
xcodebuild build -resultBundlePath "build.xcresult" | ||
xcresult-to-json build.xcresult --path-root $PWD | ||
``` | ||
|
||
For more options see: | ||
``` | ||
xcresult-to-json --help | ||
``` | ||
|
||
## Runtime dependencies | ||
|
||
* Requires Xcode to be installed | ||
- [XCResultKit](https://github.com/davidahouse/XCResultKit), that is used to | ||
parse the xcresult bundle, internally runs `xcrun xcresulttool`. | ||
|
||
## Output format | ||
|
||
The json that is written to `stdout` is described by [a Json Schema file](Schema/output.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,109 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"description": "xcresult-to-json output", | ||
"type": "object", | ||
"properties": { | ||
"metrics": { | ||
"$ref": "#/$defs/metrics" | ||
}, | ||
"annotations": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$defs/annotation" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"annotations", | ||
"errors" | ||
], | ||
"$defs": { | ||
"metrics": { | ||
"type": "object", | ||
"properties": { | ||
"analyzerWarningCount": { | ||
"type": "integer" | ||
}, | ||
"errorCount": { | ||
"type": "integer" | ||
}, | ||
"testCount": { | ||
"type": "integer" | ||
}, | ||
"testFailedCount": { | ||
"type": "integer" | ||
}, | ||
"testSkippedCount": { | ||
"type": "integer" | ||
}, | ||
"warningCount": { | ||
"type": "integer" | ||
} | ||
}, | ||
"required": [ | ||
"analyzerWarningCount", | ||
"errorCount", | ||
"testCount", | ||
"testFailedCount", | ||
"testSkippedCount", | ||
"warningCount" | ||
] | ||
}, | ||
"annotation": { | ||
"type": "object", | ||
"properties": { | ||
"path": { | ||
"type": "string", | ||
"description": "The file path" | ||
}, | ||
"location": { | ||
"$ref": "#/$defs/sourceLocation" | ||
}, | ||
"annotationLevel": { | ||
"type": "string", | ||
"description": "The level of the annotation.", | ||
"enum": [ | ||
"notice", | ||
"warning", | ||
"failure" | ||
] | ||
}, | ||
"message": { | ||
"type": "string", | ||
"description": "A short description" | ||
}, | ||
"title": { | ||
"type": "string", | ||
"description": "Title", | ||
"maxLength": 255 | ||
} | ||
}, | ||
"required": [ | ||
"annotationLevel", | ||
"message", | ||
"title" | ||
] | ||
}, | ||
"sourceLocation": { | ||
"type": "object", | ||
"properties": { | ||
"startLine": { | ||
"type": "integer" | ||
}, | ||
"endLine": { | ||
"type": "integer" | ||
}, | ||
"startColumn": { | ||
"type": "integer" | ||
}, | ||
"endColumn": { | ||
"type": "integer" | ||
} | ||
}, | ||
"required": [ | ||
"startLine", | ||
"endLine" | ||
] | ||
} | ||
} | ||
} |
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,3 @@ | ||
import XCResultToJsonLib | ||
|
||
XCResultToJsonLib.main() |
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,9 @@ | ||
import Foundation | ||
|
||
extension Output { | ||
var json: Data { | ||
let encoder = JSONEncoder() | ||
encoder.outputFormatting = [.sortedKeys, .prettyPrinted] | ||
return try! encoder.encode(self) | ||
} | ||
} |
Oops, something went wrong.