module Bundler::SharedHelpers

def major_deprecation(major_version, message, print_caller_location: false)

def major_deprecation(major_version, message, print_caller_location: false)
  if print_caller_location
    caller_location = caller_locations(2, 2).first
    message = "#{message} (called at #{caller_location.path}:#{caller_location.lineno})"
  end
  bundler_major_version = Bundler.bundler_major_version
  if bundler_major_version > major_version
    require_relative "errors"
    raise DeprecatedError, "[REMOVED] #{message}"
  end
  return unless bundler_major_version >= major_version && prints_major_deprecations?
  Bundler.ui.warn("[DEPRECATED] #{message}")
end