Current section

Files

Jump to
Raw

mix.exs

defmodule Runbox.MixProject do
use Mix.Project
@version "26.0.0"
def project do
[
app: :runbox,
version: @version,
description: description(),
package: package(),
elixir: "~> 1.20",
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
dialyzer: [
list_unused_filters: true,
plt_add_apps: [:ex_unit, :mix]
],
docs: [
formatters: ["html"],
extras: ["README.md", "CHANGELOG.md"],
main: "readme",
skip_undefined_reference_warnings_on: ["CHANGELOG.md"],
# ex_doc warns when documentation references a module that `filter_modules` removed, and
# `Runbox` is `@moduledoc group: :internal`, so the plain `Runbox` mentions in CHANGELOG.md
# would fail `make check-docs`. A function rather than a list, so that the internal build --
# where nothing is filtered -- still links them.
skip_code_autolink_to: fn ref -> ref == "Runbox" and not internal_docs?() end,
nest_modules_by_prefix: [Runbox.Scenario.OutputAction],
filter_modules: fn _mod, metadata ->
internal_docs?() or Map.get(metadata, :group) != :internal
end,
groups_for_modules: [
"Runbox internals": fn metadata -> metadata[:group] == :internal end,
Messages: fn metadata -> metadata[:group] == :messages end,
"Output actions": fn metadata -> metadata[:group] == :output_actions end,
"Development and testing": fn metadata -> metadata[:group] == :dev_tools end,
Utilities: fn metadata -> metadata[:group] == :utilities end
],
source_url_pattern:
"https://preview.hex.pm/preview/altworx_runbox/#{@version}/show/%{path}#L%{line}"
]
]
end
def application do
[
extra_applications: [:logger, :eex],
mod: {Runbox.Application, []},
env: [mode: :slave]
]
end
defp aliases do
[docs: docs_tasks()]
end
# Builds the docs twice: user-facing into doc/, internal into doc/internal/.
# `DOCS_STRICT=1`, set by the `check-docs` make target, makes ex_doc warnings fatal.
defp docs_tasks do
extra = if System.get_env("DOCS_STRICT") == "1", do: " --warnings-as-errors", else: ""
[
"docs --output doc" <> extra,
# Mix runs a task once per invocation, so without reenabling, the second pass below is
# silently skipped. `:docs_target` is what `internal_docs?/0` reads to widen the filters.
fn _ -> Mix.Task.reenable("docs") end,
fn _ -> Process.put(:docs_target, :internal) end,
"docs --output doc/internal" <> extra
]
end
defp description do
"""
Runbox is a library for running Altworx scenarios.
"""
end
defp package do
[
name: :altworx_runbox,
licenses: [
"BSD-3-Clause"
],
links: %{
"Changelog" => "https://altworx-runbox.hexdocs.pm/changelog.html",
"Altworx Toolbox" => "https://hex.pm/packages/altworx_toolbox"
}
]
end
defp deps do
[
# Pinned to an exact version on purpose: the whole runtime is built on GenStage, so every
# bump deserves a deliberate review. `mix hex.outdated` surfaces a new release, and doing
# that review is what widening this requirement is for.
{:gen_stage, "1.3.2"},
{:mock, "~> 0.3.5", only: :test},
# mock pins meck ~> 0.9.2, but meck 0.9.2 fails to compile on OTP 29
# (deprecated `catch`); override to 1.x, which fixes it and works with mock.
{:meck, "~> 1.0", only: :test, override: true},
{:uuid, "~> 1.1"},
{:joken, "~> 2.3"},
{:jason, "~> 1.3"},
{:heap, "~> 3.0"},
# development tools
{:credo, "~> 1.7.11", only: [:dev, :test], runtime: false},
{:credo_naming, "~> 2.1.0", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.40.3", only: :dev, runtime: false},
{:junit_formatter, "~> 3.1", only: [:test]},
{:mimic, "~> 2.3", only: [:test]}
]
end
defp internal_docs?, do: Process.get(:docs_target) == :internal
end