Current section

Files

Jump to
Raw

mix.exs

defmodule Wsdataselect.MixProject do
  use Mix.Project

  def project do
    [
      app: :wsdataselect,
      version: "1.1.46",
      elixir: "~> 1.18",
      elixirc_paths: elixirc_paths(Mix.env()),
      compilers: [:elixir_make | Mix.compilers()],
      start_permanent: Mix.env() == :prod,
      aliases: aliases(),
      deps: deps(),
      package: package(),
      description:
        "Implementation of the FDSN dataselect webservice for Epos-France seismological datacenter",
      source_url: "https://gricad-gitlab.univ-grenoble-alpes.fr/OSUG/RESIF/wsdataselect",
      homepage_url: "https://gricad-gitlab.univ-grenoble-alpes.fr/OSUG/RESIF/wsdataselect",
      test_coverage: [
        tool: ExCoveralls,
        ignore_modules: [
          Wsdataselect.ApiSpec,
          DeliveryMetrics.GeoIP,
          DeliveryMetrics.NetworkExtend
        ]
      ],
      preferred_cli_env: [
        coveralls: :test,
        "coveralls.detail": :test,
        "coveralls.post": :test,
        "coveralls.html": :test,
        "coveralls.cobertura": :test
      ],
      dialyzer: [
        ignore_warnings: ".dialyzer_ignore.exs",
        plt_file: {:no_warn, "priv/plts/project.plt"}
      ],
      listeners: [Phoenix.CodeReloader]
    ]
  end

  defp package do
    [
      licenses: ["GPL-3.0-or-later"],
      links: %{
        "FDSN webservices" => "https://www.fdsn.org/webservices/",
        "Epos-France seismological data center" => "https://seisdata.epos-france.fr"
      }
    ]
  end

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

  def cli do
    [
      preferred_envs: [precommit: :test]
    ]
  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.
  #
  # Type `mix help deps` for examples and options.
  defp deps do
    [
      {:elixir_make, "~> 0.9", runtime: false},
      {:phoenix, "~> 1.8.0"},
      {:phoenix_ecto, "~> 4.5"},
      {:ecto_sql, "~> 3.13"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_live_dashboard, "~> 0.8.3"},
      {:req, "~> 0.5"},
      {:telemetry_metrics, "~> 1.0"},
      {:telemetry_poller, "~> 1.0"},
      {:jason, "~> 1.4"},
      {:dns_cluster, "~> 0.2"},
      {:bandit, "~> 1.8"},
      ### Sentry and traces support
      {:sentry, "~> 13.0"},
      {:opentelemetry, "~> 1.5"},
      {:opentelemetry_api, "~> 1.4"},
      {:opentelemetry_exporter, "~> 1.0"},
      {:opentelemetry_semantic_conventions, "~> 1.27"},
      {:opentelemetry_phoenix, "~> 2.0"},
      {:opentelemetry_ecto, "~> 1.2"},
      {:opentelemetry_bandit, "~> 0.3"},
      ###
      ### AWS dependencies
      {:ex_aws, "~> 2.1"},
      {:ex_aws_s3, "~> 2.0"},
      {:hackney, "~> 4.7"},
      {:sweet_xml, "~> 0.6"},
      ###
      {:cachex, "~> 4.0"},
      {:ua_parser, "~> 1.9"},
      {:geohash, "~> 1.0"},
      {:graceful_stop, "~> 0.2"},
      {:fdsn_plugs, "~> 1.0"},
      {:locus, "~> 2.3"},
      {:remote_ip, "~> 1.2"},
      {:open_api_spex, "~> 3.21"},
      {:castore, "~> 1.0"},
      ### Dev, tests deps
      {:ex_doc, "~> 0.20", only: :dev, runtime: false},
      {:ex_machina, "~> 2.8", only: [:test]},
      {:junit_formatter, "~> 3.4", only: [:test]},
      {:excoveralls, "~> 0.18", only: [:test]},
      {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
      {:credo, ">= 0.0.0", only: [:dev, :test]}
      # {:flame_on, git: "https://github.com/DockYard/flame_on", branch: "main", only: [:dev]}
    ]
  end

  # Aliases are shortcuts or tasks specific to the current project.
  # For example, to install project dependencies and perform other setup tasks, run:
  #
  #     $ mix setup
  #
  # See the documentation for `Mix` for more info on aliases.
  defp aliases do
    [
      setup: ["deps.get", "ecto.setup"],
      "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
      "ecto.reset": ["ecto.drop", "ecto.setup"],
      test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
      precommit: ["compile --warning-as-errors", "deps.unlock --unused", "format", "test"]
    ]
  end
end