diff --git a/Sources/TuistKit/Device/Device.swift b/Sources/TuistKit/Device/Device.swift new file mode 100644 index 000000000..3791bb161 --- /dev/null +++ b/Sources/TuistKit/Device/Device.swift @@ -0,0 +1,31 @@ +import Foundation + +struct Device: Hashable, Equatable { + + // MARK: - Attributes + + let state: String + let availability: String + let name: String + let udid: String + + var hashValue: Int { + return udid.hashValue + } + + var available: Bool { + return !availability.contains("unavailable") + } + + // MARK: - Init + + init(state: String, + availability: String, + name: String, + udid: String) { + self.state = state + self.availability = availability + self.name = name + self.udid = udid + } +} diff --git a/Sources/TuistKit/Device/DeviceType.swift b/Sources/TuistKit/Device/DeviceType.swift new file mode 100644 index 000000000..9fd5e1b35 --- /dev/null +++ b/Sources/TuistKit/Device/DeviceType.swift @@ -0,0 +1,21 @@ +import Foundation + +struct DeviceType: Hashable { + + // MARK: - Attributes + + let name: String + let identifier: String + + var hashValue: Int { + return identifier.hashValue + } + + // MARK: - Init + + init(name: String, + identifier: String) { + self.name = name + self.identifier = identifier + } +} diff --git a/Sources/TuistKit/Device/Runtime.swift b/Sources/TuistKit/Device/Runtime.swift new file mode 100644 index 000000000..1a22a1510 --- /dev/null +++ b/Sources/TuistKit/Device/Runtime.swift @@ -0,0 +1,30 @@ +import Foundation + +struct Runtime: Equatable, Hashable { + + // MARK: - Attributes + + let buildVersion: String + let availability: String + let name: String + let version: String + let identifier: String + + var hashValue: Int { + return identifier.hashValue + } + + // MARK: - Init + + init(buildVersion: String, + availability: String, + name: String, + identifier: String, + version: String) { + self.buildVersion = buildVersion + self.availability = availability + self.name = name + self.identifier = identifier + self.version = version + } +}