         end)
       end
 
+    app = config[:app]
     _ = Code.prepend_path(Mix.Project.compile_path())
-    load_app(config[:app], validate_compile_env?)
+    load_app(app, %{app => true}, lib_path, validate_compile_env?)
     result
   end
 

    end
  end

  defp consult_app_file(path) do
    # The path could be located in an .ez archive, so we use the prim loader.
    with {:ok, bin, _full_name} <- :erl_prim_loader.get_file(path),
         {:ok, tokens, _} <- :erl_scan.string(String.to_charlist(bin)) do
      :erl_parse.parse_term(tokens)
    end
  end

    Mix.Project.get!()
    config = Mix.Project.config()
    validate_compile_env? = "--no-validate-compile-env" not in args
    lib_path = Path.join(Mix.Project.build_path(config), "lib")

    # Make sure Mix.Dep is cached to avoid loading dependencies
    # during compilation. It is likely this will be invoked anyway,
