View Source mix compile.propagate_file_modifications (antikythera v0.5.1)

Touches source files that need to be recompiled.

Normally mix automatically resolves which source files to recompile based on file modification times. However some macro-related code modifications do not trigger recompilation. This mix task finds those kinds of modifications and touch files to compile so that subsequent task recompiles them.

Note that @external_resource module attribute does not support directory as external dependency of a module. For a module that depends on all files under a directory, we have to manually check the latest modification time of the whole directory tree.

Current targets of this task are:

  • mix.exs files in gear projects depend on mix_common.exs in the antikythera repository. Mix assumes that project configurations reside only in mix.exs and config/*.exs, so even if mix_common.exs has been modified mix does not notice. Note that antikythera's mix.exs also depends on mix_common.exs but it's handled differently (at the beginning of mix.exs), because we can't run mix tasks before it's compiled!
  • SomeGear.Template module depends on all existing HAML templates in web/template/.
  • Similarly, SomeGear.Asset module depends on all asset files in priv/static/. Although SomeGear.Asset is recompiled after modifying an asset file, it doesn't automatically trigger recompilation/reload in iex session because priv/static/** is not monitored by :exsync (in current configuration).

Summary

Functions

Callback implementation for Mix.Task.Compiler.run/1.

Functions