defmodule Sourced.MixProject do use Mix.Project @version "0.1.0" @source_url "https://gitlab.com/dimakula/sourced" def project do [ app: :sourced, version: @version, elixir: "~> 1.15", start_permanent: Mix.env() == :prod, elixirc_paths: elixirc_paths(Mix.env()), description: description(), package: package(), docs: docs(), source_url: @source_url, dialyzer: [ # contract/ is compiled in :test and drives ExUnit.CaseTemplate, whose # generated code calls into ExUnit. ExUnit is not in Dialyzer's default # PLT, so without this every one of those calls is an unknown_function. plt_add_apps: [:ex_unit], # Both PLTs in one project-local directory so CI can cache them. The # core PLT defaults to MIX_HOME, outside CI_PROJECT_DIR, where GitLab's # cache cannot reach it — and it is ~50s of the ~3min cold build. plt_core_path: "plts", plt_local_path: "plts" ], deps: deps() ] end # Run "mix help compile.app" to learn about applications. def application do [ extra_applications: [:logger] ] end defp description do "Event sourcing for Elixir on the Dynamic Context Boundary (DCB) model: " <> "one flat event stream, events tagged with the domain concepts they " <> "concern, and consistency enforced by optimistic locking scoped to the " <> "slice of the stream a decision actually read." end defp package do [ licenses: ["Apache-2.0"], links: %{"GitLab" => @source_url}, files: ~w(lib mix.exs .formatter.exs README.md LICENSE) ] end defp docs do [ main: "readme", extras: ["README.md"], source_url: @source_url, # This project is a subdirectory of the repository, so the default pattern # — which assumes the mix project sits at the repo root — would link every # module one directory too high. Pinned to the release tag so published # docs keep pointing at the code they were built from. source_url_pattern: "#{@source_url}/-/blob/#{@version}/core/%{path}#L%{line}" ] end # `contract/` holds the adapter contract test suite and its fixtures. It is # compiled only in :test, so it never reaches the published package — adapters # in sibling projects pull it in through their own `elixirc_paths`. defp elixirc_paths(:test), do: ["lib", "contract"] defp elixirc_paths(_), do: ["lib"] # Run "mix help deps" to learn about dependencies. defp deps do [ {:telemetry, "~> 1.0"}, # Dev/test dependencies {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.34", only: :dev, runtime: false}, {:mimic, "~> 2.0", only: :test} ] end end