From 41674b60ad3e6f57d749f46ae1e83d96b33afc92 Mon Sep 17 00:00:00 2001 From: John Warwick Date: Thu, 13 Feb 2014 16:22:05 -0500 Subject: [PATCH] Updated to work with latest Elixir beam paths. --- .gitignore | 2 +- lib/dialyzer.ex | 4 ++-- lib/dialyzer.plt.ex | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 629a108e..bdf742b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/ebin +/_build /deps .depsolver.plt erl_crash.dump diff --git a/lib/dialyzer.ex b/lib/dialyzer.ex index 0a5bca77..a9d90cf0 100644 --- a/lib/dialyzer.ex +++ b/lib/dialyzer.ex @@ -9,7 +9,7 @@ defmodule Mix.Tasks.Dialyzer do -Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs You can define a dialyzer_flags key in your Mix project config to override defaults. - You can also include a dialyzer_paths key to override default path (only ebin) + You can also include a dialyzer_paths key to override default path (only Mix.Project.app_path()/ebin) e.g. def project do @@ -37,7 +37,7 @@ defmodule Mix.Tasks.Dialyzer do |> join(" ") end - defp dialyzer_paths, do: (Mix.project[:dialyzer][:paths] || ["ebin"]) |> join(" ") + defp dialyzer_paths, do: (Mix.project[:dialyzer][:paths] || [ Path.join(Mix.Project.app_path, "ebin") ]) |> join(" ") end diff --git a/lib/dialyzer.plt.ex b/lib/dialyzer.plt.ex index b8b5af49..1169fd6b 100644 --- a/lib/dialyzer.plt.ex +++ b/lib/dialyzer.plt.ex @@ -135,5 +135,10 @@ defmodule Mix.Tasks.Dialyzer.Plt do |> is_list end - defp ex_lib_path, do: "#{to_string(:code.lib_dir(:elixir))}/.." + defp ex_lib_path do + code_dir = Path.join(:code.lib_dir(:elixir), "..") + ~w[eex elixir ex_unit iex mix] + |> Enum.map(&Path.join([ code_dir, &1, "ebin" ])) + |> Enum.join(" ") + end end