0

目前我有一个 rebar3 项目,我想为我的应用程序配置使用另一个文件。appConfig.conf配置文件在conf目录下调用。我尝试使用相对路径访问配置文件,但是rebar3没有将conf目录放在目录下_build,这会导致file not found错误。

目录结构是这样的:

conf/
include/
src/

如何让 rebar3conf在编译时考虑目录?

4

1 回答 1

1

当我需要不同的配置文件用于生产或测试模式时,我正在使用 rebar3 配置文件

结构

_build
config
priv
src 

这是 rebar.config 文件的一部分

{profiles, [
  {production,
    [{relx, [
      {dev_mode,      false},
      {include_erts,  true},
      {include_src,   false},
      {vm_args,       "config/production/vm.args"},
      {sys_config,    "config/production/sys.config"}]
    }]
  },
  {test,
    [{relx, [
      {erl_opts, [{native, o3}]},
      {dev_mode,      false},
      {include_erts,  true},
      {include_src,   false},
      {vm_args,       "config/test/vm.args"},
      {sys_config,    "config/test/sys.config"}]
    }]
  }
]}
于 2018-09-02T19:00:09.107 回答