defmodule SetuClient.MixProject do use Mix.Project @version "1.0.0" @source_url "https://github.com/iamkanishka/setu_client" def project do [ app: :setu_client, version: @version, elixir: "~> 1.18", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), description: description(), package: package(), name: "Setu Client", source_url: @source_url, homepage_url: "https://docs.setu.co", docs: docs(), dialyzer: dialyzer() ] end def application do [ extra_applications: [:logger, :crypto], mod: {SetuClient.Application, []} ] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] defp deps do [ {:finch, "~> 0.18"}, {:jason, "~> 1.4"}, {:plug, "~> 1.15", optional: true}, {:ex_doc, "~> 0.40", only: :dev, runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:bypass, "~> 2.1", only: :test}, {:mox, "~> 1.1", only: :test} ] end defp aliases do [ lint: ["format --check-formatted", "credo --strict", "dialyzer"], "test.ci": ["test --cover --warnings-as-errors"], lint: ["format --check-formatted", "credo --strict", "dialyzer --quiet"] ] end defp description do "Production-grade Elixir client for the Setu API platform " <> "(UPI, BBPS, WhatsApp, Account Aggregator, KYC, eSign)" end defp package do [ name: "setu_client", licenses: ["MIT"], links: %{ "GitHub" => @source_url, "Setu Docs" => "https://docs.setu.co", "Changelog" => "#{@source_url}/blob/main/CHANGELOG.md" }, maintainers: ["Kanshika Naik"], files: ~w(lib config mix.exs README.md LICENSE CHANGELOG.md) ] end defp docs do [ main: "readme", source_ref: "v#{@version}", source_url: @source_url, extras: ["README.md", "CHANGELOG.md", "LICENSE"], groups_for_modules: [ Core: [Setu, SetuClient.Config, SetuClient.Error], Infrastructure: [ SetuClient.HTTP, SetuClient.TokenManager, SetuClient.RateLimiter, SetuClient.Telemetry ], "Payments — UPI": [SetuClient.Payments.UPI], "Payments — BBPS": [SetuClient.Payments.BBPS, SetuClient.Payments.BillPay], "Payments — WhatsApp": [SetuClient.Payments.WhatsApp], "Data — Account Aggregator": [SetuClient.Data.AA], "Data — KYC": [ SetuClient.Data.KYC.PAN, SetuClient.Data.KYC.BAV, SetuClient.Data.KYC.GST, SetuClient.Data.KYC.DigiLocker, SetuClient.Data.KYC.EKYC, SetuClient.Data.KYC.NameMatch ], "Data — eSign": [SetuClient.Data.ESign], Webhooks: [SetuClient.Webhook.Handler, SetuClient.Webhook.Callbacks] ] ] end defp dialyzer do [ plt_file: {:no_warn, "priv/plts/dialyzer.plt"}, plt_add_apps: [:mix, :jason, :finch], flags: [:error_handling, :underspecs], ignore_warnings: ".dialyzer_ignore.exs" ] end end