Skip to main content

mix.exs

defmodule RustlerMatchSpec.MixProject do
  use Mix.Project

  def project do
    [
      app: :rustler_match_spec,
      version: "0.1.1",
      elixir: "~> 1.20",
      start_permanent: Mix.env() == :prod,
      deps: deps(),
      package: package(),
      dialyzer: [plt_add_apps: [:ex_unit]],
      aliases: aliases()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger]
    ]
  end

  def cli do
    [
      preferred_envs: [ci: :test]
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      {:ex_doc, "~> 0.40", only: :dev, runtime: false},
      {:ex_slop, "~> 0.4", only: [:dev, :test], runtime: false},
      {:reach, "~> 2.0", only: [:dev, :test], runtime: false},
      {:ex_dna, "~> 1.0", only: [:dev, :test], runtime: false},
      {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
      {:credo, "~> 1.0", only: [:dev, :test], runtime: false},
      {:rustler, "~> 0.38", runtime: false},
      {:vibe_kit, "== 0.1.5", only: [:dev, :test], runtime: false},
      {:igniter, "~> 0.6", only: [:dev, :test], runtime: false}
    ]
  end

  defp package do
    [
      description: "Erlang-style match specifications for Rustler native event streams.",
      licenses: ["MIT"],
      links: %{"GitHub" => "https://github.com/elixir-volt/rustler_match_spec"},
      files:
        ~w(lib native/rustler_match_spec/src native/rustler_match_spec/Cargo.toml mix.exs README.md CHANGELOG.md LICENSE*)
    ]
  end

  defp aliases() do
    [
      ci: [
        "format",
        "compile --warnings-as-errors",
        "format --check-formatted",
        "test",
        "cmd cargo fmt --manifest-path native/rustler_match_spec/Cargo.toml -- --check",
        "cmd cargo check --manifest-path native/rustler_match_spec/Cargo.toml",
        "cmd cargo check --manifest-path native/rustler_match_spec/Cargo.toml --no-default-features",
        "credo --strict",
        "dialyzer",
        "ex_dna --max-clones 0",
        "reach.check --arch --smells"
      ]
    ]
  end
end