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

Add `--use-libraries` option for `pod repo push`

parent c64bd68b
......@@ -21,6 +21,7 @@ module Pod
def self.options
[['--allow-warnings', 'Allows pushing even if there are warnings'],
['--use-libraries', 'Linter uses static libraries to install the spec'],
['--local-only', 'Does not perform the step of pushing REPO to its remote']].concat(super)
end
......@@ -29,6 +30,7 @@ module Pod
@local_only = argv.flag?('local-only')
@repo = argv.shift_argument
@podspec = argv.shift_argument
@use_frameworks = !argv.flag?('use-libraries')
super
end
......@@ -84,6 +86,7 @@ module Pod
podspec_files.each do |podspec|
validator = Validator.new(podspec, SourcesManager.all.map(&:url))
validator.allow_warnings = @allow_warnings
validator.use_frameworks = @use_frameworks
begin
validator.validate
rescue => e
......
......@@ -96,5 +96,32 @@ module Pod
Dir.chdir(@upstream) { `git checkout master -q` }
(@upstream + 'PushTest/1.4/PushTest.podspec').read.should.include('PushTest')
end
before do
Installer.any_instance.stubs(:aggregate_targets).returns([])
Installer.any_instance.stubs(:install!)
Validator.any_instance.stubs(:check_file_patterns)
Validator.any_instance.stubs(:validated?).returns(true)
Validator.any_instance.stubs(:validate_url)
Validator.any_instance.stubs(:validate_screenshots)
Validator.any_instance.stubs(:xcodebuild).returns('')
end
it 'validates specs as frameworks by default' do
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
cmd = command('repo', 'push', 'master')
Dir.chdir(temporary_directory) { cmd.run }
end
it 'validates specs as libraries if requested' do
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
cmd = command('repo', 'push', 'master', '--use-libraries')
Dir.chdir(temporary_directory) { cmd.run }
end
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