【问题标题】:How to build erlang dependency with rebar and make at once in Elixir project如何在 Elixir 项目中使用 rebar 构建 erlang 依赖项并立即制作
【发布时间】:2016-07-19 16:32:19
【问题描述】:

我为 elixir 编写了一个 erlport 包装器,但是在将 erlport 编译为依赖项时遇到了问题。你可以在这里找到它:https://github.com/fazibear/export

导出 mix.exs 文件:

defp deps do
  [
    {:erlport, git: "https://github.com/hdima/erlport.git", compile: "rebar compile && make"},
    {:ex_doc, "~> 0.11", only: :dev},
    {:earmark, ">= 0.0.0", only: :dev}
  ]
end

还有另一个使用这个包的项目。当我像这样向这个项目添加一个包时:

defp deps do
  [
    {:export, path: "/Users/bla/dev/export"}
  ]
end

并调用mix compile 它运行得很好。 Erlport 使用 rebar 和 make 正确编译。

当我尝试从十六进制添加项目时,问题就开始了。

defp deps do
  [
    {:export, "~> 0.0.6"}
  ]
end

Elport 无法编译。正如您在最新提交中看到的那样,我在导出混合文件中尝试了managercompile 参数的一些组合,但没有任何效果。

如何编译这个 lib 依赖项?

谢谢。

【问题讨论】:

    标签: elixir elixir-mix


    【解决方案1】:

    Hex manual

    看起来,仅仅依赖于 rebar 配置文件应该可以开箱即用。另外,请记住,对于运行时依赖项,您还需要将它们添加到应用程序中,而不仅仅是 deps。

    【讨论】:

      猜你喜欢
      • 2011-10-18
      • 2013-11-15
      • 1970-01-01
      • 1970-01-01
      • 2013-06-22
      • 1970-01-01
      • 2018-01-23
      • 2013-01-30
      • 1970-01-01
      相关资源
      最近更新 更多