mix virtual_time.upgrade (GenServerVirtualTimeMigrate v1.1.1)

Copy Markdown View Source

Moves a project off the deprecated code-generator module names.

ActorSimulation.CAFGenerator and its five siblings became ActorSimulation.Codegen.*. The old names still work and warn, so this is optional: it is the difference between a build with deprecation warnings and a build without them.

Usage

mix virtual_time.upgrade                        # what would change, and what needs a human
mix virtual_time.upgrade --write                 # apply it
mix virtual_time.upgrade --check                 # exit 1 when something would change (CI)
mix virtual_time.upgrade --paths lib --paths test

What it rewrites

  • ActorSimulation.CAFGenerator.generate(...), and the five siblings used the same way;
  • alias ActorSimulation.CAFGenerator with the bare CAFGenerator.foo() calls that follow it, when the name it becomes (CAF) is free in that file.

It reports instead of guessing when an alias uses as:, when the new short name is already taken, and when a bare short name has no alias it can point at.

The rewrite is a token replacement, not a reformat: the rest of the file is byte for byte what it was, so the diff shows only what changed.