defmodule Sourced.MixProject do use Mix.Project @version "0.2.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(contract lib mix.exs .formatter.exs README.md LICENSE) ] end defp docs do [ main: "readme", extras: ["README.md"], source_url: @source_url, # Pinned to the release tag so published docs keep pointing at the code # they were built from. source_url_pattern: "#{@source_url}/-/blob/#{@version}/%{path}#L%{line}" ] end # `contract/` holds the adapter contract test suite and its fixtures. It ships # in the package (see `package/0`) but is compiled only in :test, so it stays # out of this app's own build and out of every downstream app's. Adapters add # `deps/sourced/contract` to their `elixirc_paths(:test)` to compile it into # their test build, which pins the contract to the `:sourced` version they # already depend on. 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