diff options
author | Sutou Kouhei <kou@clear-code.com> | 2020-01-04 06:54:52 +0900 |
---|---|---|
committer | Sutou Kouhei <kou@clear-code.com> | 2020-01-15 06:27:03 +0900 |
commit | 9397c2c75486bc0178ab8486fc2bc44c95d924b8 (patch) | |
tree | 05a8ae557c5bee7d7fcd2534cbdb6d70c50d8015 | |
parent | 6da46014b9a55d43d8bb7ae3d90783a80581be47 (diff) | |
download | bundler-9397c2c75486bc0178ab8486fc2bc44c95d924b8.tar.gz |
Add support for specific_platform feature flag
-rw-r--r-- | lib/bundler/resolver.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index ed0eab41f2..b23947f32c 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -159,6 +159,8 @@ module Bundler sg_ruby.activate_platform!(Gem::Platform::RUBY) selected_sgs << sg_ruby end + end + if platform != Gem::Platform::RUBY # Add a spec group for ["non platform specific spec", "platform # specific spec"] to resolve a spec for multiple platforms. # If Gemfile.lock file has the following entries, we need a ffi-1.9.14 @@ -171,9 +173,11 @@ module Bundler sg_ruby_platform = SpecGroup.new(sg.all_specs) sg_ruby_platform.ignores_bundler_dependencies = sg.ignores_bundler_dependencies - sg_ruby_platform.activate_platform!(Gem::Platform::RUBY) - sg_ruby_platform.activate_platform!(platform) - selected_sgs << sg_ruby_platform + if sg_ruby_platform.for?(Gem::Platform::RUBY) + sg_ruby_platform.activate_platform!(Gem::Platform::RUBY) + sg_ruby_platform.activate_platform!(platform) + selected_sgs << sg_ruby_platform + end end sg.activate_platform!(platform) selected_sgs << sg @@ -253,8 +257,9 @@ module Bundler end def self.platform_sort_key(platform) - return ["", "", ""] if Gem::Platform::RUBY == platform - platform.to_a.map {|part| part || "" } + # Prefer specific platform to not specific platform + return ["99-LAST", "", "", ""] if Gem::Platform::RUBY == platform + ["00", *platform.to_a.map {|part| part || "" }] end private |