简体   繁体   中英

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. My project is structured as an umbrella application, with two apps, a functional core and a Phoenix web frontend. When running the command mix docs from the root of the umbrella, I get the following error message:

** (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:

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? 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.

Try to add name: " xxx " in your config.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM