sebastiw / edts

Erlang Development Tool Suite
GNU Lesser General Public License v3.0
355 stars 82 forks source link

Appending :lib-dirs #215

Open joedevivo opened 8 years ago

joedevivo commented 8 years ago

A while back, I added the rebar3 defaults to the defaults for :lib-dirs in #210. Since then, I've wondered why it wasn't working sometimes.

It turns out that I was my own worst enemy here.

The defaults we're setting are:

:lib-dirs ("lib" "deps" "_build/test/lib" "_build/default/lib")

but since I was working with versions of EDTS that didn't have this feature, I might have a .edts file with this line in it:

:lib-dirs '("_build/default/lib")

Which overwrites the default. Of course, that makes sense when you think about it. Unfortunately, this means we have kind of a wonky rebar3 experience. Rebar3 allows you to create profiles other than default and test. If you do, you might want to append those to the default :lib-dirs, without overwriting the defaults. I understand why you'd want to keep the overwrite functionality, but I also see a need for something like :append-lib-dirs or maybe even stick with Erlang's code module's convention and say something like :app-lib-pathz.

I'm happy to look into contributing the code for this, but it seems like a big enough change that I'd solicit opinions on it first.

tjarvstrand commented 7 years ago

How about binding variables to the default values of all attributes when evaluating the configuration? That way you could write either :lib-dirs '("_build/default/lib") or :lib-dirs (cons "_build/default/lib" lib-dirs)