Commit a1204044 authored by Boris Bügling's avatar Boris Bügling

Merge pull request #4152 from CocoaPods/tvos

Add `tvos` as a new platform
parents 2b774017 50d460ba
...@@ -34,6 +34,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -34,6 +34,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
* Podfile generated by `pod init` now specifies iOS 8.0 as the default platform * Podfile generated by `pod init` now specifies iOS 8.0 as the default platform
and includes `use_frameworks!` for Swift projects. and includes `use_frameworks!` for Swift projects.
[Jamie Evans](https://github.com/JamieREvans) [Jamie Evans](https://github.com/JamieREvans)
* Support for the new `tvos` platform.
[Boris Bügling](https://github.com/neonichu)
[#4152](https://github.com/CocoaPods/CocoaPods/pull/4152)
* Either generate just one pod target or generate it once for each target * Either generate just one pod target or generate it once for each target
definition. definition.
......
...@@ -7,11 +7,11 @@ GIT ...@@ -7,11 +7,11 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Core.git remote: https://github.com/CocoaPods/Core.git
revision: 9b06e3d9a6212cabf7ab6e3a77c849df3a983a4f revision: 9cc774457e8326e7fed6961bab83cefeac67f266
branch: master branch: master
specs: specs:
cocoapods-core (0.39.0.beta.4) cocoapods-core (0.39.0.beta.4)
activesupport (>= 3.2.15) activesupport (>= 4.0.2)
fuzzy_match (~> 2.0.4) fuzzy_match (~> 2.0.4)
nap (~> 1.0) nap (~> 1.0)
...@@ -24,7 +24,7 @@ GIT ...@@ -24,7 +24,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Xcodeproj.git remote: https://github.com/CocoaPods/Xcodeproj.git
revision: 27aecbfd66e883d1df616355347246b30fec551d revision: 8347cca0149d6506c0a785a8faa7f6a17dee29fd
branch: master branch: master
specs: specs:
xcodeproj (0.27.2) xcodeproj (0.27.2)
......
...@@ -178,6 +178,7 @@ Pod::Spec.new do |s| ...@@ -178,6 +178,7 @@ Pod::Spec.new do |s|
# s.ios.deployment_target = "5.0" # s.ios.deployment_target = "5.0"
# s.osx.deployment_target = "10.7" # s.osx.deployment_target = "10.7"
# s.watchos.deployment_target = "2.0" # s.watchos.deployment_target = "2.0"
# s.tvos.deployment_target = "9.0"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
......
...@@ -52,6 +52,7 @@ module Pod ...@@ -52,6 +52,7 @@ module Pod
:ios => Version.new('6.0'), :ios => Version.new('6.0'),
:osx => Version.new('10.8'), :osx => Version.new('10.8'),
:watchos => Version.new('2.0'), :watchos => Version.new('2.0'),
:tvos => Version.new('9.0'),
} }
# @return [Bool] Whether the external strings file is supported by the # @return [Bool] Whether the external strings file is supported by the
......
...@@ -84,6 +84,7 @@ module Pod ...@@ -84,6 +84,7 @@ module Pod
def generate_platform_import_header def generate_platform_import_header
case platform.name case platform.name
when :ios then "#import <UIKit/UIKit.h>\n" when :ios then "#import <UIKit/UIKit.h>\n"
when :tvos then "#import <UIKit/UIKit.h>\n"
when :osx then "#import <Cocoa/Cocoa.h>\n" when :osx then "#import <Cocoa/Cocoa.h>\n"
else "#import <Foundation/Foundation.h>\n" else "#import <Foundation/Foundation.h>\n"
end end
......
...@@ -569,10 +569,12 @@ module Pod ...@@ -569,10 +569,12 @@ module Pod
osx_deployment_target = platforms.select { |p| p.name == :osx }.map(&:deployment_target).min osx_deployment_target = platforms.select { |p| p.name == :osx }.map(&:deployment_target).min
ios_deployment_target = platforms.select { |p| p.name == :ios }.map(&:deployment_target).min 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 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
@pods_project.build_configurations.each do |build_configuration| @pods_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['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['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['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['STRIP_INSTALLED_PRODUCT'] = 'NO' build_configuration.build_settings['STRIP_INSTALLED_PRODUCT'] = 'NO'
build_configuration.build_settings['CLANG_ENABLE_OBJC_ARC'] = 'YES' build_configuration.build_settings['CLANG_ENABLE_OBJC_ARC'] = 'YES'
end end
......
...@@ -66,7 +66,7 @@ module Pod ...@@ -66,7 +66,7 @@ module Pod
# #
attr_accessor :specs attr_accessor :specs
# @return [Symbol] The platform (either `:ios`, `:watchos` or `:osx`). # @return [Symbol] The platform (either `:ios`, `:watchos`, `:tvos`, or `:osx`).
# #
attr_accessor :platform_name attr_accessor :platform_name
......
...@@ -199,6 +199,7 @@ module Pod ...@@ -199,6 +199,7 @@ module Pod
:ios => Version.new('6'), :ios => Version.new('6'),
:osx => Version.new('10.8'), :osx => Version.new('10.8'),
:watchos => Version.new('2.0'), :watchos => Version.new('2.0'),
:tvos => Version.new('9.0'),
} }
# Returns the compiler flags for the source files of the given specification. # Returns the compiler flags for the source files of the given specification.
......
...@@ -94,6 +94,8 @@ module Pod ...@@ -94,6 +94,8 @@ module Pod
platform_message = '[OSX] ' platform_message = '[OSX] '
elsif result.platforms == [:watchos] elsif result.platforms == [:watchos]
platform_message = '[watchOS] ' platform_message = '[watchOS] '
elsif result.platforms == [:tvos]
platform_message = '[tvOS] '
end end
subspecs_message = '' subspecs_message = ''
...@@ -615,6 +617,8 @@ module Pod ...@@ -615,6 +617,8 @@ module Pod
command << ' CODE_SIGN_IDENTITY=- -sdk iphonesimulator' command << ' CODE_SIGN_IDENTITY=- -sdk iphonesimulator'
when :watchos when :watchos
command << ' CODE_SIGN_IDENTITY=- -sdk watchsimulator' command << ' CODE_SIGN_IDENTITY=- -sdk watchsimulator'
when :tvos
command << ' CODE_SIGN_IDENTITY=- -sdk appletvsimulator'
end end
output, status = _xcodebuild "#{command} 2>&1" output, status = _xcodebuild "#{command} 2>&1"
......
...@@ -141,6 +141,7 @@ module Pod ...@@ -141,6 +141,7 @@ module Pod
Validator.any_instance.expects(:podfile_from_spec).with(:ios, nil, true).times(3) Validator.any_instance.expects(:podfile_from_spec).with(:ios, nil, true).times(3)
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, true).twice Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, true).twice
Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, true).twice Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, true).twice
Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, true).twice
cmd = command('repo', 'push', 'master') cmd = command('repo', 'push', 'master')
Dir.chdir(temporary_directory) { cmd.run } Dir.chdir(temporary_directory) { cmd.run }
...@@ -150,6 +151,7 @@ module Pod ...@@ -150,6 +151,7 @@ module Pod
Validator.any_instance.expects(:podfile_from_spec).with(:ios, nil, false).times(3) Validator.any_instance.expects(:podfile_from_spec).with(:ios, nil, false).times(3)
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, false).twice Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, false).twice
Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, false).twice Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, false).twice
Validator.any_instance.expects(:podfile_from_spec).with(:tvos, nil, false).twice
cmd = command('repo', 'push', 'master', '--use-libraries') cmd = command('repo', 'push', 'master', '--use-libraries')
Dir.chdir(temporary_directory) { cmd.run } Dir.chdir(temporary_directory) { cmd.run }
......
...@@ -40,6 +40,11 @@ module Pod ...@@ -40,6 +40,11 @@ module Pod
@gen.generate.should.include?('#import <Foundation/Foundation.h>') @gen.generate.should.include?('#import <Foundation/Foundation.h>')
end end
it 'imports Foundation for tvOS platforms' do
@gen.stubs(:platform).returns(Pod::Platform.tvos)
@gen.generate.should.include?('#import <UIKit/UIKit.h>')
end
it 'writes the header file to the disk' do it 'writes the header file to the disk' do
path = temporary_directory + 'Test.h' path = temporary_directory + 'Test.h'
@gen.save_as(path) @gen.save_as(path)
......
...@@ -268,9 +268,9 @@ module Pod ...@@ -268,9 +268,9 @@ module Pod
file = write_podspec(stub_podspec) file = write_podspec(stub_podspec)
validator = Validator.new(file, SourcesManager.master.map(&:url)) validator = Validator.new(file, SourcesManager.master.map(&:url))
validator.stubs(:validate_url) validator.stubs(:validate_url)
validator.expects(:install_pod).times(3) validator.expects(:install_pod).times(4)
validator.expects(:build_pod).times(3) validator.expects(:build_pod).times(4)
validator.expects(:check_file_patterns).times(3) validator.expects(:check_file_patterns).times(4)
validator.validate validator.validate
end end
...@@ -314,6 +314,7 @@ module Pod ...@@ -314,6 +314,7 @@ module Pod
validator.expects(:podfile_from_spec).with(:osx, nil, nil).once validator.expects(:podfile_from_spec).with(:osx, nil, nil).once
validator.expects(:podfile_from_spec).with(:ios, nil, nil).once validator.expects(:podfile_from_spec).with(:ios, nil, nil).once
validator.expects(:podfile_from_spec).with(:ios, '7.0', nil).once validator.expects(:podfile_from_spec).with(:ios, '7.0', nil).once
validator.expects(:podfile_from_spec).with(:tvos, nil, nil).once
validator.expects(:podfile_from_spec).with(:watchos, nil, nil).once validator.expects(:podfile_from_spec).with(:watchos, nil, nil).once
validator.send(:perform_extensive_analysis, validator.spec) validator.send(:perform_extensive_analysis, validator.spec)
end end
...@@ -385,7 +386,7 @@ module Pod ...@@ -385,7 +386,7 @@ module Pod
validator.stubs(:validate_url) validator.stubs(:validate_url)
git = Executable.which(:git) git = Executable.which(:git)
Executable.stubs(:which).with('git').returns(git) Executable.stubs(:which).with('git').returns(git)
Executable.expects(:which).with('xcodebuild').times(3).returns('/usr/bin/xcodebuild') Executable.expects(:which).with('xcodebuild').times(4).returns('/usr/bin/xcodebuild')
status = mock status = mock
status.stubs(:success?).returns(false) status.stubs(:success?).returns(false)
validator.stubs(:_xcodebuild).returns(['Output', status]) validator.stubs(:_xcodebuild).returns(['Output', status])
...@@ -402,9 +403,10 @@ module Pod ...@@ -402,9 +403,10 @@ module Pod
validator.stubs(:validate_url) validator.stubs(:validate_url)
git = Executable.which(:git) git = Executable.which(:git)
Executable.stubs(:which).with('git').returns(git) Executable.stubs(:which).with('git').returns(git)
Executable.expects(:which).with('xcodebuild').times(3).returns('/usr/bin/xcodebuild') Executable.expects(:which).with('xcodebuild').times(4).returns('/usr/bin/xcodebuild')
command = 'xcodebuild clean build -target Pods' command = 'xcodebuild clean build -target Pods'
validator.expects(:`).with("#{command} 2>&1").once.returns('') validator.expects(:`).with("#{command} 2>&1").once.returns('')
validator.expects(:`).with("#{command} CODE_SIGN_IDENTITY=- -sdk appletvsimulator 2>&1").once.returns('')
validator.expects(:`).with("#{command} CODE_SIGN_IDENTITY=- -sdk iphonesimulator 2>&1").once.returns('') validator.expects(:`).with("#{command} CODE_SIGN_IDENTITY=- -sdk iphonesimulator 2>&1").once.returns('')
validator.expects(:`).with("#{command} CODE_SIGN_IDENTITY=- -sdk watchsimulator 2>&1").once.returns('') validator.expects(:`).with("#{command} CODE_SIGN_IDENTITY=- -sdk watchsimulator 2>&1").once.returns('')
validator.validate validator.validate
...@@ -536,6 +538,7 @@ module Pod ...@@ -536,6 +538,7 @@ module Pod
@validator.expects(:podfile_from_spec).with(:osx, nil, true).once @validator.expects(:podfile_from_spec).with(:osx, nil, true).once
@validator.expects(:podfile_from_spec).with(:ios, nil, true).once @validator.expects(:podfile_from_spec).with(:ios, nil, true).once
@validator.expects(:podfile_from_spec).with(:tvos, nil, true).once
@validator.expects(:podfile_from_spec).with(:watchos, nil, true).once @validator.expects(:podfile_from_spec).with(:watchos, nil, true).once
@validator.send(:perform_extensive_analysis, @validator.spec) @validator.send(:perform_extensive_analysis, @validator.spec)
end end
...@@ -547,6 +550,7 @@ module Pod ...@@ -547,6 +550,7 @@ module Pod
@validator.expects(:podfile_from_spec).with(:osx, nil, false).once @validator.expects(:podfile_from_spec).with(:osx, nil, false).once
@validator.expects(:podfile_from_spec).with(:ios, nil, false).once @validator.expects(:podfile_from_spec).with(:ios, nil, false).once
@validator.expects(:podfile_from_spec).with(:tvos, nil, false).once
@validator.expects(:podfile_from_spec).with(:watchos, nil, false).once @validator.expects(:podfile_from_spec).with(:watchos, nil, false).once
@validator.send(:perform_extensive_analysis, @validator.spec) @validator.send(:perform_extensive_analysis, @validator.spec)
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment