       :proplists.get_value(:error, results, false) ->
         exit({:shutdown, 1})
 
-      :proplists.get_value(:ok, results, false) && consolidate_protocols?() ->
+      :proplists.get_value(:ok, results, false) && config[:consolidate_protocols] ->
         Mix.Task.reenable("compile.protocols")
         Mix.Task.run("compile.protocols", [])
         :ok

            "in such environments"
  end

  defp mix_compile_deps(deps, apps_to_reload, compilers) do
    for dep <- deps, dep.app in apps_to_reload do
      Mix.Dep.in_dependency(dep, fn _ ->
        mix_compile_unless_stale_config(compilers)
      end)
    end

    :ok
  end

  defp mix_compile_project(nil, _, _), do: :ok

  defp mix_compile_project(app, apps_to_reload, compilers) do
    if app in apps_to_reload do
      mix_compile_unless_stale_config(compilers)
    end

    :ok
  end

  defp mix_compile_unless_stale_config(compilers) do
    manifests = Mix.Tasks.Compile.Elixir.manifests()
    configs = Mix.Project.config_files()

    case Mix.Utils.extract_stale(configs, manifests) do
      [] ->
        mix_compile(compilers)

      files ->
        raise """


    # We call build_structure mostly for Windows so new
    # assets in priv are copied to the build directory.
    Mix.Project.build_structure(config)
    results = Enum.map(compilers, &Mix.Task.run("compile.#{&1}", []))

    # Results are either {:ok, _} | {:error, _}, {:noop, _} or
