1
votes

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.

1
I'm not sure if the version should be there. Can you remove it and try again?David Magalhães
@DavidMagalhães Thanks for the suggestion, however it did not fix the problem. Why shouldn’t there be a version in the root mix.exs? It was put there by the mix umbrella generatorKPen
I have a umbrella project here that didn't have it. I thought that if a version exists it may expect a name.David Magalhães
That’s interesting. ExDoc works for you in your :name-less project? And the only difference is a lack of a version?KPen

1 Answers

0
votes

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