rebar3配置

实例化配置:

{erl_opts, [debug_info]}.

{rebar_packages_cdn, "https://hexpm.upyun.com"}.  % package中国镜像
{deps, []}.

{relx, [{release, { bbb, "0.1.0" },
         [bbb,
          sasl]},

        {sys_config, "./config/sys.config"},
        {vm_args, "./config/vm.args"},

        {dev_mode, true},
        {include_erts, false},

        {extended_start_script, true}]
}.

{profiles, [{prod, [{relx, [{dev_mode, false},
                            {include_erts, true}]}]
            }]
}.

配置文件:

{include_erts, false},  // erts
{system_libs, false},   // 系统库
// 指定库地址
{include_erts, "/path/to/erlang"},
{system_libs, "/path/to/erlang"},
// 包含相关
{include_src, false},   // 源码
{exclude_apps, [app1, app2]},  // 发布时排除
{exclude_modules, [       // 模块排除
    {app1, [app1_mod1, app1_mod2]},
    {app2, [app2_mod1, app2_mod2]}
]}.

实例:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{erl_opts, [
  {src_dirs, ["src", "test"]},
  ,warn_unused_vars
  ,warn_export_all
  ,warn_shadow_vars
  ,warn_unused_import
  ,warn_unused_function
  ,warn_bif_clash
  ,warn_unused_record
  ,warn_deprecated_function
  ,warn_obsolete_guard
  ,strict_validation
  ,warn_export_vars
  ,warn_exported_vars
  ,warn_missing_spec
  ,warn_untyped_record
  ,debug_info
  ,{parse_transform, lager_transform}
]}.

{rebar_packages_cdn, "https://hexpm.upyun.com"}.


{deps_dir, "deps"}.
{deps, [
  lager
  ,{mongodb, {git, "https://github.com/comtihon/mongodb-erlang.git", {tag, "v3.2.0"}}}
  ,{eredis_pool, {git, "https://github.com/hiroeorz/eredis_pool.git", {branch, "master"}}}
  ,{brod, {git, "https://github.com/klarna/brod.git", {tag, "3.5.2"}}}
  ,{worker_pool, {git, "https://github.com/inaka/worker_pool.git", {tag, "3.1.1"}}}
  ,{cowboy, {git, "https://github.com/ninenines/cowboy.git", {tag, "2.4.0"}}}

]}.



{escript_main_app, observer_cli}.
{escript_emu_args, "%%! -escript main observer_cli_escriptize -hidden +sbtu +A0 -elixir ansi_enabled true\n"}.
{escript_incl_apps, [recon]}.



{dialyzer_opts, [{warnings, 
  [unmatched_returns, error_handling, race_conditions, behaviours]}
]}.


{edoc_opts, [
  {report_missing_types, true}, 
  {source_path, ["src"]}, 
  {report_missing_types, true}, 
  {todo, true}, 
  {packages, false}, 
  {subpackages, false}
]}.


{xref_checks, [undefined_function_calls]}.
{cover_enabled, true}.


{post_hooks, [
  {"(linux|darwin|solaris)", edoc, "escript doc/docsite.erl"}
]}.




{relx, [
  {release,
    { demo_erlang, "0.1.0" },
    [
      cowboy,
      lager,
      demo_erlang,
      sasl
    ]
  },
  {release,
    { demo_lager, "0.1.0" },
    [
      observer_cli,
      lager,
      demo_lager,
      sasl
    ]
  },

  {sys_config, "./config/sys.config"},
  {vm_args, "./config/vm.args"},

  {dev_mode, true},
  {include_erts, false},

  {extended_start_script, true}
]}.

{profiles, [
  {prod, [{relx, [
    {dev_mode, false},
    {include_erts, true}
  ]}]},
  {cowboy, [{relx, [
    {release,
      { demo_erlang, "0.1.0" },
      [
        cowboy,
        demo_erlang,
        sasl
      ]
    },
    {dev_mode, false}
  ]}]},
  {lager, [{relx, [
    {dev_mode, false}
  ]}]}
  ]
}.