Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
linux:
runs-on: ubuntu-latest
container:
image: swift:5.7
image: swift:5.9-jammy
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down
14 changes: 12 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ let package = Package(
platforms: [
.macOS(.v13),
], products: [
.executable(name: "TTXCMetrics", targets: ["TTXCMetricsApp"]),
.library(name: "TTXCMetricsClient", targets: ["TTXCMetricsClient"]),
.executable(name: "XCMetrics", targets: ["XCMetricsApp"]),
.executable(name: "XCMetricsBackend", targets: ["XCMetricsBackend"]),
.library(name: "XCMetricsBackendLib", targets: ["XCMetricsBackendLib"]),
Expand Down Expand Up @@ -53,6 +55,14 @@ let package = Package(
.product(name: "ArgumentParser", package: "swift-argument-parser"),
]
),
.target(
name: "TTXCMetricsClient",
dependencies: ["XCMetricsClient", "XCMetricsPlugins"]
),
.executableTarget(
name: "TTXCMetricsApp",
dependencies: ["TTXCMetricsClient"]
),
.target(
name: "XCMetricsPlugins",
dependencies: [
Expand All @@ -73,7 +83,7 @@ let package = Package(
.product(name: "NIOHTTP2", package: "swift-nio-http2")
]
),
.target(
.executableTarget(
name: "XCMetricsApp",
dependencies: ["XCMetricsClient"]
),
Expand Down Expand Up @@ -103,7 +113,7 @@ let package = Package(
.unsafeFlags(["-cross-module-optimization"], .when(configuration: .release))
]
),
.target(name: "XCMetricsBackend", dependencies: [.target(name: "XCMetricsBackendLib")]),
.executableTarget(name: "XCMetricsBackend", dependencies: [.target(name: "XCMetricsBackendLib")]),
.testTarget(
name: "XCMetricsTests",
dependencies: [
Expand Down
4 changes: 4 additions & 0 deletions Sources/TTXCMetricsApp/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Foundation
import TTXCMetricsClient

TTXCMetrics.main()
19 changes: 19 additions & 0 deletions Sources/TTXCMetricsClient/TTXCMetrics.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Foundation
import XCMetricsClient
import XCMetricsPlugins

public struct TTXCMetrics {
public static func main() {
let metrics = XCMetrics.parseOrExit()
let configuration = XCMetricsConfiguration()
configuration.add(plugin: ThermalThrottlingPlugin().create())

// The git directory is usually Xcode's `$SRCROOT` environment variable
let gitDirectory: String? = ProcessInfo.processInfo.environment["SRCROOT"]
if let gitDirectory {
configuration.add(plugin: GitPlugin(gitDirectoryPath: gitDirectory).create())
}

metrics.run(with: configuration)
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
//
// +HTTPHeaders.swift
//
//
// Created by Diego Otero Díaz on 18/10/24.
//

import Foundation
import Vapor

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
//
// AzureSharedKeyAuthorization.swift
//
//
// Created by Diego Otero Díaz on 18/10/24.
//

import CryptoSwift
import Foundation
import Vapor
Expand Down
9 changes: 9 additions & 0 deletions docs/Getting Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ One of the pre-requisites is to get a binary release of XCMetrics directly from

>If you're downloading a pre-built executable version of XCMetrics, you can skip the following section.

#### Compile TomTom's TTXCMetrics Executable
In a terminal window inside the `XCMetrics` repo, run the following:

```shell
swift build --product TTXCMetrics -c release
```

An executable named `TTXCMetrics` will be placed inside `.build/release/TTXCMetrics`. This is the executable that manages the metrics collection for you.

#### Compile XCMetrics Executable
In a terminal window inside the `XCMetrics` repo, run the following:

Expand Down