Current section
Files
Jump to
Current section
Files
mix.exs
defmodule Hafnium.MixProject do
use Mix.Project
@version "VERSION" |> File.read!() |> String.trim()
@github_url "https://github.com/clszzyh/hafnium"
@description "README.md"
|> File.read!()
|> String.split("<!-- MDOC -->")
|> Enum.fetch!(1)
|> String.trim()
def project do
[
app: :hafnium,
version: @version,
description: @description,
elixir: "~> 1.10",
start_permanent: Mix.env() == :prod,
elixirc_options: [warnings_as_errors: System.get_env("CI") == "true"],
package: [
licenses: ["MIT"],
files: ["lib", ".formatter.exs", "mix.exs", "README*", "CHANGELOG*", "VERSION"],
exclude_patterns: ["priv/plts", ".DS_Store"],
links: %{
"GitHub" => @github_url,
"Changelog" => @github_url <> "/blob/master/CHANGELOG.md"
}
],
source_url: @github_url,
homepage_url: @github_url,
deps: deps(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
coveralls: :test,
ci: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
dialyzer: [
plt_core_path: "priv/plts",
plt_add_deps: true,
list_unused_filters: true,
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
flags: dialyzer_flags()
],
aliases: aliases(),
docs: [
source_ref: "v" <> @version,
source_url: @github_url,
main: "readme",
extras: ["README.md", "CHANGELOG.md"]
]
]
end
def dialyzer_flags do
[
:error_handling,
:race_conditions,
# :underspecs,
:unknown,
:unmatched_returns
# :overspecs
# :specdiffs
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger],
mod: {Hafnium.Application, []}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:md_doctest, "~> 0.1.0", runtime: false},
{:telemetry, "~> 0.4.0"},
{:excoveralls, "~> 0.10", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:credo, "~> 1.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.22", only: [:dev, :test], runtime: false}
]
end
defp aliases do
[
ci: [
"compile --warnings-as-errors --force --verbose",
"format --check-formatted",
"credo --strict",
"dialyzer",
"test"
]
]
end
end