Skip to content

Commit 596cf22

Browse files
committed
renamed sdk-resource-extension & swiftformat
1 parent adc41a4 commit 596cf22

17 files changed

+66
-70
lines changed

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ let package = Package(
5454
.product(name: "Atomics", package: "swift-atomics")]),
5555
.target(name: "ResourceExtension",
5656
dependencies: ["OpenTelemetrySdk"],
57-
path: "Sources/Instrumentation/sdk-resource-extension"),
57+
path: "Sources/Instrumentation/SDKResourceExtension",
58+
exclude: ["README.md"]),
5859
.target(name: "OpenTracingShim",
5960
dependencies: ["OpenTelemetrySdk",
6061
"Opentracing"]),

Sources/Instrumentation/sdk-resource-extension/data-source/DeviceDataSource.swift renamed to Sources/Instrumentation/SDKResourceExtension/DataSource/DeviceDataSource.swift

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,25 @@
1313
// limitations under the License.
1414
//
1515

16-
17-
import Foundation
16+
import Foundation
1817
#if os(watchOS)
1918
import WatchKit
2019
#elseif os(macOS)
21-
import AppKit
20+
import AppKit
2221
#else
23-
import UIKit
22+
import UIKit
2423
#endif
25-
public class DeviceDataSource: IDeviceDataSource {
26-
public var model: String? {
27-
#if os(watchOS)
24+
public class DeviceDataSource: IDeviceDataSource {
25+
public var model: String? {
26+
#if os(watchOS)
2827
return WKInterfaceDevice.current().localizedModel
29-
#else
28+
#else
3029
let hwName = UnsafeMutablePointer<Int32>.allocate(capacity: 2)
3130
hwName[0] = CTL_HW
3231
#if os(macOS)
33-
hwName[1] = HW_MODEL
32+
hwName[1] = HW_MODEL
3433
#else
35-
hwName[1] = HW_MACHINE
34+
hwName[1] = HW_MACHINE
3635
#endif
3736
let machine = UnsafeMutablePointer<CChar>.allocate(capacity: 255)
3837
let len: UnsafeMutablePointer<Int>! = UnsafeMutablePointer<Int>.allocate(capacity: 1)
@@ -46,22 +45,21 @@ import UIKit
4645
}
4746
let machineName = String(cString: machine)
4847
return machineName
49-
#endif
50-
}
48+
#endif
49+
}
5150

52-
public var identifier: String? {
53-
#if os(watchOS)
54-
if #available (watchOS 6.3, *) {
51+
public var identifier: String? {
52+
#if os(watchOS)
53+
if #available(watchOS 6.3, *) {
5554
return WKInterfaceDevice.current().identifierForVendor?.uuidString
5655
} else {
5756
return nil
5857
}
59-
#elseif os(macOS)
58+
#elseif os(macOS)
6059
return nil
61-
#else
60+
#else
6261
return UIDevice.current.identifierForVendor?.uuidString
6362

64-
#endif
65-
66-
}
63+
#endif
6764
}
65+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
// limitations under the License.
1414
//
1515
#if os(watchOS)
16-
import WatchKit
16+
import WatchKit
1717
#elseif os(macOS)
1818
#else
19-
import UIKit
19+
import UIKit
2020
#endif
2121

2222
import Foundation
@@ -30,7 +30,7 @@ public class OperatingSystemDataSource: IOperatingSystemDataSource {
3030
#if os(watchOS)
3131
return "watchOS"
3232
#elseif os(macOS)
33-
return "macOS"
33+
return "macOS"
3434
#else
3535
return UIDevice.current.systemName
3636
#endif

Sources/Instrumentation/sdk-resource-extension/data-source/TelemetryDataSource.swift renamed to Sources/Instrumentation/SDKResourceExtension/DataSource/TelemetryDataSource.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public class TelemetryDataSource: ITelemetryDataSource {
2222

2323
public var name: String {
2424
#if os(tvOS)
25-
return "tvOS"
25+
return "tvOS"
2626
#elseif os(watchOS)
27-
return "watchOS"
27+
return "watchOS"
2828
#elseif os(macOS)
29-
return "macOS"
29+
return "macOS"
3030
#else
31-
return "iOS"
31+
return "iOS"
3232
#endif
3333
}
3434

0 commit comments

Comments
 (0)