Making sbt Macro-Aware
Macros made their first appearance as a fork of the Scala compiler and then as an experimental feature in the version 2.10.0 of Scala. Since macros are normal Scala functions that are executed by the compiler during the compilation of their clients, they can introduce dependencies between compilation units in new and exciting ways. In which ways is post-macro dependency analysis different from its pre- macro days? How do we analyze all the code that’s involved in macro expansion, not just the end result? How can we know what parts of a program have been inspected by a given macro in order to produce a specific expansion? The goal of this report is to explain how macros affect incremental compilation and outline the techniques used to upgrade sbt to provide better support for macro-based programs.