From ddcf3754273b55d8fddfa92790d37c6607d3edf1 Mon Sep 17 00:00:00 2001 From: Shai Mishali Date: Wed, 6 Mar 2024 09:10:37 +0200 Subject: [PATCH] Check for iPad VIsion in TargetLinter --- Sources/TuistGenerator/Linter/TargetLinter.swift | 5 ++++- Sources/TuistGraph/Models/Destination.swift | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Sources/TuistGenerator/Linter/TargetLinter.swift b/Sources/TuistGenerator/Linter/TargetLinter.swift index ed7f5a27876..9ab06356203 100644 --- a/Sources/TuistGenerator/Linter/TargetLinter.swift +++ b/Sources/TuistGenerator/Linter/TargetLinter.swift @@ -223,7 +223,10 @@ class TargetLinter: TargetLinting { case .macOS: if !target.supports(.macOS) { return [inconsistentPlatformIssue] } case .watchOS: if !target.supports(.watchOS) { return [inconsistentPlatformIssue] } case .tvOS: if !target.supports(.tvOS) { return [inconsistentPlatformIssue] } - case .visionOS: if !target.supports(.visionOS) { return [inconsistentPlatformIssue] } + case .visionOS: + if !target.supports(.visionOS), !target.destinations.contains(.appleVisionWithiPadDesign) { + return [inconsistentPlatformIssue] + } } return [] } diff --git a/Sources/TuistGraph/Models/Destination.swift b/Sources/TuistGraph/Models/Destination.swift index 9ba5d1b6ebe..0d7b2028437 100644 --- a/Sources/TuistGraph/Models/Destination.swift +++ b/Sources/TuistGraph/Models/Destination.swift @@ -31,7 +31,7 @@ public enum Destination: String, Codable, Equatable, CaseIterable { public var platform: Platform { switch self { - case .iPad, .iPhone, .macCatalyst, .macWithiPadDesign: + case .iPad, .iPhone, .macCatalyst, .macWithiPadDesign, .appleVisionWithiPadDesign: return .iOS case .mac: return .macOS @@ -39,7 +39,7 @@ public enum Destination: String, Codable, Equatable, CaseIterable { return .tvOS case .appleWatch: return .watchOS - case .appleVision, .appleVisionWithiPadDesign: + case .appleVision: return .visionOS } }