defmodule HttpStructuredField.MixProject do use Mix.Project @github "https://github.com/cogini/http_structured_field" @version "0.1.4" def project do [ app: :http_structured_field, version: @version, elixir: "~> 1.13", start_permanent: Mix.env() == :prod, aliases: aliases(), dialyzer: [ plt_add_apps: [:mix, :eex, :ex_unit] # plt_add_deps: true, # flags: ["-Werror_handling", "-Wrace_conditions"], # flags: ["-Wunmatched_returns", :error_handling, :race_conditions, :underspecs], # ignore_warnings: "dialyzer.ignore-warnings" ], test_coverage: [tool: ExCoveralls], description: description(), package: package(), source_url: @github, homepage_url: @github, docs: docs(), deps: deps() ] end def application do [ extra_applications: [:logger] ++ extra_applications(Mix.env()) ] end def cli do [ preferred_envs: [ coveralls: :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test, "coveralls.lcov": :test, quality: :test, "quality.ci": :test ] ] end defp extra_applications(env) when env in [:dev, :test], do: [:eex] defp extra_applications(_), do: [] defp deps do [ {:credo, "~> 1.6", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4.0", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.39.0", only: :dev, runtime: false}, {:excoveralls, "~> 0.18.0", only: [:dev, :test], runtime: false}, {:junit_formatter, "~> 3.3", only: [:dev, :test], runtime: false}, {:mix_audit, "~> 2.0", only: [:dev, :test], runtime: false}, {:nimble_parsec, "~> 1.1"}, {:styler, "~> 1.10.0", only: [:dev, :test], runtime: false} ] end defp description do "Library to parse RFC 8941 Structured Field Values for HTTP" end defp package do [ description: description(), maintainers: ["Jake Morrison"], licenses: ["Apache-2.0"], links: %{ "GitHub" => @github, "Changelog" => "#{@github}/blob/#{@version}/CHANGELOG.md##{String.replace(@version, ".", "")}" } ] end defp docs do [ main: "readme", source_url: @github, source_ref: @version, extras: [ "README.md", "CHANGELOG.md": [title: "Changelog"], "LICENSE.md": [title: "License (Apache-2.0)"], "CONTRIBUTING.md": [title: "Contributing"], "CODE_OF_CONDUCT.md": [title: "Code of Conduct"] ], # api_reference: false, source_url_pattern: "#{@github}/blob/master/%{path}#L%{line}" ] end defp aliases do [ setup: ["deps.get"], quality: [ "test", "format --check-formatted", # "credo", "credo --mute-exit-status", # mix deps.clean --unlock --unused "deps.unlock --check-unused", # mix deps.update # "hex.outdated", # "hex.audit", "deps.audit", "dialyzer --quiet-with-result" ], "quality.ci": [ "format --check-formatted", "deps.unlock --check-unused", # "hex.outdated", "hex.audit", "deps.audit", "credo", "dialyzer --quiet-with-result" ] ] end end