Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visionos as a new platform #11965

Merged
merged 5 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Enhancements

* None.
* Add `visionOS` as a new platform.
[Gabriel Donadel](https://github.com/gabrieldonadel)
[#11965](https://github.com/CocoaPods/CocoaPods/pull/11965)

##### Bug Fixes

Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GIT

GIT
remote: https://github.com/CocoaPods/Core.git
revision: 01226592d7a295cb5567d346f996af5b3bfed2f6
revision: 9320bf557741d7ae80eda4415bc6fb2b0b3a8b9c
branch: master
specs:
cocoapods-core (1.12.1)
Expand Down Expand Up @@ -37,7 +37,7 @@ GIT

GIT
remote: https://github.com/CocoaPods/Xcodeproj.git
revision: 2fe65ce43a244370c245bcbf4176f16ff0f442cf
revision: 2ce68b60856c4680c2b3cd7aa5b221529120c7c4
branch: master
specs:
xcodeproj (1.22.0)
Expand Down Expand Up @@ -143,7 +143,7 @@ GEM
specs:
CFPropertyList (3.0.6)
rexml
activesupport (6.1.7.3)
activesupport (6.1.7.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -224,7 +224,7 @@ GEM
rchardet (~> 1.8)
hashdiff (1.0.1)
httpclient (2.8.3)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
inch (0.8.0)
pry
Expand All @@ -245,7 +245,7 @@ GEM
rb-kqueue (>= 0.2)
metaclass (0.0.4)
method_source (0.8.2)
minitest (5.18.0)
minitest (5.18.1)
mocha (1.4.0)
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.3)
Expand Down Expand Up @@ -321,7 +321,7 @@ GEM
webrick (1.7.0)
yard (0.9.27)
webrick (~> 1.7.0)
zeitwerk (2.6.7)
zeitwerk (2.6.8)

PLATFORMS
ruby
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 = "1300"
LastUpgradeVersion = "1500"
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 = "1300"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
1 change: 1 addition & 0 deletions lib/cocoapods/command/spec/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def spec_template(data)
# spec.osx.deployment_target = "10.7"
# spec.watchos.deployment_target = "2.0"
# spec.tvos.deployment_target = "9.0"
# spec.visionos.deployment_target = "1.0"


# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand Down
1 change: 1 addition & 0 deletions lib/cocoapods/generator/copy_resources_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def generate
:osx => Version.new('10.8'),
:watchos => Version.new('2.0'),
:tvos => Version.new('9.0'),
:visionos => Version.new('1.0'),
}

# @return [Boolean] Whether the external strings file is supported by the
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods/installer/base_install_hooks_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class UmbrellaTargetDescription
#
attr_reader :specs

# @return [Symbol] The platform (either `:ios`, `:watchos`, `:tvos`, or `:osx`).
# @return [Symbol] The platform (either `:ios`, `:watchos`, `:tvos`, `:visionos`, or `:osx`).
#
attr_reader :platform_name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ def create_build_phase_to_symlink_header_folders(native_target)
:osx => Version.new('10.8'),
:watchos => Version.new('2.0'),
:tvos => Version.new('9.0'),
:visionos => Version.new('1.0'),
}.freeze

