Add Elixir files to your compiled list
While working on an Elixir package today, I wanted to add the test/support
directory to my compiled files. I knew the Phoenix Framework did this so I went there to take a look and discovered elixirc_paths
.
The Phoenix frameworks example looks like this:
# mix.exs
def project do
[
...
elixirc_paths: elixirc_paths(Mix.env),
...
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
Perfect! Now we can add additional directories to our compiled path that are environment specific.
Tweet