diff --git a/CHANGELOG.md b/CHANGELOG.md index ab03984e..e4760ef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added - Added `scheme.enableGPUValidationMode` #1294 @LouisLWang +- Added visionOS support #1379 @shiba1014 ### Fixed diff --git a/Docs/ProjectSpec.md b/Docs/ProjectSpec.md index 4247a9f8..e2fd0731 100644 --- a/Docs/ProjectSpec.md +++ b/Docs/ProjectSpec.md @@ -434,6 +434,7 @@ This will provide default build settings for a certain platform. It can be any o - `macOS` - `tvOS` - `watchOS` +- `visionOS` (`visionOS` doesn't support Carthage usage) **Multi Platform targets** diff --git a/SettingPresets/Platforms/visionOS.yml b/SettingPresets/Platforms/visionOS.yml new file mode 100644 index 00000000..5f2e5220 --- /dev/null +++ b/SettingPresets/Platforms/visionOS.yml @@ -0,0 +1,2 @@ +SDKROOT: xros +TARGETED_DEVICE_FAMILY: 7 diff --git a/SettingPresets/Product_Platform/application_visionOS.yml b/SettingPresets/Product_Platform/application_visionOS.yml new file mode 100644 index 00000000..e538b238 --- /dev/null +++ b/SettingPresets/Product_Platform/application_visionOS.yml @@ -0,0 +1 @@ +ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon diff --git a/Sources/ProjectSpec/DeploymentTarget.swift b/Sources/ProjectSpec/DeploymentTarget.swift index 95838031..d3c9e3f7 100644 --- a/Sources/ProjectSpec/DeploymentTarget.swift +++ b/Sources/ProjectSpec/DeploymentTarget.swift @@ -8,17 +8,20 @@ public struct DeploymentTarget: Equatable { public var tvOS: Version? public var watchOS: Version? public var macOS: Version? + public var visionOS: Version? public init( iOS: Version? = nil, tvOS: Version? = nil, watchOS: Version? = nil, - macOS: Version? = nil + macOS: Version? = nil, + visionOS: Version? = nil ) { self.iOS = iOS self.tvOS = tvOS self.watchOS = watchOS self.macOS = macOS + self.visionOS = visionOS } public func version(for platform: Platform) -> Version? { @@ -27,6 +30,7 @@ public struct DeploymentTarget: Equatable { case .tvOS: return tvOS case .watchOS: return watchOS case .macOS: return macOS + case .visionOS: return visionOS } } } @@ -39,6 +43,7 @@ extension Platform { case .tvOS: return "TVOS_DEPLOYMENT_TARGET" case .watchOS: return "WATCHOS_DEPLOYMENT_TARGET" case .macOS: return "MACOSX_DEPLOYMENT_TARGET" + case .visionOS: return "XROS_DEPLOYMENT_TARGET" } } @@ -48,6 +53,7 @@ extension Platform { case .tvOS: return "appletvos" case .watchOS: return "watchos" case .macOS: return "macosx" + case .visionOS: return "xros" } } } @@ -77,6 +83,7 @@ extension DeploymentTarget: JSONObjectConvertible { tvOS = try parseVersion("tvOS") watchOS = try parseVersion("watchOS") macOS = try parseVersion("macOS") + visionOS = try parseVersion("visionOS") } } @@ -87,6 +94,7 @@ extension DeploymentTarget: JSONEncodable { "tvOS": tvOS?.description, "watchOS": watchOS?.description, "macOS": macOS?.description, + "visionOS": visionOS?.description, ] } } diff --git a/Sources/ProjectSpec/Platform.swift b/Sources/ProjectSpec/Platform.swift index f3652de8..69a976f1 100644 --- a/Sources/ProjectSpec/Platform.swift +++ b/Sources/ProjectSpec/Platform.swift @@ -5,4 +5,5 @@ public enum Platform: String, Hashable, CaseIterable { case watchOS case tvOS case macOS + case visionOS } diff --git a/Sources/ProjectSpec/XCProjExtensions.swift b/Sources/ProjectSpec/XCProjExtensions.swift index 2ec652a6..bbb3247e 100644 --- a/Sources/ProjectSpec/XCProjExtensions.swift +++ b/Sources/ProjectSpec/XCProjExtensions.swift @@ -86,6 +86,7 @@ extension Platform { case .watchOS: return "⌚️" case .tvOS: return "📺" case .macOS: return "🖥" + case .visionOS: return "🕶️" } } } diff --git a/Sources/XcodeGenKit/CarthageDependencyResolver.swift b/Sources/XcodeGenKit/CarthageDependencyResolver.swift index ac4588fb..8fcb6e46 100644 --- a/Sources/XcodeGenKit/CarthageDependencyResolver.swift +++ b/Sources/XcodeGenKit/CarthageDependencyResolver.swift @@ -159,6 +159,9 @@ extension Platform { return "watchOS" case .macOS: return "Mac" + case .visionOS: + // This is a dummy value because Carthage doesn't support visionOS. + return "visionOS" } } } diff --git a/Sources/XcodeGenKit/PBXProjGenerator.swift b/Sources/XcodeGenKit/PBXProjGenerator.swift index 9ad0c918..686bc99c 100644 --- a/Sources/XcodeGenKit/PBXProjGenerator.swift +++ b/Sources/XcodeGenKit/PBXProjGenerator.swift @@ -1561,7 +1561,7 @@ extension Platform { /// - returns: `true` for platforms that the app store requires simulator slices to be stripped. public var requiresSimulatorStripping: Bool { switch self { - case .iOS, .tvOS, .watchOS: + case .iOS, .tvOS, .watchOS, .visionOS: return true case .macOS: return false