Skip to content

Commit

Permalink
Update constants for Xcode 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amorde committed Oct 26, 2024
1 parent 3157b7c commit 217bbc6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions lib/xcodeproj/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ module Xcodeproj
module Constants
# @return [String] The last known iOS SDK (stable).
#
LAST_KNOWN_IOS_SDK = '14.0'
LAST_KNOWN_IOS_SDK = '18.0'

# @return [String] The last known OS X SDK (stable).
#
LAST_KNOWN_OSX_SDK = '10.15'
LAST_KNOWN_OSX_SDK = '15.0'

# @return [String] The last known tvOS SDK (stable).
#
LAST_KNOWN_TVOS_SDK = '14.0'
LAST_KNOWN_TVOS_SDK = '18.0'

# @return [String] The last known visionOS SDK (unstable).
#
LAST_KNOWN_VISIONOS_SDK = '1.0'
LAST_KNOWN_VISIONOS_SDK = '2.0'

# @return [String] The last known watchOS SDK (stable).
#
LAST_KNOWN_WATCHOS_SDK = '7.0'
LAST_KNOWN_WATCHOS_SDK = '11.0'

# @return [String] The last known archive version to Xcodeproj.
#
Expand All @@ -36,15 +36,15 @@ module Constants

# @return [String] The last known object version to Xcodeproj.
#
LAST_KNOWN_OBJECT_VERSION = 70
LAST_KNOWN_OBJECT_VERSION = 77

# @return [String] The last known Xcode version to Xcodeproj.
#
LAST_UPGRADE_CHECK = '1500'
LAST_UPGRADE_CHECK = '1600'

# @return [String] The last known Xcode version to Xcodeproj.
#
LAST_SWIFT_UPGRADE_CHECK = '1500'
LAST_SWIFT_UPGRADE_CHECK = '1600'

# @return [String] The version of `.xcscheme` files supported by Xcodeproj
#
Expand Down Expand Up @@ -132,7 +132,7 @@ module Constants
# @return [Hash] The compatibility version string for different object versions.
#
COMPATIBILITY_VERSION_BY_OBJECT_VERSION = {
70 => 'Xcode 16.0',
77 => 'Xcode 16.0',
63 => 'Xcode 15.3',
60 => 'Xcode 15.0',
56 => 'Xcode 14.0',
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproj/project/object/root_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PBXProject < AbstractObject

# @return [String] preferred project object version
#
attribute :preferred_project_object_version, String, '70'
attribute :preferred_project_object_version, String, Constants::LAST_KNOWN_OBJECT_VERSION.to_s

# @return [PBXGroup] the group containing the references to products of
# the project.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 4 additions & 4 deletions spec/project/object/native_target_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ module ProjectSpecs
it 'adds a file reference for a system framework, in a dedicated subgroup of the Frameworks group' do
@target.add_system_framework('QuartzCore')
file = @project['Frameworks/iOS'].files.first
file.path.should == 'Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/QuartzCore.framework'
file.path.should == 'Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/System/Library/Frameworks/QuartzCore.framework'
file.source_tree.should == 'DEVELOPER_DIR'
end

Expand All @@ -625,21 +625,21 @@ module ProjectSpecs
@target.build_configuration_list.set_setting('SDKROOT', 'appletvos')
@target.add_system_framework('TVServices')
file = @project['Frameworks/tvOS'].files.first
file.path.scan(/\d\d\.\d/).first.should == Xcodeproj::Constants::LAST_KNOWN_TVOS_SDK
file.path.scan(/\d+\.\d/).first.should == Xcodeproj::Constants::LAST_KNOWN_TVOS_SDK
end

it 'uses the last known visionOS SDK version if none is specified in the target' do
@target.build_configuration_list.set_setting('SDKROOT', 'xros')
@target.add_system_framework('ARKit')
file = @project['Frameworks/visionOS'].files.first
file.path.scan(/\d\.\d/).first.should == Xcodeproj::Constants::LAST_KNOWN_VISIONOS_SDK
file.path.scan(/\d+.\d/).first.should == Xcodeproj::Constants::LAST_KNOWN_VISIONOS_SDK
end

it 'uses the last known watchOS SDK version if none is specified in the target' do
@target.build_configuration_list.set_setting('SDKROOT', 'watchos')
@target.add_system_framework('WatchConnectivity')
file = @project['Frameworks/watchOS'].files.first
file.path.scan(/\d\.\d/).first.should == Xcodeproj::Constants::LAST_KNOWN_WATCHOS_SDK
file.path.scan(/\d+\.\d/).first.should == Xcodeproj::Constants::LAST_KNOWN_WATCHOS_SDK
end

it "doesn't duplicate references to a frameworks if one already exists" do
Expand Down
2 changes: 1 addition & 1 deletion spec/project/object/root_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module ProjectSpecs
end

it 'returns the preferred project object version' do
@root_object.preferred_project_object_version.should == '70'
@root_object.preferred_project_object_version.should == '77'
end

it 'returns the products group' do
Expand Down
2 changes: 1 addition & 1 deletion spec/scheme_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ module ProjectSpecs
expected = <<-XML.gsub(/^ {8}/, '')
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit 217bbc6

Please sign in to comment.