From 8a596bd999e141ffca0020d3437373f9da7ad861 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Mon, 20 Apr 2026 10:44:58 +0800 Subject: [PATCH] fix --- rebar.config | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/rebar.config b/rebar.config index 784baf8..4a68ef9 100644 --- a/rebar.config +++ b/rebar.config @@ -1,4 +1,33 @@ {erl_opts, [debug_info, {i, "include"}]}. + +{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"]}, % 源码目录(必须) + 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, [ {sync, ".*", {git, "https://github.com/rustyio/sync.git", {branch, "master"}}}, {jiffy, ".*", {git, "https://github.com/davisp/jiffy.git", {tag, "1.1.2"}}},