Skip to content

Commit

Permalink
[visionOS] Add min_visionos_version_supported to ruby methods (facebo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi authored Jan 23, 2024
1 parent 3acdc9d commit 667d9f1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ def min_macos_version_supported
end
# macOS]

# [visionOS
def self.min_visionos_version_supported
return '1.0'
end
# visionOS]

def min_supported_versions
return { :ios => min_ios_version_supported, :osx => min_macos_version_supported } # [macOS]
return { :ios => min_ios_version_supported, :osx => min_macos_version_supported, :visionos => min_visionos_version_supported } # [macOS] # [visionOS]
end

class CodegenUtilsTests < Test::Unit::TestCase
Expand Down
5 changes: 5 additions & 0 deletions packages/react-native/scripts/cocoapods/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,10 @@ def self.min_macos_version_supported
return '10.15'
end
# macOS]
# [visionOS
def self.min_visionos_version_supported
return '1.0'
end
# visionOS]
end
end
8 changes: 7 additions & 1 deletion packages/react-native/scripts/cocoapods/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,18 @@ def self.updateOSDeploymentTarget(installer)
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] :
Helpers::Constants.min_ios_version_supported
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = [Helpers::Constants.min_ios_version_supported.to_f, old_iphone_deploy_target.to_f].max.to_s
# [macOS
# [macOS
old_macos_deploy_target = config.build_settings["MACOSX_DEPLOYMENT_TARGET"] ?
config.build_settings["MACOSX_DEPLOYMENT_TARGET"] :
Helpers::Constants.min_macos_version_supported
config.build_settings["MACOSX_DEPLOYMENT_TARGET"] = [Helpers::Constants.min_macos_version_supported.to_f, old_macos_deploy_target.to_f].max.to_s
# macOS]
# [visionOS
old_visionos_deploy_target = config.build_settings["XROS_DEPLOYMENT_TARGET"] ?
config.build_settings["XROS_DEPLOYMENT_TARGET"] :
Helpers::Constants.min_visionos_version_supported
config.build_settings["XROS_DEPLOYMENT_TARGET"] = [Helpers::Constants.min_visionos_version_supported.to_f, old_visionos_deploy_target.to_f].max.to_s
# visionOS]
end
end
end
Expand Down
8 changes: 7 additions & 1 deletion packages/react-native/scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ def min_macos_version_supported
end
# macOS]

# [visionOS
def min_visionos_version_supported
return Helpers::Constants.min_visionos_version_supported
end
# visionOS]

# This function returns the min supported OS versions supported by React Native
# By using this function, you won't have to manually change your Podfile
# when we change the minimum version supported by the framework.
def min_supported_versions
return { :ios => min_ios_version_supported, :osx => min_macos_version_supported} # [macOS]
return { :ios => min_ios_version_supported, :osx => min_macos_version_supported, :visionos => min_visionos_version_supported } # [macOS] [visionOS]
end

# This function prepares the project for React Native, before processing
Expand Down

0 comments on commit 667d9f1

Please sign in to comment.