Add support for visionOS (#1379)

* Add support for visionOS

* Update ProjectSpec

* Add carthageName property for .visionOS

* Update CHANGELOG.md and ProjectSpec.md

* Add visionOS yml to SettingPresets/Platforms and SettingPresets/Product_Platform

---------

Co-authored-by: Satsuki Hashiba <hashiba.satsuki@linecorp.com>
This commit is contained in:
Satsuki Hashiba 2023-08-07 21:12:34 +09:00 committed by GitHub
parent 49a9bda992
commit 3a215ce999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 2 deletions

View File

@ -5,6 +5,7 @@
### Added
- Added `scheme.enableGPUValidationMode` #1294 @LouisLWang
- Added visionOS support #1379 @shiba1014
### Fixed

View File

@ -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**

View File

@ -0,0 +1,2 @@
SDKROOT: xros
TARGETED_DEVICE_FAMILY: 7

View File

@ -0,0 +1 @@
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon

View File

@ -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,
]
}
}

View File

@ -5,4 +5,5 @@ public enum Platform: String, Hashable, CaseIterable {
case watchOS
case tvOS
case macOS
case visionOS
}

View File

@ -86,6 +86,7 @@ extension Platform {
case .watchOS: return "⌚️"
case .tvOS: return "📺"
case .macOS: return "🖥"
case .visionOS: return "🕶️"
}
}
}

View File

@ -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"
}
}
}

View File

@ -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