Provide installation option to disable multiple pod sources warnings

parent eca73fda
...@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,6 +12,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Dimitris Koutsogiorgas](https://github.com/dnkoutso) [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6534](https://github.com/CocoaPods/CocoaPods/issues/6534) [#6534](https://github.com/CocoaPods/CocoaPods/issues/6534)
* Provide installation option to disable multiple pod sources warnings.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#6497](https://github.com/CocoaPods/CocoaPods/pull/6497)
* Use the colored2 gem instead of colored. * Use the colored2 gem instead of colored.
[Orta Therox](https://github.com/orta) [Orta Therox](https://github.com/orta)
[xcodeproj#463](https://github.com/CocoaPods/Xcodeproj/pull/463) [xcodeproj#463](https://github.com/CocoaPods/Xcodeproj/pull/463)
......
...@@ -106,6 +106,7 @@ module Pod ...@@ -106,6 +106,7 @@ module Pod
option :deterministic_uuids, true option :deterministic_uuids, true
option :integrate_targets, true option :integrate_targets, true
option :lock_pod_sources, true option :lock_pod_sources, true
option :warn_for_multiple_pod_sources, true
option :share_schemes_for_development_pods, false option :share_schemes_for_development_pods, false
module Mixin module Mixin
......
...@@ -6,6 +6,10 @@ module Pod ...@@ -6,6 +6,10 @@ module Pod
# by target for a given Podfile. # by target for a given Podfile.
# #
class Resolver class Resolver
include Pod::Installer::InstallationOptions::Mixin
delegate_installation_options { podfile }
# @return [Sandbox] the Sandbox used by the resolver to find external # @return [Sandbox] the Sandbox used by the resolver to find external
# dependencies. # dependencies.
# #
...@@ -288,7 +292,7 @@ module Pod ...@@ -288,7 +292,7 @@ module Pod
def specifications_for_dependency(dependency, additional_requirements = []) def specifications_for_dependency(dependency, additional_requirements = [])
requirement = Requirement.new(dependency.requirement.as_list + additional_requirements) requirement = Requirement.new(dependency.requirement.as_list + additional_requirements)
find_cached_set(dependency). find_cached_set(dependency).
all_specifications. all_specifications(installation_options.warn_for_multiple_pod_sources).
select { |s| requirement.satisfied_by? s.version }. select { |s| requirement.satisfied_by? s.version }.
map { |s| s.subspec_by_name(dependency.name, false) }. map { |s| s.subspec_by_name(dependency.name, false) }.
compact. compact.
......
...@@ -32,12 +32,12 @@ module Pod ...@@ -32,12 +32,12 @@ module Pod
end end
class External class External
def all_specifications def all_specifications(_warn_for_multiple_pod_sources)
[specification] [specification]
end end
end end
def all_specifications def all_specifications(warn_for_multiple_pod_sources)
@all_specifications ||= begin @all_specifications ||= begin
sources_by_version = {} sources_by_version = {}
versions_by_source.each do |source, versions| versions_by_source.each do |source, versions|
...@@ -45,13 +45,15 @@ module Pod ...@@ -45,13 +45,15 @@ module Pod
sources_by_version sources_by_version
end end
duplicate_versions = sources_by_version.select { |_version, sources| sources.count > 1 } if warn_for_multiple_pod_sources
duplicate_versions = sources_by_version.select { |_version, sources| sources.count > 1 }
duplicate_versions.each do |version, sources| duplicate_versions.each do |version, sources|
UI.warn "Found multiple specifications for `#{name} (#{version})`:\n" + UI.warn "Found multiple specifications for `#{name} (#{version})`:\n" +
sources. sources.
map { |s| s.specification_path(name, version) }. map { |s| s.specification_path(name, version) }.
map { |v| "- #{v}" }.join("\n") map { |v| "- #{v}" }.join("\n")
end
end end
versions_by_source.flat_map do |source, versions| versions_by_source.flat_map do |source, versions|
......
...@@ -63,6 +63,7 @@ module Pod ...@@ -63,6 +63,7 @@ module Pod
'deterministic_uuids' => false, 'deterministic_uuids' => false,
'integrate_targets' => true, 'integrate_targets' => true,
'lock_pod_sources' => true, 'lock_pod_sources' => true,
'warn_for_multiple_pod_sources' => true,
'share_schemes_for_development_pods' => false, 'share_schemes_for_development_pods' => false,
} }
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