Skip to content

v1.6.0 — maak drives Mix

Choose a tag to compare

@jjba23 jjba23 released this 26 Nov 08:48
· 16 commits to trunk since this release
0c12873

Summary

(maak elixir) brings Mix into the same shape as the other toolchains. The
three command lines an Elixir project's automation writes -- mix test,
mix format and mix release -- are argv a task can inspect, a command runs in
another directory or for each application of an umbrella, and the name, version
and requirement a release reads come from mix.exs and mix.lock rather than
from a guess. Mix keeps the build: it owns the compiler, the dependency graph
and the release, and every helper here is a command line it would have been run
with.

Added

  • (maak elixir), re-exported by (maak maak).
    • mix-argv and mix build and run a task, with the switches Mix documents
      placed after the task name -- which is where Mix accepts them. It
      recognizes only --help and --version in front of the task, so
      mix --no-compile test is an error where mix test --no-compile runs.
    • mix-test-argv, mix-format-argv and mix-release-argv take the filters,
      switches and numbers mix help TASK documents. --only, --include and
      --exclude take a string or a list, and a list is one flag per filter,
      which is how Mix applies several at once. mix-test, mix-format and
      mix-release run them from words; mix-deps, mix-deps-get, mix-compile,
      mix-run and mix-clean are the one-line wrappers.
    • mix-cmd-argv runs a command in another directory (mix cmd --cd) or for
      each application of an umbrella (mix do --app ... cmd ..., which is what
      Mix documents in place of the deprecated mix cmd --app). Mix has no
      global --cd, so this is the only way to say "there".
    • mix-version and elixir-version answer with the number the program prints,
      read from the line that names it rather than from the Erlang/OTP banner
      above it.
    • mix-project, mix-project-name, mix-project-version,
      mix-project-elixir and mix-project-umbrella? read mix.exs as text.
      Literal fields are answered for, comments are dropped before anything is
      matched -- the file mix new writes leaves a commented out dependency
      carrying a tag: -- and a field the project computes is refused by name
      rather than guessed at.
    • mix-lock-versions and mix-lock-version answer with what mix.lock pins,
      and say which entry carries a revision rather than a version.
  • MAAK_MIX and MAAK_ELIXIR name the programs, falling back to MIX and
    ELIXIR; a value may carry a wrapper, as in MAAK_MIX="asdf exec mix". The
    manual page and the configuration page name both.
  • docs/elixir.org, with the three task lines, the directory and umbrella
    forms, and the two readers, linked from the guide's index, the README and the
    features list.

Verification

  • The full Veritas suite is green on the release commit (./scripts/maak-test,
    exit 0): 38 files, 140 suites, 1043 tests and 1141 assertions, including the
    spec that compares every copy of the version and the one that resolves every
    file: link in the guide.
  • test/veritas/unit/elixir.scm is 51 cases and needs no Elixir: the builders
    are asserted as word lists, the wrappers are read from a dry run, and the two
    version queries run stand-in programs the spec writes.
  • Every option name the module and its spec assert was checked against
    mix help TASK from Elixir 1.19.3, and the grammar claims were checked by
    running the CLI: mix test --only a --only b accumulates, mix --force test
    is refused, mix cmd --cd DIR cmd runs, and mix cmd --app warns that it is
    deprecated in favour of mix do --app.
  • The readers were checked against a project mix new generated, including the
    commented out dependency its template leaves behind.

Notes

  • mix release is normally assembled from MIX_ENV=prod, which is the task's
    environment to set:
    (run (mix-release-argv "--overwrite") #:env '(("MIX_ENV" . "prod"))).
  • The Arch recipe, the Void Linux template and the Homebrew formula get the
    checksum of this release's archive in a commit of its own, because it cannot
    be known until the tag is published.