defmodule Cli.MixProject do
  use Mix.Project

  def project do
    [
      app: :cli,
      version: "0.1.0",
      build_path: "../../_build",
      config_path: "../../config/config.exs",
      deps_path: "../../deps",
      lockfile: "../../mix.lock",
      elixir: "~> 1.8",
      start_permanent: Mix.env() == :prod,
      elixirc_paths: elixirc_paths(Mix.env()),
      deps: deps(),
      elixirc_options: [warnings_as_errors: true]
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger, :logger_file_backend, :ethereumex]
    ]
  end

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

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      # Umbrella deps
      {:blockchain, in_umbrella: true},
      {:ex_wire, in_umbrella: true, runtime: false},
      {:merkle_patricia_tree, in_umbrella: true},

      # External deps
      {:ethereumex, "~> 0.5.1"},
      {:progress_bar, "~> 1.7.0"},
      {:logger_file_backend, "~> 0.0.10"}
    ]
  end
end
