0

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?

arnfred
  • 313
  • 3
  • 10

1 Answers1

1

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)

José M
  • 3,294
  • 1
  • 14
  • 16