defmodule NebulexAdaptersCachex.MixProject do use Mix.Project @source_url "https://github.com/cabol/nebulex_adapters_cachex" @version "2.1.1" @nbx_tag "2.5.2" @nbx_vsn "2.5" def project do [ app: :nebulex_adapters_cachex, version: @version, elixir: "~> 1.9", elixirc_paths: elixirc_paths(Mix.env()), aliases: aliases(), deps: deps(), # Testing test_coverage: [tool: ExCoveralls], preferred_cli_env: [ check: :test, coveralls: :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test ], # Dialyzer dialyzer: dialyzer(), # Hex package: package(), description: "A Nebulex adapter for Cachex", # Docs docs: [ main: "Nebulex.Adapters.Cachex", source_ref: "v#{@version}", source_url: @source_url ] ] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] def application do [] end defp deps do [ nebulex_dep(), {:cachex, "~> 3.6"}, {:telemetry, "~> 0.4 or ~> 1.0", optional: true}, # Test & Code Analysis {:excoveralls, "~> 0.17", only: :test}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:sobelow, "~> 0.13", only: [:dev, :test], runtime: false}, {:stream_data, "~> 0.6", only: [:dev, :test]}, # Benchmark Test {:benchee, "~> 1.1", only: :test}, {:benchee_html, "~> 1.0", only: :test}, # Docs {:ex_doc, "~> 0.30", only: [:dev, :test], runtime: false} ] end defp nebulex_dep do if path = System.get_env("NEBULEX_PATH") do {:nebulex, "~> #{@nbx_tag}", path: path} else {:nebulex, "~> #{@nbx_vsn}"} end end defp aliases do [ "nbx.setup": [ "cmd rm -rf nebulex", "cmd git clone --depth 1 --branch v#{@nbx_tag} https://github.com/cabol/nebulex" ], check: [ "compile --warnings-as-errors", "format --check-formatted", "credo --strict", "coveralls.html", "sobelow --exit --skip", "dialyzer --format short" ] ] end defp package do [ name: :nebulex_adapters_cachex, maintainers: ["Carlos Bolanos"], licenses: ["MIT"], links: %{"GitHub" => @source_url} ] end defp dialyzer do [ plt_add_apps: [:nebulex], plt_file: {:no_warn, "priv/plts/" <> plt_file_name()}, flags: [ :unmatched_returns, :error_handling, :no_opaque, :unknown, :no_return ] ] end defp plt_file_name do "dialyzer-#{Mix.env()}-#{System.otp_release()}-#{System.version()}.plt" end end