Repository navigation
v1.6.0 — maak drives Mix
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-argvandmixbuild and run a task, with the switches Mix documents
placed after the task name -- which is where Mix accepts them. It
recognizes only--helpand--versionin front of the task, so
mix --no-compile testis an error wheremix test --no-compileruns.mix-test-argv,mix-format-argvandmix-release-argvtake the filters,
switches and numbersmix help TASKdocuments.--only,--includeand
--excludetake a string or a list, and a list is one flag per filter,
which is how Mix applies several at once.mix-test,mix-formatand
mix-releaserun them from words;mix-deps,mix-deps-get,mix-compile,
mix-runandmix-cleanare the one-line wrappers.mix-cmd-argvruns 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 deprecatedmix cmd --app). Mix has no
global--cd, so this is the only way to say "there".mix-versionandelixir-versionanswer 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-elixirandmix-project-umbrella?readmix.exsas text.
Literal fields are answered for, comments are dropped before anything is
matched -- the filemix newwrites leaves a commented out dependency
carrying atag:-- and a field the project computes is refused by name
rather than guessed at.mix-lock-versionsandmix-lock-versionanswer with whatmix.lockpins,
and say which entry carries a revision rather than a version.
MAAK_MIXandMAAK_ELIXIRname the programs, falling back toMIXand
ELIXIR; a value may carry a wrapper, as inMAAK_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.scmis 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 TASKfrom Elixir 1.19.3, and the grammar claims were checked by
running the CLI:mix test --only a --only baccumulates,mix --force test
is refused,mix cmd --cd DIR cmdruns, andmix cmd --appwarns that it is
deprecated in favour ofmix do --app. - The readers were checked against a project
mix newgenerated, including the
commented out dependency its template leaves behind.
Notes
mix releaseis normally assembled fromMIX_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.