Commit 7d6c3b19 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4652 from CocoaPods/fix-lint-xcode-7.2

Fix lint in Xcode 7.2, it requires `-destination`
parents 13b78034 10dd1d8e
...@@ -239,6 +239,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -239,6 +239,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[#4550](https://github.com/CocoaPods/CocoaPods/issues/4550) [#4550](https://github.com/CocoaPods/CocoaPods/issues/4550)
* Fix lint in Xcode 7.2, it requires `-destination`.
[Boris Bügling](https://github.com/neonichu)
[#4652](https://github.com/CocoaPods/CocoaPods/pull/4652)
* Empty podfiles / target blocks no longer break the user's Xcode project. * Empty podfiles / target blocks no longer break the user's Xcode project.
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
[#3617](https://github.com/CocoaPods/CocoaPods/issues/3617) [#3617](https://github.com/CocoaPods/CocoaPods/issues/3617)
......
...@@ -107,6 +107,7 @@ PATH ...@@ -107,6 +107,7 @@ PATH
cocoapods-try (~> 0.5.1) cocoapods-try (~> 0.5.1)
colored (~> 1.2) colored (~> 1.2)
escape (~> 0.0.4) escape (~> 0.0.4)
fourflusher (~> 0.3.0)
molinillo (~> 0.4.0) molinillo (~> 0.4.0)
nap (~> 1.0) nap (~> 1.0)
xcodeproj (~> 0.28.2) xcodeproj (~> 0.28.2)
...@@ -138,6 +139,7 @@ GEM ...@@ -138,6 +139,7 @@ GEM
diffy (3.1.0) diffy (3.1.0)
escape (0.0.4) escape (0.0.4)
ffi (1.9.6) ffi (1.9.6)
fourflusher (0.3.0)
fuzzy_match (2.0.4) fuzzy_match (2.0.4)
i18n (0.7.0) i18n (0.7.0)
inch (0.7.0) inch (0.7.0)
......
...@@ -44,6 +44,7 @@ Gem::Specification.new do |s| ...@@ -44,6 +44,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'escape', '~> 0.0.4' s.add_runtime_dependency 'escape', '~> 0.0.4'
s.add_runtime_dependency 'activesupport', '>= 4.0.2' s.add_runtime_dependency 'activesupport', '>= 4.0.2'
s.add_runtime_dependency 'nap', '~> 1.0' s.add_runtime_dependency 'nap', '~> 1.0'
s.add_runtime_dependency 'fourflusher', '~> 0.3.0'
s.add_development_dependency 'bundler', '~> 1.3' s.add_development_dependency 'bundler', '~> 1.3'
s.add_development_dependency 'rake', '~> 10.0' s.add_development_dependency 'rake', '~> 10.0'
......
require 'active_support/core_ext/array' require 'active_support/core_ext/array'
require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/string/inflections'
autoload :Fourflusher, 'fourflusher'
module Pod module Pod
# Validates a Specification. # Validates a Specification.
# #
...@@ -700,10 +702,13 @@ module Pod ...@@ -700,10 +702,13 @@ module Pod
case consumer.platform_name case consumer.platform_name
when :ios when :ios
command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator) command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
command += Fourflusher::SimControl.new.destination('iPhone 4s', deployment_target)
when :watchos when :watchos
command += %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator) command += %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
command += Fourflusher::SimControl.new.destination('Apple Watch - 38mm', deployment_target)
when :tvos when :tvos
command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator) command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
command += Fourflusher::SimControl.new.destination('Apple TV 1080p', deployment_target)
end end
output, status = Dir.chdir(validation_dir) { _xcodebuild(command) } output, status = Dir.chdir(validation_dir) { _xcodebuild(command) }
......
...@@ -392,12 +392,14 @@ module Pod ...@@ -392,12 +392,14 @@ module Pod
end end
it 'checks if xcodebuild returns a successful status code' do it 'checks if xcodebuild returns a successful status code' do
Fourflusher::SimControl.any_instance.stubs(:destination).returns(['-destination', 'id=XXX'])
Validator.any_instance.unstub(:xcodebuild) Validator.any_instance.unstub(:xcodebuild)
validator = Validator.new(podspec_path, SourcesManager.master.map(&:url)) validator = Validator.new(podspec_path, SourcesManager.master.map(&:url))
validator.stubs(:check_file_patterns) validator.stubs(:check_file_patterns)
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.stubs(:which).with(:xcrun)
Executable.expects(:which).with('xcodebuild').times(4).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)
...@@ -409,18 +411,23 @@ module Pod ...@@ -409,18 +411,23 @@ module Pod
end end
it 'runs xcodebuild with correct arguments for code signing' do it 'runs xcodebuild with correct arguments for code signing' do
Fourflusher::SimControl.any_instance.stubs(:destination).returns(['-destination', 'id=XXX'])
Validator.any_instance.unstub(:xcodebuild) Validator.any_instance.unstub(:xcodebuild)
validator = Validator.new(podspec_path, SourcesManager.master.map(&:url)) validator = Validator.new(podspec_path, SourcesManager.master.map(&:url))
validator.stubs(:check_file_patterns) validator.stubs(:check_file_patterns)
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.stubs(:which).with(:xcrun)
Executable.expects(:which).with('xcodebuild').times(4).returns('/usr/bin/xcodebuild') Executable.expects(:which).with('xcodebuild').times(4).returns('/usr/bin/xcodebuild')
command = %w(clean build -workspace App.xcworkspace -scheme App -configuration Release) command = %w(clean build -workspace App.xcworkspace -scheme App -configuration Release)
Executable.expects(:capture_command).with('xcodebuild', command, :capture => :merge).once.returns(['', stub(:success? => true)]) Executable.expects(:capture_command).with('xcodebuild', command, :capture => :merge).once.returns(['', stub(:success? => true)])
Executable.expects(:capture_command).with('xcodebuild', command + %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator), :capture => :merge).once.returns(['', stub(:success? => true)]) args = %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator) + Fourflusher::SimControl.new.destination('Apple TV 1080p')
Executable.expects(:capture_command).with('xcodebuild', command + %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator), :capture => :merge).once.returns(['', stub(:success? => true)]) Executable.expects(:capture_command).with('xcodebuild', command + args, :capture => :merge).once.returns(['', stub(:success? => true)])
Executable.expects(:capture_command).with('xcodebuild', command + %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator), :capture => :merge).once.returns(['', stub(:success? => true)]) args = %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator) + Fourflusher::SimControl.new.destination('iPhone 4s')
Executable.expects(:capture_command).with('xcodebuild', command + args, :capture => :merge).once.returns(['', stub(:success? => true)])
args = %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator) + Fourflusher::SimControl.new.destination('Apple Watch - 38mm')
Executable.expects(:capture_command).with('xcodebuild', command + args, :capture => :merge).once.returns(['', stub(:success? => true)])
validator.validate validator.validate
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