defmodule ExAST.MixProject do use Mix.Project @version "0.12.7" @source_url "https://github.com/elixir-vibe/ex_ast" def project do [ app: :ex_ast, version: @version, elixir: "~> 1.19", start_permanent: Mix.env() == :prod, deps: deps(), name: "ExAST", description: "Search, replace, and diff Elixir code by AST pattern", source_url: @source_url, docs: docs(), package: package(), aliases: aliases(), dialyzer: [ plt_file: {:no_warn, "_build/dev/dialyxir_plt.plt"}, ignore_warnings: ".dialyzer_ignore.exs" ] ] end def application do [extra_applications: [:logger]] end defp deps do [ {:sourceror, "~> 1.7"}, {:jason, "~> 1.4"}, {:ex_doc, "~> 0.34", only: :dev, runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:ex_slop, "~> 0.4.1", only: [:dev, :test], runtime: false}, {:ex_dna, "~> 1.5", only: [:dev, :test], runtime: false} ] end defp docs do [ main: "readme", source_ref: "v#{@version}", extras: [ "README.md", "CHANGELOG.md", "LICENSE", "guides/getting-started.md", "guides/pattern-language.md", "guides/querying.md", "guides/indexing.md", "guides/cli.md", "guides/diff.md" ], groups_for_extras: [ Guides: ~r/guides\// ] ] end defp package do [ licenses: ["MIT"], links: %{"GitHub" => @source_url} ] end def cli do [preferred_envs: [ci: :test]] end defp aliases do [ ci: [ "compile --warnings-as-errors", "format --check-formatted", "credo --strict", "cmd mix credo --strict --checks-with-tag ex_slop", "reach_static", "dialyzer", "test", "ex_dna" ], reach_static: [ "cmd --cd tools/reach_runner mix deps.get", "cmd --cd tools/reach_runner mix reach.check --smells ../../lib", "cmd --cd tools/reach_runner mix reach.check --smells ../../test", "cmd --cd tools/reach_runner mix reach.check --dead-code ../../lib", "cmd --cd tools/reach_runner mix reach.check --dead-code ../../test" ], reach_smells: ["reach_static"] ] end end