barrel-db / rebar3_elixir_compile

Elixir rebar3 compiler plugin
Other
90 stars 29 forks source link

Added cdn option to elixir_opts. Fixed lib compilation for profiles other than dev. #26

Closed savonarola closed 7 years ago

savonarola commented 7 years ago

Hello!

rebar3_elixir_compile is a great plugin and appeared to be very useful. Nevertheless, it has some defaults that did't fit. I have tried to generalize them.

Added cdn option to elixir_opts.

Some companies tend to use a private repo for hex tarballs, so I have introduced an optional elixir_opts setting, cdn, that can be used like this:

{elixir_opts, 
  [
    {env, prod},
    {cdn, "https://repo.hex.pm"}
  ]
}.

Fixed lib compilation for profiles other than dev.

With env set to prod, one gets an error:

./rebar3 get-deps       
===> Verifying dependencies...
===> Fetching XXX
... so on
sh: line 0: exec: MIX_ENV=prod: not found

I have tried to fix this issue.

benoitc commented 7 years ago

@savonarola merged, i guess that if the env is already set, maybe we can get it via os:get_env?