defmodule Centralcloud.MixProject do
  use Mix.Project

  def project do
    [
      apps_path: "apps",
      version: "0.1.0",
      start_permanent: Mix.env() == :prod,
      deps: deps(),
      aliases: aliases(),
      releases: [
        centralcloud_my: [
          applications: [centralcloud_core: :permanent, centralcloud_my: :permanent],
          overlays: "rel/overlays",
          include_erts: System.get_env("INCLUDE_ERTS", "true") == "true",
          steps: [:assemble, :tar]
        ],
        centralcloud_staff: [
          applications: [centralcloud_core: :permanent, centralcloud_staff: :permanent],
          overlays: "rel/overlays",
          include_erts: System.get_env("INCLUDE_ERTS", "true") == "true",
          steps: [:assemble, :tar]
        ]
      ]
    ]
  end

  defp deps do
    [
      {:tailwind, "~> 0.2", runtime: false}
    ]
  end

  defp aliases do
    [
      "assets.deploy": [
        "tailwind staff --minify",
        "tailwind my --minify"
      ]
    ]
  end
end
