summaryrefslogtreecommitdiff
path: root/lib/bundler/definition.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-21 20:52:35 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-09-18 18:26:32 +0900
commit6f16ededdd5eed8bab9e4f4cb70032a151fbc405 (patch)
tree7c76814651e4b14aabf8218ac9f5e410188ff727 /lib/bundler/definition.rb
parentf18d88b5356d347304245c703329b82293f56efc (diff)
[bundler/bundler] Revert "Remove now meaningless warning"
This reverts commit 00b095b98fe4bd44950beaf3bc9f1d91eac7b69e. https://github.com/bundler/bundler/commit/e93bce3b20
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r--lib/bundler/definition.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 08bd19e337..3f5e8ce97b 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -896,7 +896,17 @@ module Bundler
dependencies.each do |dep|
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
next if !remote && !dep.current_platform?
- dep.gem_platforms(sorted_platforms).each do |p|
+ platforms = dep.gem_platforms(sorted_platforms)
+ if platforms.empty? && !Bundler.settings[:disable_platform_warnings]
+ mapped_platforms = dep.expanded_platforms
+ Bundler.ui.warn \
+ "The dependency #{dep} will be unused by any of the platforms Bundler is installing for. " \
+ "Bundler is installing for #{@platforms.join ", "} but the dependency " \
+ "is only for #{mapped_platforms.join ", "}. " \
+ "To add those platforms to the bundle, " \
+ "run `bundle lock --add-platform #{mapped_platforms.join " "}`."
+ end
+ platforms.each do |p|
deps << DepProxy.new(dep, p) if remote || p == generic_local_platform
end
end