defmodule Refactorex.MixProject do
  use Mix.Project

  def project do
    [
      app: :refactorex,
      version: "0.1.52",
      elixir: "~> 1.13",
      start_permanent: Mix.env() == :prod,
      elixirc_paths: elixirc_paths(Mix.env()),
      description: description(),
      package: package(),
      deps: deps(),
      source_url: "https://github.com/gp-pereira/refactorex"
    ]
  end

  def application do
    [
      extra_applications: [:logger],
      mod: {Refactorex.Application, []}
    ]
  end

  defp description(), do: "Elixir source code refactoring"

  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  defp deps do
    [
      {:sourceror, "~> 1.7"},
      # import sourceror from commit
      # {:sourceror, github: "doorgan/sourceror", ref: "83a886effd592c0c312beae4d7d51151435c692f"},
      {:credo, "~> 1.7.0", only: [:test, :dev], runtime: false, optional: true}
    ]
  end

  defp package() do
    [
      files: ~w(lib .formatter.exs mix.exs README* LICENSE*),
      licenses: ["MIT"],
      links: %{"GitHub" => "https://github.com/gp-pereira/refactorex"}
    ]
  end
end
