arnfred
arnfred

Reputation: 353

Rebar3: How do I refer to source artifacts of a library from erlang?

I have have library with an artifact: src/lib/prelude.kind that I'd like to access. However, when I call the library code from a different project (which has the library set up as a dependency), the file src/lib/prelude.kind doesn't exist.

I can solve this problem by hardcoding the file location as _build/default/lib/kind/src/prelude.kind instead, but I'd rather not hardcode the Rebar3 default profile path.

Is there a way to refer to _build/default/lib or whatever the current profile location is from Erlang in a Rebar3 project?

Upvotes: 0

Views: 196

Answers (1)

José M
José M

Reputation: 3509

You should use code:lib_dir/2

I'd make sure that the file is available with rebar3's artifacts (and move it out of the src subdir)

Upvotes: 1

Related Questions