-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue #125] Enable DatadogCore
, DatadogLogs
and DatadogTrace
to compile on watchOS platform
#1946
Conversation
[Issue #125] Enable DatadogCore and DatadogLogs to compile on watchOS platform
DatadogCore
and DatadogLogs
to compile on watchOS platform DatadogCore
, DatadogLogs
and DatadogTrace
to compile on watchOS platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT, but I haven't tried to compile it nor ran this branch in a watchOS app.
#if canImport(UIKit) | ||
import UIKit | ||
|
||
#if canImport(WatchKit) | ||
import WatchKit | ||
|
||
extension WKInterfaceDevice: DeviceProtocol {} | ||
#else | ||
extension UIDevice: DeviceProtocol {} | ||
#endif | ||
|
||
public enum DeviceFactory { | ||
/// Get the current device | ||
public static var current: DeviceProtocol { | ||
#if canImport(WatchKit) | ||
WKInterfaceDevice.current() | ||
#else | ||
UIDevice.current | ||
#endif | ||
} | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/blocking Looks like the compilation statement is wrong here, does it actually compile on watchOS? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think we should remove this file and only rely on DeviceInfo
implementation, which is already based on compile statement for UIKit
and macOS
. We should add watchOS
there IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ncreated, if you agree, I can make the change 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds fair @maxep 👍. Feel free to push to this branch, otherwise I can have a look tomorrow 👍
6697b57
to
b5215ff
Compare
b5215ff
to
c9d219c
Compare
c9d219c
to
4d67a53
Compare
What and why?
Merging #1918 (external) to
develop
.More context:
DatadogCore
,DatadogLogs
andDatadogTrace
to work on watchOS.How?
The #1918 was first merged to internal branch. Here w run full CI and do last QA before merging it to
develop
.Before release, we will update Supported Versions doc to also reflect the level of support for watchOS platform.
Review checklist
Custom CI job configuration (optional)