iot_cloud/rebar.config
2026-04-21 17:30:53 +08:00

78 lines
3.0 KiB
Erlang

{erl_opts, [debug_info]}.
{plugins, [
{rebar3_gpb_plugin, ".*", {git, "https://github.com/lrascao/rebar3_gpb_plugin.git", {tag, "2.23.8"}}}
]}.
% ======================
% 核心:强制指定 proto 路径 + 输出到你的 apps/sdlan
% ======================
{gpb_opts, [
{i, "proto"}, % proto 文件路径
{src_dirs, ["proto"]}, % 源码目录(必须)
{f, ["message.proto"]},
recursive, % 递归查找 proto 文件
{module_name_suffix, "_pb"}, % 生成模块后缀
{o_erl, "src/protobuf"}, % .erl 输出目录
{o_hrl, "include"}, % .hrl 输出目录
include_as_lib, % gpb.hrl 通过 -include_lib("gpb/include/gpb.hrl")
{strings_as_binaries, true}, % proto string → Erlang binary
type_specs, % 生成 type specs
report, % 编译报告
verbose % 打印详细信息
]}.
{provider_hooks, [
{pre, [
{compile, {protobuf, compile}},
{clean, {protobuf, clean}}
]}
]}.
{deps, [
{poolboy, ".*", {git, "https://github.com/devinus/poolboy.git", {tag, "1.5.1"}}},
{hackney, ".*", {git, "https://github.com/benoitc/hackney.git", {tag, "1.25.0"}}},
{sync, ".*", {git, "https://github.com/rustyio/sync.git", {branch, "master"}}},
{cowboy, ".*", {git, "https://github.com/ninenines/cowboy.git", {tag, "2.14.0"}}},
{ranch, ".*", {git, "https://github.com/ninenines/ranch.git", {tag, "2.2.0"}}},
{brod, ".*", {git, "https://github.com/kafka4beam/brod.git", {tag, "4.4.5"}}},
{jiffy, ".*", {git, "https://github.com/davisp/jiffy.git", {tag, "1.1.1"}}},
{eredis, ".*", {git, "https://github.com/wooga/eredis.git", {tag, "v1.2.0"}}},
{emqtt, ".*", {git, "https://gitea.s5s8.com/anlicheng/emqtt.git", {tag, "v1.2"}}},
{gproc, ".*", {git, "https://github.com/uwiger/gproc.git", {tag, "0.9.1"}}}
]}.
{relx, [{release, {iot, "0.1.0"},
[iot,
sasl]},
{mode, dev},
%{mode, prod},
%% automatically picked up if the files
%% exist but can be set manually, which
%% is required if the names aren't exactly
%% sys.config and vm.args
{sys_config, "./config/sys-dev.config"},
{vm_args, "./config/vm.args"}
%% the .src form of the configuration files do
%% not require setting RELX_REPLACE_OS_VARS
%% {sys_config_src, "./config/sys.config.src"},
%% {vm_args_src, "./config/vm.args.src"}
]}.
{profiles, [{prod, [{relx,
[%% prod is the default mode when prod
%% profile is used, so does not have
%% to be explicitly included like this
{mode, prod},
{sys_config, "./config/sys-prod.config"}
%% use minimal mode to exclude ERTS
%% {mode, minimal}
]
}]}]}.
{rebar_packages_cdn, "https://hexpm.upyun.com"}.