Commit 44d6c041 authored by Boris Bügling's avatar Boris Bügling Committed by Samuel Giddins

Add `tvos` as a new platform.

parent f650a391
......@@ -177,6 +177,7 @@ Pod::Spec.new do |s|
# s.ios.deployment_target = "5.0"
# s.osx.deployment_target = "10.7"
# s.watchos.deployment_target = "2.0"
# s.tvos.deployment_target = "9.0"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
......
......@@ -52,6 +52,7 @@ module Pod
:ios => Version.new('6.0'),
:osx => Version.new('10.8'),
:watchos => Version.new('2.0'),
:tvos => Version.new('9.0'),
}
# @return [Bool] Whether the external strings file is supported by the
......
......@@ -569,10 +569,12 @@ module Pod
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
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|
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['STRIP_INSTALLED_PRODUCT'] = 'NO'
build_configuration.build_settings['CLANG_ENABLE_OBJC_ARC'] = 'YES'
end
......
......@@ -66,7 +66,7 @@ module Pod
#
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
......
......@@ -199,6 +199,7 @@ module Pod
:ios => Version.new('6'),
:osx => Version.new('10.8'),
:watchos => Version.new('2.0'),
:tvos => Version.new('9.0'),
}
# Returns the compiler flags for the source files of the given specification.
......
......@@ -94,6 +94,8 @@ module Pod
platform_message = '[OSX] '
elsif result.platforms == [:watchos]
platform_message = '[watchOS] '
elsif result.platforms == [:tvos]
platform_message = '[tvOS] '
end
subspecs_message = ''
......
......@@ -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(:osx, 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')
Dir.chdir(temporary_directory) { cmd.run }
......@@ -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(:osx, 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')
Dir.chdir(temporary_directory) { cmd.run }
......
......@@ -40,6 +40,11 @@ module Pod
@gen.generate.should.include?('#import <Foundation/Foundation.h>')
end
it 'imports Foundation for tvOS platforms' do
@gen.stubs(:platform).returns(Pod::Platform.tvos)
@gen.generate.should.include?('#import <Foundation/Foundation.h>')
end
it 'writes the header file to the disk' do
path = temporary_directory + 'Test.h'
@gen.save_as(path)
......
......@@ -268,9 +268,9 @@ module Pod
file = write_podspec(stub_podspec)
validator = Validator.new(file, SourcesManager.master.map(&:url))
validator.stubs(:validate_url)
validator.expects(:install_pod).times(3)
validator.expects(:build_pod).times(3)
validator.expects(:check_file_patterns).times(3)
validator.expects(:install_pod).times(4)
validator.expects(:build_pod).times(4)
validator.expects(:check_file_patterns).times(4)
validator.validate
end
......@@ -314,6 +314,7 @@ module Pod
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, '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.send(:perform_extensive_analysis, validator.spec)
end
......@@ -385,7 +386,7 @@ module Pod
validator.stubs(:validate_url)
git = Executable.which(: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.stubs(:success?).returns(false)
validator.stubs(:_xcodebuild).returns(['Output', status])
......@@ -402,7 +403,7 @@ module Pod
validator.stubs(:validate_url)
git = Executable.which(: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'
validator.expects(:`).with("#{command} 2>&1").once.returns('')
validator.expects(:`).with("#{command} CODE_SIGN_IDENTITY=- -sdk iphonesimulator 2>&1").once.returns('')
......@@ -536,6 +537,7 @@ module Pod
@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(:tvos, nil, true).once
@validator.expects(:podfile_from_spec).with(:watchos, nil, true).once
@validator.send(:perform_extensive_analysis, @validator.spec)
end
......@@ -547,6 +549,7 @@ module Pod
@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(:tvos, nil, false).once
@validator.expects(:podfile_from_spec).with(:watchos, nil, false).once
@validator.send(:perform_extensive_analysis, @validator.spec)
end
......@@ -601,6 +604,7 @@ module Pod
validator = test_swiftpod
p validator.results
validator.results.count.should == 0
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