简体   繁体   English

是否应将:name 和/或:app 添加到伞形应用程序的根 mix.exs 文件中的项目定义中?

[英]Should :name and/or :app be added to project definition in root mix.exs file in umbrella application?

I'm attempting to generate documentation for applications in my Elixir project using ExDoc.我正在尝试使用 ExDoc 为我的 Elixir 项目中的应用程序生成文档。 My project is structured as an umbrella application, with two apps, a functional core and a Phoenix web frontend.我的项目结构为一个伞形应用程序,有两个应用程序,一个功能核心和一个 Phoenix web 前端。 When running the command mix docs from the root of the umbrella, I get the following error message:从伞的根目录运行命令mix docs时,我收到以下错误消息:

** (RuntimeError) expected :name or :app to be found in the project definition in mix.exs
    (ex_doc 0.23.0) lib/mix/tasks/docs.ex:328: Mix.Tasks.Docs.run/3
    (mix 1.11.3) lib/mix/task.ex:394: Mix.Task.run_task/3
    (mix 1.11.3) lib/mix/cli.ex:84: Mix.CLI.run_task/2
    (elixir 1.11.3) lib/code.ex:931: Code.require_file/2

The root mix.exs file is as follows:根 mix.exs 文件如下:

defmodule UmbrellaProject.MixProject do
  use Mix.Project

  def project do
    [
      apps_path: "apps",
      version: "0.1.0",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  defp deps do
    [{:ex_doc, "~> 0.23.0", dev: true, runtime: false}]
  end
end

Should I add:name and/or:app values to the list in the project/1 function?我应该在project/1 function 的列表中添加:name 和/或:app 值吗? If yes, is there a standard convention for what their values should be or can they be anything (within reason)?如果是,是否有标准约定它们的值应该是什么,或者它们可以是什么(在合理范围内)?

I'm using Elixir version 1.11.3.我正在使用 Elixir 版本 1.11.3。

Try to add name: " xxx " in your config.尝试在您的配置中添加name: " xxx "

defmodule UmbrellaProject.MixProject do
  use Mix.Project

  def project do
    [
      name: "My umbrella project",
      apps_path: "apps",
      version: "0.1.0",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  defp deps do
    [{:ex_doc, "~> 0.23.0", dev: true, runtime: false}]
  end
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 更改了compile.lock和mix.exs后,Phoenix伞应用程序代码重新加载器失败 - Phoenix umbrella app code reloader failing after changes of compile.lock and mix.exs 如何配置 mix.exs 以使伞形项目应用程序共享相同版本? - How do I configure mix.exs to make umbrella project apps share the same version? 为什么 `mix.exs` 的 `Project.application` 函数中的断点没有用? - why breakpoint in `Project.application` function of `mix.exs` is useless? mix.exs 文件中的 Elixir 版本要求无效 - Invalid Elixir version requirement in mix.exs file Mix.exs文件更改-(SyntaxError)mix.exs:65:意外令牌:“”(第1列,代码点U + 0000) - Mix.exs file changes - (SyntaxError) mix.exs:65: unexpected token: “” (column 1, codepoint U+0000) 如何在mix.exs中运行两次别名? - How to alias run twice in mix.exs? mix.exs依赖项声明中的正确版本 - Correct version in mix.exs dependency declaration 如何将 Elixir 库加载到 iex 而不将其添加到项目的 mix.exs 部门? - How do I load an Elixir library into iex without adding it to a project's mix.exs deps? 尝试使用edeliver释放软件包但得到deps / exrm / mix.exs:没有这样的文件或目录 - Trying to use edeliver to release a package but getting deps/exrm/mix.exs: No such file or directory 如何在伞形项目的根目录下创建 Mix 任务? - How to create a Mix task at the root of an umbrella project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM