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

Merge pull request #3600 from CocoaPods/share_development_pod_schemes

Shares schemes of any development pods.
parents 51c121c2 e3580421
......@@ -8,6 +8,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements
* Schemes of development pods will now be shared.
[Boris Bügling](https://github.com/neonichu)
[#3600](https://github.com/CocoaPods/CocoaPods/issues/3600)
* Allow opting out of pod source locking, meaning `pod try` yields editable
projects.
[Samuel Giddins](https://github.com/segiddins)
......
......@@ -136,6 +136,7 @@ module Pod
set_target_dependencies
run_podfile_post_install_hooks
write_pod_project
share_development_pod_schemes
write_lockfiles
end
end
......@@ -604,6 +605,20 @@ module Pod
end
end
# Shares schemes of development Pods.
#
# @return [void]
#
def share_development_pod_schemes
development_pod_targets = sandbox.development_pods.keys.map do |pod|
pods_project.targets.select { |target| target.name =~ /^Pods-.*-#{pod}$/ }
end.flatten
development_pod_targets.each do |pod_target|
Xcodeproj::XCScheme.share_scheme(pods_project.path, pod_target.name)
end
end
# Writes the Podfile and the lock files.
#
# @todo Pass the checkout options to the Lockfile.
......
......@@ -590,6 +590,21 @@ module Pod
@installer.send(:write_pod_project)
end
it 'shares schemes of development pods' do
spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, @installer.podfile)
pod_target = PodTarget.new([spec], target_definition, config.sandbox)
@installer.pods_project.stubs(:targets).returns([pod_target])
@installer.sandbox.stubs(:development_pods).returns('BananaLib' => nil)
Xcodeproj::XCScheme.expects(:share_scheme).with(
@installer.pods_project.path,
'Pods-default-BananaLib')
@installer.send(:share_development_pod_schemes)
end
it "uses the user project's object version for the pods project" do
tmp_directory = Pathname(Dir.tmpdir) + 'CocoaPods'
FileUtils.mkdir_p(tmp_directory)
......
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