asdf-elixir
asdf-elixir copied to clipboard
Read Elixir version from mix.exs file
In addition to the .exenv-version
file, asdf-elixir should also be able to read the Elixir version out of a mix.exs
file in the current directory.
See this related issue for kiex: https://github.com/taylor/kiex/pull/54
I like this!
Couple questions:
-
I'm not sure how this will account for different OTP versions that Elixir could be compiled with. Do you see something that could help find this? I don't see anything in
mix.exs
that specifies the OTP version, unless folks just add it. For example:def project() do [ app: :my_app, version: File.read!("VERSION") |> String.trim(), elixir: "~> 1.5", otp: "21" ] end
-
Let's say that 1.5.2 is the latest Elixir version, and
mix.exs
specifieselixir: "~> 1.5"
. At the timeasdf install
is ran, does it fetch the latest 1.5.x version or earliest? If latest, and then later 1.5.3 releases, shouldasdf install
require 1.5.3? Would asdf say the "specified" version is not yet installed, or would it be satisfied? I figure if folks want a specific version of Elixir for their app, they could specifyelixir: "1.5.2"
instead. Should there be a.tool-versions.lock
generated until explicitly told to upgrade? (I figure this is a bigger question for asdf).