# Returns the compiler flags for the source files of the given specification.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ def prepare(sandbox, project, pod_targets, build_configurations, platforms, podf
ios_deployment_target = platforms.select { |p| p.name == :ios }.map(&:deployment_target).min
watchos_deployment_target = platforms.select { |p| p.name == :watchos }.map(&:deployment_target).min
tvos_deployment_target = platforms.select { |p| p.name == :tvos }.map(&:deployment_target).min
visionos_deployment_target = platforms.select { |p| p.name == :visionos }.map(&:deployment_target).min
project.build_configurations.each do |build_configuration|
build_configuration.build_settings['MACOSX_DEPLOYMENT_TARGET'] = osx_deployment_target.to_s if osx_deployment_target
build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = ios_deployment_target.to_s if ios_deployment_target
build_configuration.build_settings['WATCHOS_DEPLOYMENT_TARGET'] = watchos_deployment_target.to_s if watchos_deployment_target
build_configuration.build_settings['TVOS_DEPLOYMENT_TARGET'] = tvos_deployment_target.to_s if tvos_deployment_target
build_configuration.build_settings['XROS_DEPLOYMENT_TARGET'] = visionos_deployment_target.to_s if visionos_deployment_target
build_configuration.build_settings['STRIP_INSTALLED_PRODUCT'] = 'NO'
build_configuration.build_settings['CLANG_ENABLE_OBJC_ARC'] = 'YES'
build_configuration.build_settings['CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED'] = 'YES'
Expand Down
5 changes: 5 additions & 0 deletions lib/cocoapods/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def results_message
platform_message = '[watchOS] '
elsif result.platforms == [:tvos]
platform_message = '[tvOS] '
elsif result.platforms == [:visionos]
platform_message = '[visionOS] '
end

subspecs_message = ''
Expand Down Expand Up @@ -1104,6 +1106,9 @@ def xcodebuild(action, scheme, configuration, deployment_target:)
when :tvos
command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
command += Fourflusher::SimControl.new.destination(:oldest, 'tvOS', deployment_target)
when :visionos
command += %w(CODE_SIGN_IDENTITY=- -sdk xrsimulator)
command += Fourflusher::SimControl.new.destination(:oldest, 'visionOS', deployment_target)
end

if analyze
Expand Down
2 changes: 1 addition & 1 deletion spec/cocoapods-integration-specs
3 changes: 3 additions & 0 deletions spec/functional/command/repo/push_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ module Pod
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, true, [], false, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, true, [], false, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, true, [], false, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:visionos, nil, true, [], false, nil).twice.returns(stub('Podfile'))

cmd = command('repo', 'push', 'master')
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
Expand All @@ -232,6 +233,7 @@ module Pod
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, false, [], false, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, false, [], false, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, false, [], false, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:visionos, nil, false, [], false, nil).twice.returns(stub('Podfile'))

cmd = command('repo', 'push', 'master', '--use-libraries')
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
Expand All @@ -246,6 +248,7 @@ module Pod
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, false, [], true, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, false, [], true, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, false, [], true, nil).twice.returns(stub('Podfile'))
Validator.any_instance.expects(:podfile_from_spec).with(:visionos, nil, false, [], true, nil).twice.returns(stub('Podfile'))

cmd = command('repo', 'push', 'master', '--use-libraries', '--use-modular-headers')
# Git push will throw an exception here since this is a local custom git repo. All we care is the validator
Expand Down
21 changes: 17 additions & 4 deletions spec/unit/validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ def podspec_path(name = 'JSONKit', version = '1.4', source = nil)
file = write_podspec(stub_podspec)
validator = Validator.new(file, config.sources_manager.master.map(&:url))
validator.stubs(:validate_url)
validator.expects(:install_pod).times(4)
validator.expects(:build_pod).times(4)
validator.expects(:add_app_project_import).times(4)
validator.expects(:check_file_patterns).times(4)
validator.expects(:install_pod).times(5)
validator.expects(:build_pod).times(5)
validator.expects(:add_app_project_import).times(5)
validator.expects(:check_file_patterns).times(5)
validator.validate
end

Expand Down Expand Up @@ -608,6 +608,7 @@ def podspec_path(name = 'JSONKit', version = '1.4', source = nil)
validator.expects(:podfile_from_spec).with(:ios, nil, false, [], nil, nil).once.returns(stub('Podfile'))
validator.expects(:podfile_from_spec).with(:ios, '7.0', false, [], nil, nil).once.returns(stub('Podfile'))
validator.expects(:podfile_from_spec).with(:tvos, nil, false, [], nil, nil).once.returns(stub('Podfile'))
validator.expects(:podfile_from_spec).with(:visionos, nil, false, [], nil, nil).once.returns(stub('Podfile'))
validator.expects(:podfile_from_spec).with(:watchos, nil, false, [], nil, nil).once.returns(stub('Podfile'))
validator.send(:perform_extensive_analysis, validator.spec)

