defmodule Mercury.MixProject do use Mix.Project @version "1.0.0" @source_url "https://github.com/iamkanishka/mercury_client" def project do [ app: :mercury_client, version: @version, elixir: "~> 1.18", start_permanent: Mix.env() == :prod, elixirc_paths: elixirc_paths(Mix.env()), deps: deps(), name: "mercury_client", description: description(), package: package(), source_url: @source_url, homepage_url: @source_url, docs: docs(), dialyzer: [ plt_add_apps: [:mix, :ex_unit], plt_file: {:no_warn, "priv/plts/mercury.plt"}, flags: [:error_handling] ], test_coverage: [tool: ExCoveralls], preferred_cli_env: [ coveralls: :test, "coveralls.detail": :test, "coveralls.html": :test, "coveralls.github": :test ] ] end def application do [ extra_applications: [:logger, :crypto] ] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] defp deps do [ {:req, "~> 0.5"}, {:jason, "~> 1.4"}, {:plug, "~> 1.16", only: :test}, {:ex_doc, "~> 0.34", only: :dev, runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:excoveralls, "~> 0.18", only: :test} ] end defp description do "A complete, production-grade Elixir client for the Mercury Banking API " <> "(accounts, transactions, recipients, invoices, payments, treasury, " <> "webhooks, and more), with typed errors, retry with backoff, and " <> "lazy auto-paginating streams." end defp package do [ name: "mercury_client", licenses: ["MIT"], maintainers: ["Kanishka Naik"], links: %{ "GitHub" => @source_url, "Mercury API Docs" => "https://docs.mercury.com/reference" }, files: ~w(lib mix.exs README.md CHANGELOG.md LICENSE .formatter.exs) ] end defp docs do [ main: "readme", source_ref: "v#{@version}", source_url: @source_url, extras: ["README.md", "CHANGELOG.md", "LICENSE"], groups_for_modules: [ Client: [Mercury, Mercury.Client, Mercury.Retry, Mercury.Page], Errors: [ Mercury.APIError, Mercury.AuthenticationError, Mercury.NotFoundError, Mercury.ValidationError, Mercury.ConflictError, Mercury.RateLimitError, Mercury.ServerError, Mercury.NetworkError, Mercury.TimeoutError, Mercury.Error ], Resources: [ Mercury.Accounts, Mercury.Transactions, Mercury.Recipients, Mercury.Invoices, Mercury.Payments, Mercury.Categories, Mercury.Customers, Mercury.Treasury, Mercury.Webhooks, Mercury.Events, Mercury.Organization, Mercury.Users, Mercury.SafeRequests, Mercury.Credit, Mercury.Attachments, Mercury.OAuth2 ] ] ] end end