Commit 8062c2ba authored by Marius Rackwitz's avatar Marius Rackwitz

[Config] Allow to opt-out of target deduplication

parent fcdc97c7
...@@ -19,6 +19,7 @@ module Pod ...@@ -19,6 +19,7 @@ module Pod
:clean => true, :clean => true,
:integrate_targets => true, :integrate_targets => true,
:deduplicate_targets => true,
:lock_pod_source => true, :lock_pod_source => true,
:new_version_message => ENV['COCOAPODS_SKIP_UPDATE_MESSAGE'].nil?, :new_version_message => ENV['COCOAPODS_SKIP_UPDATE_MESSAGE'].nil?,
...@@ -89,6 +90,11 @@ module Pod ...@@ -89,6 +90,11 @@ module Pod
attr_accessor :integrate_targets attr_accessor :integrate_targets
alias_method :integrate_targets?, :integrate_targets alias_method :integrate_targets?, :integrate_targets
# @return [Bool] Whether CocoaPods should deduplicate pod targets.
#
attr_accessor :deduplicate_targets
alias_method :deduplicate_targets?, :deduplicate_targets
# @return [Bool] Whether the installer should skip the repos update. # @return [Bool] Whether the installer should skip the repos update.
# #
attr_accessor :skip_repo_update attr_accessor :skip_repo_update
......
...@@ -284,6 +284,7 @@ module Pod ...@@ -284,6 +284,7 @@ module Pod
def generate_pod_targets(target, specs, pod_targets) def generate_pod_targets(target, specs, pod_targets)
grouped_specs = specs.group_by(&:root).values.uniq grouped_specs = specs.group_by(&:root).values.uniq
grouped_specs.map do |pod_specs| grouped_specs.map do |pod_specs|
if config.deduplicate_targets?
# If there are no or already multiple pod targets with a common root, # If there are no or already multiple pod targets with a common root,
# or the one which exists differs in the activated subspec set, then # or the one which exists differs in the activated subspec set, then
# we need to generate another pod target # we need to generate another pod target
...@@ -299,6 +300,9 @@ module Pod ...@@ -299,6 +300,9 @@ module Pod
else else
common_root_pod_targets.first common_root_pod_targets.first
end end
else
generate_pod_target(target, pod_specs).scoped
end
end end
end end
......
...@@ -184,6 +184,14 @@ module Pod ...@@ -184,6 +184,14 @@ module Pod
@config.should.lock_pod_source @config.should.lock_pod_source
end end
it 'integrates a user target' do
@config.should.integrate_targets
end
it 'de-duplicates targets' do
@config.should.deduplicate_targets
end
it 'returns the cache root' do it 'returns the cache root' do
@config.cache_root.should == Pathname.new(File.join(ENV['HOME'], 'Library/Caches/CocoaPods')) @config.cache_root.should == Pathname.new(File.join(ENV['HOME'], 'Library/Caches/CocoaPods'))
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