Commit 5297a1b2 authored by arida's avatar arida

Merge commit 'de403cdd'

parents b372d364 de403cdd
...@@ -20,6 +20,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -20,6 +20,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Juan Civile](https://github.com/champo) [Juan Civile](https://github.com/champo)
[#5376](https://github.com/CocoaPods/CocoaPods/issues/5376) [#5376](https://github.com/CocoaPods/CocoaPods/issues/5376)
* [repo/push] --use-json to convert podspecs to JSON format when pushing
[Mark Schall](https://github.com/maschall)
[#5568](https://github.com/CocoaPods/CocoaPods/pull/5568)
##### Bug Fixes ##### Bug Fixes
...@@ -47,6 +50,18 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -47,6 +50,18 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Juan Civile](https://github.com/champo) [Juan Civile](https://github.com/champo)
[#5362](https://github.com/CocoaPods/CocoaPods/issues/5362) [#5362](https://github.com/CocoaPods/CocoaPods/issues/5362)
* Fix embedding frameworks in UI Testing bundles.
[Daniel Tomlinson](https://github.com/dantoml)
[#5250](https://github.com/CocoaPods/CocoaPods/issues/5250)
* Ensure attempting to print a path in the error report doesn't itself error.
[Samuel Giddins](https://github.com/)
[#5541](https://github.com/CocoaPods/CocoaPods/issues/5541)
* Fix linting with Xcode 8.
[Boris Bügling](https://github.com/neonichu)
[#5529](https://github.com/CocoaPods/CocoaPods/issues/5529)
## 1.0.1 (2016-06-02) ## 1.0.1 (2016-06-02)
......
...@@ -107,7 +107,7 @@ PATH ...@@ -107,7 +107,7 @@ PATH
cocoapods-try (>= 1.0.0, < 2.0) cocoapods-try (>= 1.0.0, < 2.0)
colored (~> 1.2) colored (~> 1.2)
escape (~> 0.0.4) escape (~> 0.0.4)
fourflusher (~> 0.3.0) fourflusher (~> 1.0.1)
molinillo (~> 0.5.0) molinillo (~> 0.5.0)
nap (~> 1.0) nap (~> 1.0)
xcodeproj (>= 1.1.0, < 2.0) xcodeproj (>= 1.1.0, < 2.0)
...@@ -149,7 +149,7 @@ GEM ...@@ -149,7 +149,7 @@ GEM
faraday (0.9.2) faraday (0.9.2)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
ffi (1.9.6) ffi (1.9.6)
fourflusher (0.3.1) fourflusher (1.0.1)
fuzzy_match (2.0.4) fuzzy_match (2.0.4)
git (1.3.0) git (1.3.0)
i18n (0.7.0) i18n (0.7.0)
......
...@@ -43,7 +43,7 @@ Gem::Specification.new do |s| ...@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'activesupport', '>= 4.0.2' s.add_runtime_dependency 'activesupport', '>= 4.0.2'
s.add_runtime_dependency 'colored', '~> 1.2' s.add_runtime_dependency 'colored', '~> 1.2'
s.add_runtime_dependency 'escape', '~> 0.0.4' s.add_runtime_dependency 'escape', '~> 0.0.4'
s.add_runtime_dependency 'fourflusher', '~> 0.3.0' s.add_runtime_dependency 'fourflusher', '~> 1.0.1'
s.add_runtime_dependency 'nap', '~> 1.0' s.add_runtime_dependency 'nap', '~> 1.0'
s.add_development_dependency 'bacon', '~> 1.1' s.add_development_dependency 'bacon', '~> 1.1'
......
...@@ -31,6 +31,7 @@ module Pod ...@@ -31,6 +31,7 @@ module Pod
['--no-private', 'Lint includes checks that apply only to public repos'], ['--no-private', 'Lint includes checks that apply only to public repos'],
['--commit-message="Fix bug in pod"', 'Add custom commit message. ' \ ['--commit-message="Fix bug in pod"', 'Add custom commit message. ' \
'Opens default editor if no commit message is specified.'], 'Opens default editor if no commit message is specified.'],
['--use-json', 'Push JSON spec to repo'],
].concat(super) ].concat(super)
end end
...@@ -45,6 +46,7 @@ module Pod ...@@ -45,6 +46,7 @@ module Pod
@private = argv.flag?('private', true) @private = argv.flag?('private', true)
@message = argv.option('commit-message') @message = argv.option('commit-message')
@commit_message = argv.flag?('commit-message', false) @commit_message = argv.flag?('commit-message', false)
@use_json = argv.flag?('use-json')
super super
end end
...@@ -177,9 +179,16 @@ module Pod ...@@ -177,9 +179,16 @@ module Pod
else else
message = "[Add] #{spec}" message = "[Add] #{spec}"
end end
FileUtils.mkdir_p(output_path) FileUtils.mkdir_p(output_path)
if @use_json
json_file_name = "#{spec.name}.podspec.json"
json_file = File.join(output_path, json_file_name)
File.open(json_file, 'w') { |file| file.write(spec.to_pretty_json) }
else
FileUtils.cp(spec_file, output_path) FileUtils.cp(spec_file, output_path)
end
Dir.chdir(repo_dir) do Dir.chdir(repo_dir) do
# only commit if modified # only commit if modified
if git!('status', '--porcelain').include?(spec.name) if git!('status', '--porcelain').include?(spec.name)
......
...@@ -20,7 +20,7 @@ module Pod ...@@ -20,7 +20,7 @@ module Pod
# @return [Array<Symbol>] the symbol types, which require that the pod # @return [Array<Symbol>] the symbol types, which require that the pod
# frameworks are embedded in the output directory / product bundle. # frameworks are embedded in the output directory / product bundle.
# #
EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle, :app_extension, :watch_extension, :watch2_extension].freeze EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle, :ui_test_bundle, :app_extension, :watch_extension, :watch2_extension].freeze
# @return [String] the name of the embed frameworks phase # @return [String] the name of the embed frameworks phase
# #
......
...@@ -184,7 +184,11 @@ module Pod ...@@ -184,7 +184,11 @@ module Pod
if pathname if pathname
from_path = config.podfile_path.dirname if config.podfile_path from_path = config.podfile_path.dirname if config.podfile_path
from_path ||= Pathname.pwd from_path ||= Pathname.pwd
path = Pathname(pathname).relative_path_from(from_path) path = begin
Pathname(pathname).relative_path_from(from_path)
rescue
pathname
end
"`#{path}`" "`#{path}`"
else else
'' ''
......
...@@ -722,13 +722,13 @@ module Pod ...@@ -722,13 +722,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) command += Fourflusher::SimControl.new.destination(:oldest, 'iOS', 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) command += Fourflusher::SimControl.new.destination(:oldest, 'watchOS', 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) command += Fourflusher::SimControl.new.destination(:oldest, 'tvOS', deployment_target)
end end
output, status = Dir.chdir(validation_dir) { _xcodebuild(command) } output, status = Dir.chdir(validation_dir) { _xcodebuild(command) }
......
...@@ -99,7 +99,7 @@ module Pod ...@@ -99,7 +99,7 @@ module Pod
(@upstream + 'PushTest/1.4/PushTest.podspec').should.not.exist? (@upstream + 'PushTest/1.4/PushTest.podspec').should.not.exist?
end end
it 'successfully pushes a spec' do it 'generate a message for commit' do
cmd = command('repo', 'push', 'master') cmd = command('repo', 'push', 'master')
Dir.chdir(@upstream) { `git checkout -b tmp_for_push -q` } Dir.chdir(@upstream) { `git checkout -b tmp_for_push -q` }
cmd.expects(:validate_podspec_files).returns(true) cmd.expects(:validate_podspec_files).returns(true)
...@@ -107,10 +107,26 @@ module Pod ...@@ -107,10 +107,26 @@ module Pod
Pod::UI.output.should.include('[Add] PushTest (1.4)') Pod::UI.output.should.include('[Add] PushTest (1.4)')
Pod::UI.output.should.include('[Fix] JSONKit (1.4)') Pod::UI.output.should.include('[Fix] JSONKit (1.4)')
Pod::UI.output.should.include('[No change] BananaLib (1.0)') Pod::UI.output.should.include('[No change] BananaLib (1.0)')
end
it 'successfully pushes a spec' do
cmd = command('repo', 'push', 'master')
Dir.chdir(@upstream) { `git checkout -b tmp_for_push -q` }
cmd.expects(:validate_podspec_files).returns(true)
Dir.chdir(temporary_directory) { cmd.run }
Dir.chdir(@upstream) { `git checkout master -q` } Dir.chdir(@upstream) { `git checkout master -q` }
(@upstream + 'PushTest/1.4/PushTest.podspec').read.should.include('PushTest') (@upstream + 'PushTest/1.4/PushTest.podspec').read.should.include('PushTest')
end end
it 'successfully pushes converted JSON podspec' do
cmd = command('repo', 'push', 'master', '--use-json')
Dir.chdir(@upstream) { `git checkout -b tmp_for_push -q` }
cmd.expects(:validate_podspec_files).returns(true)
Dir.chdir(temporary_directory) { cmd.run }
Dir.chdir(@upstream) { `git checkout master -q` }
(@upstream + 'PushTest/1.4/PushTest.podspec.json').read.should.include('PushTest')
end
it 'initializes with default sources if no custom sources specified' do it 'initializes with default sources if no custom sources specified' do
cmd = command('repo', 'push', 'master') cmd = command('repo', 'push', 'master')
cmd.instance_variable_get(:@source_urls).should.equal [@upstream.to_s] cmd.instance_variable_get(:@source_urls).should.equal [@upstream.to_s]
......
...@@ -174,6 +174,15 @@ module Pod ...@@ -174,6 +174,15 @@ module Pod
phase.nil?.should == false phase.nil?.should == false
end end
it 'adds an embed frameworks build phase if the target to integrate is a UI Test bundle' do
@pod_bundle.stubs(:requires_frameworks? => true)
target = @target_integrator.send(:native_targets).first
target.stubs(:symbol_type).returns(:ui_test_bundle)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == false
end
it 'does not remove existing embed frameworks build phases from integrated framework targets' do it 'does not remove existing embed frameworks build phases from integrated framework targets' do
@pod_bundle.stubs(:requires_frameworks? => true) @pod_bundle.stubs(:requires_frameworks? => true)
@target_integrator.integrate! @target_integrator.integrate!
......
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