Current section
Files
Jump to
Current section
Files
wallet_passes
mix.exs
mix.exs
defmodule WalletPasses.MixProject do
use Mix.Project
version_path = Path.join([__DIR__, "VERSION"])
@external_resource version_path
@version version_path |> File.read!() |> String.trim()
def project do
[
app: :wallet_passes,
version: @version,
elixir: "~> 1.16",
elixirc_paths: elixirc_paths(Mix.env()),
description: "An Elixir library for Apple Wallet and Google Wallet pass generation.",
source_url: "https://gitlab.com/phinnaeus/wallet_passes",
start_permanent: Mix.env() == :prod,
consolidate_protocols: Mix.env() != :test,
compilers: compilers(),
deps: deps(),
docs: docs(),
package: package(),
aliases: aliases(),
dialyzer: dialyzer(),
]
end
def cli do
[
preferred_envs: [
"test.unit": :test,
"test.integration": :test,
"test.db": :test,
],
]
end
def application do
[
extra_applications: [:logger],
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp compilers do
Mix.compilers()
end
defp deps do
[
# Runtime
{:jason, "~> 1.4"},
{:telemetry, "~> 1.0"},
{:req, "~> 0.5"},
{:eqrcode, "~> 0.2"},
{:joken, "~> 2.6"},
{:google_api_wallet_objects, "~> 0.12"},
{:ecto_sql, "~> 3.11"},
{:postgrex, "~> 0.19", optional: true},
{:plug, "~> 1.16"},
# Optional runtime
{:phoenix_live_view, "~> 1.0", optional: true},
{:oban, "~> 2.18", optional: true},
# Dev/Test
{:ex_doc, "~> 0.40", only: :dev, runtime: false},
{:freedom_formatter, "~> 2.1", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:mix_audit, "~> 2.1", only: [:dev, :test], runtime: false},
{:bypass, "~> 2.1", only: :test},
# Test-only TZ database so DateTime.new/3 resolves named timezones in
# builder tests. The lib defers to whatever the consuming app configures
# at runtime — we use :tz here because it's leaner than tzdata.
{:tz, "~> 0.28", only: :test},
]
end
defp package do
[
files: ~w(lib priv mix.exs README.md LICENSE VERSION),
maintainers: ["Tyler Davis <me@tylermackdavis.com>"],
licenses: ["MIT"],
links: %{"Gitlab" => "https://gitlab.com/phinnaeus/wallet_passes"},
]
end
defp docs do
[
name: "wallet_passes",
canonical: "https://hexdocs.pm/wallet_passes",
extras: ["README.md", "LICENSE"],
]
end
defp dialyzer do
[
flags: [
:unmatched_returns,
:error_handling,
:extra_return,
:missing_return,
:underspecs,
],
plt_add_apps: [:mix, :ex_unit],
plt_local_path: "priv/plts/project.plt",
plt_core_path: "priv/plts/core.plt",
]
end
defp aliases do
[
"deps.check": ["hex.outdated", "hex.audit", "deps.audit"],
lint: [
"format",
"compile --warnings-as-errors --all-warnings --force",
"dialyzer",
"deps.clean --unlock --unused",
"credo suggest --min-priority 5",
],
"test.unit": ["test --exclude database --exclude integration"],
"test.integration": ["test --only integration"],
"test.db": ["test --only database"],
]
end
end