defmodule MultiSelectExample.MixProject do
  use Mix.Project

  def project do
    [
      app: :multi_select_example,
      version: "0.1.0",
      elixir: "~> 1.14",
      elixirc_paths: elixirc_paths(Mix.env()),
      start_permanent: Mix.env() == :prod,
      aliases: aliases(),
      prune_code_paths: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [
      mod: {MultiSelectExample.Application, []},
      extra_applications: [:logger, :runtime_tools]
    ]
  end

  # Specifies which paths to compile per environment.
  defp elixirc_paths(:test), do: ["lib", "test/support"]
  defp elixirc_paths(_), do: ["lib"]

  # Specifies your project dependencies.
  defp deps do
    [
      {:phoenix,              "~> 1.7",   override: true},
      {:phoenix_html,         "~> 4.1"},
      {:phoenix_live_reload,  "~> 1.5",       only: :dev},
      {:phoenix_live_view,    "~> 0.20"},
      {:heroicons,            "~> 0.5"},
      {:esbuild,              "~> 0.8",    runtime: Mix.env() == :dev},
      {:tailwind,             "~> 0.2",    runtime: Mix.env() == :dev},
      {:faker,                "~> 0.18",   runtime: false},
      {:gettext,              "~> 0.24"},
      {:jason,                "~> 1.4"},
      {:plug_cowboy,          "~> 2.7"},
      #{:phoenix_multi_select, git: "https://github.com/saleyn/phx-multi-select.git", branch: "main"},
      {:phoenix_multi_select, path: "../", in_umbrella: true},
    ]
  end

  defp aliases do
    [
      setup: ["deps.get", "assets.deploy"],
      "assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"]
    ]
  end
end
