Skip to content

Commit

Permalink
[match] Include visionOS devices in provisioning profiles (#21871)
Browse files Browse the repository at this point in the history
* VisionOS Platform in AppStoreConnect API

* VisionOS Device support in Spaceship

* Fix linting error
  • Loading branch information
peter-gyarmati committed Apr 3, 2024
1 parent 9ae433c commit d8aa8fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions spaceship/lib/spaceship/connect_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ module Platform
IOS = "IOS"
MAC_OS = "MAC_OS"
TV_OS = "TV_OS"
VISION_OS = "VISION_OS"
WATCH_OS = "WATCH_OS"

ALL = [IOS, MAC_OS, TV_OS, WATCH_OS]
ALL = [IOS, MAC_OS, TV_OS, VISION_OS, WATCH_OS]

def self.map(platform)
return platform if ALL.include?(platform)
Expand All @@ -101,6 +102,8 @@ def self.map(platform)
return Spaceship::ConnectAPI::Platform::MAC_OS
when :ios
return Spaceship::ConnectAPI::Platform::IOS
when :xros, :visionos
return Spaceship::ConnectAPI::Platform::VISION_OS
else
raise "Cannot find a matching platform for '#{platform}' - valid values are #{ALL.join(', ')}"
end
Expand All @@ -123,7 +126,7 @@ def self.map(platform)
case platform.to_sym
when :osx, :macos, :mac
return Spaceship::ConnectAPI::Platform::MAC_OS
when :ios
when :ios, :xros, :visionos
return Spaceship::ConnectAPI::Platform::IOS
else
raise "Cannot find a matching platform for '#{platform}' - valid values are #{ALL.join(', ')}"
Expand Down
6 changes: 4 additions & 2 deletions spaceship/lib/spaceship/connect_api/models/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module DeviceClass
IPOD = "IPOD"
APPLE_TV = "APPLE_TV"
MAC = "MAC"
APPLE_VISION_PRO = "APPLE_VISION_PRO"

# As of 2024-03-08, this is not _officially_ supported by App Store Connect API (according to API docs)鈥攜et still used in the API responses
APPLE_SILICON_MAC = "APPLE_SILICON_MAC"
Expand Down Expand Up @@ -69,7 +70,7 @@ def self.devices_for_platform(platform: nil, include_mac_in_profiles: false, cli
device_platform = case platform
when :osx, :macos, :mac
Spaceship::ConnectAPI::Platform::MAC_OS
when :ios, :tvos
when :ios, :tvos, :xros, :visionos
Spaceship::ConnectAPI::Platform::IOS
when :catalyst
Spaceship::ConnectAPI::Platform::MAC_OS
Expand All @@ -87,7 +88,8 @@ def self.devices_for_platform(platform: nil, include_mac_in_profiles: false, cli
Spaceship::ConnectAPI::Device::DeviceClass::IPAD,
Spaceship::ConnectAPI::Device::DeviceClass::IPHONE,
Spaceship::ConnectAPI::Device::DeviceClass::IPOD,
Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH
Spaceship::ConnectAPI::Device::DeviceClass::APPLE_WATCH,
Spaceship::ConnectAPI::Device::DeviceClass::APPLE_VISION_PRO
]
when :tvos
[
Expand Down

0 comments on commit d8aa8fc

Please sign in to comment.