defmodule Devops.MixProject do use Mix.Project # The single source of truth `Devops.Version.bump!/1` amends and # `Devops.HexPublish` reads for what to publish -- read here too so # `Mix.Project.config()[:version]` (and therefore `mix hex.publish` # itself) never drifts from what that file says after a bump. @version ".version" |> File.read!() |> String.trim() def project do [ app: :devops, version: @version, elixir: "~> 1.20", start_permanent: Mix.env() == :prod, description: "Git-flow, quality-gate, and release automation for single-package Elixir projects.", package: package(), docs: docs(), deps: deps(), test_coverage: [tool: ExCoveralls], dialyzer: [ plt_add_apps: [:mix], plt_file: {:no_warn, "priv/plts/devops.plt"} ] ] end defp package do [ # `.version` is a dotfile, so Hex's default `:files` list (lib, mix.exs, # README*, LICENSE*, etc.) silently drops it -- and `mix.exs` reads it # at compile time (see `@version` above), so a package built without it # fails to compile the moment it's unpacked outside this checkout. files: ~w(lib mix.exs .formatter.exs README.md LICENSE .version), licenses: ["MIT"], links: %{"GitHub" => "https://github.com/wimwian-org/devops"} ] end defp docs do [ main: "readme", extras: ["README.md", "LICENSE"] ] end def cli do [ preferred_envs: [ coveralls: :test, "coveralls.html": :test, "coveralls.json": :test ] ] end # Run "mix help compile.app" to learn about applications. def application do [ extra_applications: [:logger] ] end # Run "mix help deps" to learn about dependencies. defp deps do [ {:req, "~> 0.7"}, {:plug, "~> 1.0", only: :test}, # Not a runtime dependency of devops itself -- Devops.CommitMessage.AI # reaches GitOps.Commit.parse/1 via Code.ensure_loaded?/1 + apply/3 so # it works whether or not a CONSUMING project has git_ops installed. # Pulled in here only so devops's own test suite can exercise that # in-process call against the real library instead of only a stub. {:git_ops, "~> 2.12", optional: true}, # Same shape as git_ops above: Devops.HexPublish.fetch_latest/2 reaches # :hex_core via Code.ensure_loaded?/1 + apply/3, falling back to # shelling out to `mix hex.info` when it is absent, so a project that # already has hex_core (most do, transitively via the `hex` archive) # gets the official client and one that does not still works. {:hex_core, "~> 0.19", optional: true}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:excoveralls, "~> 0.18", optional: true}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:doctor, "~> 0.21", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.29", only: [:dev, :test], runtime: false} ] end end