defp deps, do: Code.eval_file("deps.exs")
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/48f096ab-c6dd-494c-8907-ca16e1b785fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[
{:my_dep, System.get_env("DEP_VER")}
]
# deps.exs
f = fn -> System.get_env("DEP_VER")
[{:my_dep, f.() }]
Hi boris 👋🏼there was an old discussion on the list about thatthe main thing that came was "The dependency file for mix is an Elixir program rather than just a simple JSON file. There's no way reliably and safely programatically modify the mix.exs file as a result."I don't think evaluation an exs to get a list will make a `mix.deps.add` reliable once we could put any elixir code on that file as well.
Le ven. 10 mai 2019, à 06 h 09, 'boris kotov' via elixir-lang-core <elixir-l...@googlegroups.com> a écrit :
--Right now, its a bit annoying to lookup the version on hex, and then manually adding it to the deps function.There was a discussion back in 2017 on this. https://elixirforum.com/t/mix-deps-add-functionality/4856/7The main problem people have thought about was manipulation of mix.exs, and true, we don't want that.Instead we can use a simple exs file for this, which should be evaluatable to a list. So its a no-brainer to add items to it. For example `mix deps.add jason`.defp deps, do: Code.eval_file("deps.exs")I am posting it here, to get some feedback on that feature, but I think the integration could go into hex only and if its adopted, adding the `deps.exs` file to the `mix new`-templates so please, share you opinions on it.
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-l...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/48f096ab-c6dd-494c-8907-ca16e1b785fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/faf1c54d-8974-4643-a5d2-301776a479ef%40googlegroups.com.
Hi Andrea,
this is not meant to be a core-related feature-request. Instead, it should go into hex.
Do you have some personal opinions on that feature, and do you
feel that it is uneccessary and that it is something that
fullfills a very special need? I don't think so, its basic stuff.
Recently, I had to explain a friend, why you don't have that
feature in elixir, and that adding deps is just unconvient
compared to other environments.
However you are right, it could be added even by a average programmer like me. But this is actually a weak argument, to not discuss a feature, which was already requested many times.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/3ce4a853-948f-48a7-a186-9a23a7ae1324%40googlegroups.com.
And the usage is similar to yarn in that you can add and update and remove packages using the cli
IMO having elixir read from a deps.json as a fallback if mix.exs doesn't define deps would be a good path forward. The json format would need to be worked out (such as for encoding atoms different than binaries).
Best,
Anil
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/5d94715c-33b4-4d23-8f95-34a6096f868b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/0100016aa75b0a2a-09a6afec-1775-470d-8b94-6c84bf51ec98-000000%40email.amazonses.com.