Expand Down Expand Up @@ -821,6 +822,8 @@ def podspec_path(name = 'JSONKit', version = '1.4', source = nil)
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator) + Fourflusher::SimControl.new.destination('iPhone 4s')
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk xrsimulator) + Fourflusher::SimControl.new.destination('Apple Vision Pro')
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
validator.validate.should == true
Expand Down Expand Up @@ -850,6 +853,8 @@ def podspec_path(name = 'JSONKit', version = '1.4', source = nil)
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator) + Fourflusher::SimControl.new.destination('iPhone 4s')
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk xrsimulator) + Fourflusher::SimControl.new.destination('Apple Vision Pro')
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
validator.validate.should == true
Expand Down Expand Up @@ -881,6 +886,8 @@ def podspec_path(name = 'JSONKit', version = '1.4', source = nil)
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator) + Fourflusher::SimControl.new.destination('iPhone 4s') + analyzer_args
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk xrsimulator) + Fourflusher::SimControl.new.destination('Apple Vision Pro') + analyzer_args
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator) + analyzer_args
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
validator.validate.should == true
Expand Down Expand Up @@ -913,6 +920,8 @@ def podspec_path(name = 'JSONKit', version = '1.4', source = nil)
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator) + Fourflusher::SimControl.new.destination('iPhone 4s') + analyzer_args
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk xrsimulator) + Fourflusher::SimControl.new.destination('Apple Vision Pro') + analyzer_args
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator) + analyzer_args
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
validator.validate.should == true
Expand All @@ -937,6 +946,8 @@ def podspec_path(name = 'JSONKit', version = '1.4', source = nil)
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator) + Fourflusher::SimControl.new.destination('iPhone 4s')
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk xrsimulator) + Fourflusher::SimControl.new.destination('Apple Vision Pro')
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
args = %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
Executable.expects(:execute_command).with('xcodebuild', command + args, true).once.returns('')
validator.validate
Expand Down Expand Up @@ -1275,6 +1286,7 @@ def setup_validator
@validator.expects(:podfile_from_spec).with(:osx, nil, true, [], nil, nil).once.returns(stub('Podfile'))
@validator.expects(:podfile_from_spec).with(:ios, '8.0', true, [], nil, nil).once.returns(stub('Podfile'))
@validator.expects(:podfile_from_spec).with(:tvos, nil, true, [], nil, nil).once.returns(stub('Podfile'))
@validator.expects(:podfile_from_spec).with(:visionos, nil, true, [], nil, nil).once.returns(stub('Podfile'))
@validator.expects(:podfile_from_spec).with(:watchos, nil, true, [], nil, nil).once.returns(stub('Podfile'))
@validator.send(:perform_extensive_analysis, @validator.spec)

Expand All @@ -1289,6 +1301,7 @@ def setup_validator
@validator.expects(:podfile_from_spec).with(:osx, nil, false, [], nil, nil).once.returns(stub('Podfile'))
@validator.expects(:podfile_from_spec).with(:ios, nil, false, [], nil, nil).once.returns(stub('Podfile'))
@validator.expects(:podfile_from_spec).with(:tvos, nil, false, [], nil, nil).once.returns(stub('Podfile'))
@validator.expects(:podfile_from_spec).with(:visionos, nil, false, [], nil, nil).once.returns(stub('Podfile'))
@validator.expects(:podfile_from_spec).with(:watchos, nil, false, [], nil, nil).once.returns(stub('Podfile'))
@validator.send(:perform_extensive_analysis, @validator.spec)

Expand Down