defmodule Unit.MixProject do use Mix.Project @version "1.0.0" @source_url "https://github.com/iamkanishka/unit" def project do [ app: :unit, version: @version, elixir: "~> 1.18", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), description: "Production-grade Elixir client for the Unit embedded banking API", package: package(), name: "Unit", source_url: @source_url, homepage_url: "https://www.unit.co/docs/api/", docs: docs(), dialyzer: [ plt_file: {:no_warn, "priv/plts/dialyzer.plt"}, plt_add_apps: [:mix, :crypto], flags: [:error_handling, :underspecs], ignore_warnings: ".dialyzer_ignore.exs" ] ] end def application do [ extra_applications: [:logger, :crypto], mod: {Unit.Application, []} ] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] defp deps do [ {:erlex, "~> 0.2", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:file_system, "~> 1.1", only: [:dev, :test], runtime: false}, {:bunt, "~> 1.0", only: [:dev, :test], runtime: false}, {:jason, "~> 1.4"}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:req, "~> 0.5"}, # Dev / test {:ex_doc, "~> 0.31", only: :dev, runtime: false}, {:excoveralls, "~> 0.18", only: :test}, {:bypass, "~> 2.1", only: :test}, {:mox, "~> 1.1", only: :test} ] end defp aliases do [ lint: ["format --check-formatted", "credo --strict", "dialyzer"], "test.all": ["test"], setup: ["deps.get"] ] end defp package do [ licenses: ["MIT"], links: %{"GitHub" => @source_url, "Unit Docs" => "https://www.unit.co/docs/api/"}, maintainers: ["Your Name"], files: ~w(lib .formatter.exs mix.exs README.md LICENSE CHANGELOG.md) ] end defp docs do [main: "readme", source_ref: "v#{@version}", source_url: @source_url, extras: ["README.md"]] end end