defmodule BlogEngine.MixProject do use Mix.Project @version "0.1.0" @source_url "https://github.com/agoodway/blogengine" def project do [ app: :blog_engine, version: @version, description: "A standalone, tenant-aware blog domain library for Elixir and PostgreSQL applications", elixir: "~> 1.15", source_url: @source_url, elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, aliases: aliases(), docs: docs(), package: package(), dialyzer: dialyzer(), deps: deps() ] end def cli do [preferred_envs: [check: :test, quality: :test]] end # Run "mix help compile.app" to learn about applications. def application do [ extra_applications: [:logger] ] end # Run "mix help deps" to learn about dependencies. defp deps do [ {:ecto, "~> 3.13"}, {:ecto_sql, "~> 3.13"}, {:postgrex, "~> 0.22"}, {:ecto_evolver, "~> 0.1.0"}, {:igniter, "~> 0.8", optional: true}, {:phoenix, "~> 1.8.0", only: :test, runtime: false}, {:phoenix_live_view, "~> 1.1.0", only: :test, runtime: false}, {:phoenix_html, "~> 4.2", only: :test, runtime: false}, {:phoenix_ecto, "~> 4.7", only: :test, runtime: false}, {:lazy_html, "~> 0.1", only: :test, runtime: false}, {:telemetry, "~> 1.3"}, {:stream_data, "~> 1.1", only: :test}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:sobelow, "~> 0.14", only: [:dev, :test], runtime: false}, {:ex_slop, "~> 0.3", only: [:dev, :test], runtime: false}, {:ex_dna, "~> 1.2", only: [:dev, :test], runtime: false}, {:doctor, "~> 0.22 or ~> 0.23", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.38 or ~> 0.39 or ~> 0.40", only: :dev, runtime: false} ] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] defp aliases do [ test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], check: [ "format --check-formatted", "compile --warnings-as-errors", "credo --strict", "doctor", "test" ], quality: [ "compile --warnings-as-errors", "deps.unlock --unused", "format --check-formatted", "sobelow --config", "ex_dna", "doctor", "credo --strict" ] ] end defp dialyzer do [ plt_add_apps: [:mix, :ex_unit], plt_file: {:no_warn, "priv/plts/dialyzer.plt"}, ignore_warnings: ".dialyzer_ignore.exs", flags: [:error_handling, :unknown] ] end defp docs do [ main: "readme", source_ref: "v#{@version}", extras: ["README.md", "guides/installation.md", "CHANGELOG.md"] ] end defp package do [ files: ~w( lib priv guides .formatter.exs mix.exs README.md CHANGELOG.md LICENSE ), licenses: ["MIT"], links: %{ "Documentation" => "https://hexdocs.pm/blog_engine", "GitHub" => @source_url } ] end end