rebar3 集成elixir 模块
社区包含了一个rebar3 的elixir mix 插件,可以方便rebar 使用elixir 模块
参考使用
- rebar.config 配置
{erl_opts, [debug_info]}.
{deps, [
% 添加引用
{decimal, "2.0.0"}
]}.
{shell, [
{apps, [basic]}
]}.
% 添加插件
{plugins, [rebar_mix]}.
{provider_hooks, [{post, [{compile, {mix, consolidate_protocols}}]}]}.
- 代码使用elixir 模块
basic_demo.erl
-module(basic_demo).
-export([demo/0]).
demo() ->
% 注意是Elixir. 开头的
Result = 'Elixir.Decimal':new(1, 42, -20),
io:format("Result: ~w - ~n", [Result]).
- 调用
rebar3 shell
basic_demo:demo().
效果
参考资料
https://rebar3.org/docs/configuration/plugins/#elixir-dependencies
https://github.com/tsloughter/rebar_mix
https://github.com/barrel-db/rebar3_elixir_compile
https://rebar3.org/docs/configuration/configuration/#hooks
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2022-12-27 databend minio 模式试用
2022-12-27 dremio fragment 执行简单说明
2022-12-27 dremio ExecutionPlanCreator 简单说明
2021-12-27 使用juicefs 让s3 更好兼容posix协议
2020-12-27 vlang 0.2 试用&&火焰图简单查看
2020-12-27 micro 试用
2020-12-27 micro cloud native 开发平台