defmodule DawgEx.MixProject do use Mix.Project @version "0.2.0" @source_url "https://github.com/realglebivanov/dawg_ex" def project do [ app: :dawg_ex, version: @version, elixir: "~> 1.20", start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), # Compilation is strict everywhere except :prod, so a warning introduced # by a future Elixir release can never break a downstream dependent's # build (deps compile under MIX_ENV=prod). elixirc_options: [warnings_as_errors: Mix.env() != :prod], # Hex description: description(), package: package(), # Docs name: "DawgEx", source_url: @source_url, docs: docs(), # Static analysis dialyzer: dialyzer(), # Coverage test_coverage: [summary: [threshold: 0]] ] end # Run "mix help compile.app" to learn about applications. def application do [extra_applications: []] end # `mix check` runs the test suite, so pin the whole alias to :test rather # than letting it switch environments (and recompile) partway through. def cli do [preferred_envs: [check: :test]] end # Run "mix help deps" to learn about dependencies. defp deps do [ {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.40", only: :dev, runtime: false} ] end defp description do "A compact, binary-encoded DAWG (directed acyclic word graph) for fast " <> "set-membership queries over large word lists." end defp package do [ name: "dawg_ex", licenses: ["MIT"], maintainers: ["Gleb Ivanov"], files: ~w(lib mix.exs README.md LICENSE CHANGELOG.md .formatter.exs), links: %{ "GitHub" => @source_url, "Changelog" => "#{@source_url}/blob/main/CHANGELOG.md" } ] end defp docs do [ main: "readme", source_ref: "v#{@version}", source_url: @source_url, extras: ["README.md", "CHANGELOG.md", "LICENSE"], formatters: ["html"] ] end defp dialyzer do [ plt_local_path: "priv/plts/project.plt", plt_core_path: "priv/plts/core.plt", plt_add_apps: [:ex_unit, :mix], flags: [ :error_handling, :extra_return, :missing_return, :underspecs, :unknown, :unmatched_returns ], list_unused_filters: true ] end defp aliases do [ check: [ "format --check-formatted", "compile --warnings-as-errors", "credo --strict", "test", "dialyzer" ] ] end end