Update CocoaPods specs to run on Linux

parent 4ee74e2b
language: ruby
cache: bundler cache: bundler
matrix: matrix:
...@@ -37,6 +38,8 @@ before_install: ...@@ -37,6 +38,8 @@ before_install:
- if [ "$TRAVIS_RUBY_VERSION" = "system" ]; then sudo gem update --system; fi - if [ "$TRAVIS_RUBY_VERSION" = "system" ]; then sudo gem update --system; fi
before_script: before_script:
- git config --global user.email "tests@cocoapods.org"
- git config --global user.name "CocoaPods Tests"
- bundle exec pod env - bundle exec pod env
script: script:
......
...@@ -518,7 +518,7 @@ module Pod ...@@ -518,7 +518,7 @@ module Pod
# @return [void] # @return [void]
# #
def build_pod def build_pod
if Executable.which('xcodebuild').nil? if !xcodebuild_available?
UI.warn "Skipping compilation with `xcodebuild' because it can't be found.\n".yellow UI.warn "Skipping compilation with `xcodebuild' because it can't be found.\n".yellow
else else
UI.message "\nBuilding with xcodebuild.\n".yellow do UI.message "\nBuilding with xcodebuild.\n".yellow do
...@@ -549,6 +549,10 @@ module Pod ...@@ -549,6 +549,10 @@ module Pod
end end
end end
def xcodebuild_available?
!Executable.which('xcodebuild').nil?
end
FILE_PATTERNS = %i(source_files resources preserve_paths vendored_libraries FILE_PATTERNS = %i(source_files resources preserve_paths vendored_libraries
vendored_frameworks public_header_files preserve_paths vendored_frameworks public_header_files preserve_paths
private_header_files resource_bundles).freeze private_header_files resource_bundles).freeze
......
...@@ -56,7 +56,7 @@ module Pod ...@@ -56,7 +56,7 @@ module Pod
generator.save_as(file) generator.save_as(file)
`plutil -lint #{file}` `plutil -lint #{file}`
$?.should.be.success $?.should.be.success
end end if Executable.which('plutil')
it 'generates a correct Info.plist file' do it 'generates a correct Info.plist file' do
generator = Generator::InfoPlistFile.new(mock('Target', :platform => stub(:name => :ios))) generator = Generator::InfoPlistFile.new(mock('Target', :platform => stub(:name => :ios)))
......
...@@ -84,7 +84,7 @@ module Pod ...@@ -84,7 +84,7 @@ module Pod
it 'handles symlinks in /tmp' do it 'handles symlinks in /tmp' do
tmp_sandbox = Pod::Sandbox.new('/tmp/CocoaPods') tmp_sandbox = Pod::Sandbox.new('/tmp/CocoaPods')
tmp_sandbox.root.should.be == Pathname.new('/private/tmp/CocoaPods') tmp_sandbox.root.should.be == Pathname.new('/tmp/CocoaPods').realpath
require 'fileutils' require 'fileutils'
FileUtils.rm_rf(tmp_sandbox.root) FileUtils.rm_rf(tmp_sandbox.root)
end end
......
...@@ -17,6 +17,7 @@ module Pod ...@@ -17,6 +17,7 @@ module Pod
describe Validator do describe Validator do
before do before do
Validator.any_instance.stubs(:xcodebuild).returns('') Validator.any_instance.stubs(:xcodebuild).returns('')
Validator.any_instance.stubs(:xcodebuild_available?).returns(true)
end end
# @return [void] # @return [void]
...@@ -413,7 +414,6 @@ module Pod ...@@ -413,7 +414,6 @@ module Pod
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.stubs(:which).with(:xcrun)
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])
...@@ -434,7 +434,6 @@ module Pod ...@@ -434,7 +434,6 @@ module Pod
Executable.stubs(:which).with('git').returns(git) Executable.stubs(:which).with('git').returns(git)
Executable.stubs(:capture_command).with('git', ['config', '--get', 'remote.origin.url'], :capture => :out).returns(['https://github.com/CocoaPods/Specs.git']) Executable.stubs(:capture_command).with('git', ['config', '--get', 'remote.origin.url'], :capture => :out).returns(['https://github.com/CocoaPods/Specs.git'])
Executable.stubs(:which).with(:xcrun) Executable.stubs(:which).with(:xcrun)
Executable.expects(:which).with('xcodebuild').times(4).returns('/usr/bin/xcodebuild')
command = ['clean', 'build', '-workspace', File.join(validator.validation_dir, 'App.xcworkspace'), '-scheme', 'App', '-configuration', 'Release'] command = ['clean', 'build', '-workspace', File.join(validator.validation_dir, '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)])
args = %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator) + Fourflusher::SimControl.new.destination('Apple TV 1080p') args = %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator) + Fourflusher::SimControl.new.destination('Apple TV 1080p')
......
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